Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: count(): Parameter must be an array or an object .... #52

Open
joergdd opened this issue Mar 20, 2018 · 2 comments
Open

Warning: count(): Parameter must be an array or an object .... #52

joergdd opened this issue Mar 20, 2018 · 2 comments

Comments

@joergdd
Copy link

joergdd commented Mar 20, 2018

What does this error mean and how do you get it off?

Error:
"Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\lib\plugins\pagequery\inc\pagequery.php on line 1124"

usage:
{{pagequery>
@tech_doku:software:ms_excel:tipps_und_tricks *;
hidestart;
sort=a,name;
filter=!name:c_template;
proper;
display={title};
bullet=disc
}}

@FurloSK
Copy link

FurloSK commented Oct 8, 2019

Plugin was throwing the very same error on me, fortunately it is easy to fix.

Open pagequery.php and move line 1124 ($level = count($group_opts['key']) - 1;)
to line 1139 (just before foreach($sort_array as $row) {).

Or edit it according to this diff:

@@ -1121,7 +1121,6 @@
      *                              array(0, '...') =>  0 = normal row item (not heading)
      */
     function mgroup(&$sort_array, $keys, $group_opts = array()) {
-        $level = count($group_opts['key']) - 1;
         $prevs = array();
         $results = array();
         $idx = 0;
@@ -1137,6 +1136,7 @@
                 $results[] = $result;
             }
         } else {
+            $level = count($group_opts['key']) - 1;
             foreach($sort_array as $row) {
                 $this->_add_heading($results, $sort_array, $group_opts, $level, $idx, $prevs);
                 $result = array(0); // basic item (page link) is level 0

@mprins
Copy link
Contributor

mprins commented Oct 18, 2020

@MrBertie Still seeing this today in the latest version: [18-Oct-2020 12:05:24 Europe/Amsterdam] PHP Warning: count(): Parameter must be an array or an object that implements Countable in D:\www\wild-water.nl\www\dokuwiki\lib\plugins\pagequery\inc\pagequery.php on line 1124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants