Okay
  Public Ticket #1777753
warnin after upgrading to php 7.2
Open

Comments

  • Jorge started the conversation

    After upgrading our server to php 5.6 to 7.2 .1 we recived the fallowing warnings in the wiki page . 

      Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\apps\wordpress\htdocs\wp-content\themes\woffice\framework-customizations\extensions\woffice-wiki\includes\Woffice_Wiki_Display_Manager.phpon line 477

    Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\apps\wordpress\htdocs\wp-content\themes\woffice\framework-customizations\extensions\woffice-wiki\includes\Woffice_Wiki_Display_Manager.php on line 475

    please help with this problem 

    regards 

    Attached files:  wiki warning.JPG

  •  519
    François replied

    Hello Jorge, 

    What version of Woffice do you have installed on your side?

    We'll look into that for the next version. If you need it fixed now, you can simply replace, line 479 and so, to: 

    protected function getNumberOfElements( $term_id) {
                $n_elements = 0;
                $children = $this->getSubcategories( $term_id);
                foreach($children as $child_term) {
                    $grouped_posts = $this->getGroupedPosts($child_term->term_id);
                    $n_elements += count((array) $grouped_posts);
                }
                $n_elements += count((array) $this->getGroupedPosts($term_id));
                return $n_elements;
            }
    

    In: woffice/framework-customizations/extensions/woffice-wiki/includes/Woffice_Wiki_Display_Manager.php

    Please let me know if you need more details

    Kind Regards,

    Fran├žois 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/