Public Ticket #1777753
warnin after upgrading to php 7.2


  • 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 


    Attached files:  wiki warning.JPG

  •  620
    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,


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

  • Jorge replied

    thank you for the solution it works perfect.


  •  599
    Imran replied

    Hi Jorge,

    Glad to hear the above was helpful. I'll go ahead and close this ticket now. As always if there's anything else we can help with in future please do feel free to submit a new support ticket.

    Kind regards, 

    Best Regards,

    P.S.: Want feedback on your awesome Intranet? Get yourself a beta access on Feedier.com.