Welcome to Geeklog Friday, March 22 2019 @ 12:20 am EDT

Geeklog Forums

count(): Parameter must be an array or an object that implements Countable


Status: offline

alb3rt

Forum User
Chatty
Registered: 30/10/06
Posts: 59
Location:Mexico City
Hello everybody,

I am getting an error to the "My account" section (~/usersettings.php), when trying to save the data it shows me this error:

PHP Formatted Code

E_WARNING(2) - count(): Parameter must be an array or an object that implements Countable @ /home/ramos/VirtualHost/beta/public_html/usersettings.php line 1343
 


PHP Formatted Code

1       savepreferences /home/ramos/VirtualHost/beta/public_html/usersettings.php       1577
 


I'm using: MariaDB 10.1.34 and PHP 7.2.10

Any ideas?

Thanks.

D Web Studio - www.d-webstudio.net

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1343
You didn't saw what version of Geeklog you are using...

I believe this error relates to PHP 7.2 and has been fixed in the upcoming version of Geeklog.

For Geeklog v2.2.0 in usersetting.php around line 1336 replace:

PHP Formatted Code
    $TIDS = @array_values($A['topics']);       // array of strings
    $AIDS = @array_values($A['selauthors']);   // array of integers
    $BOXES = @array_values($A['blocks']);       // array of integers
    $ETIDS = @array_values($A['etids']);        // array of strings
    $AETIDS = USER_getAllowedTopics();          // array of strings (fetched, needed to "clean" $TIDS and $ETIDS)


with this:


PHP Formatted Code
    $TIDS = array();
    if (isset($A['topics']) && is_array($A['topics'])) {
        $TIDS = array_values($A['topics']);     // array of strings
    }

    $AIDS = array();
    if (isset($A['selauthors']) && is_array($A['selauthors'])) {
        $AIDS = array_values($A['selauthors']); // array of integers
    }

    $BOXES = array();
    if (isset($A['blocks']) && is_array($A['blocks'])) {
        $BOXES = array_values($A['blocks']);    // array of integers
    }

    $ETIDS = array();
    if (isset($A['etids']) && is_array($A['etids'])) {
        $ETIDS = array_values($A['etids']);     // array of strings
    }

    $AETIDS = USER_getAllowedTopics();          // array of strings (fetched, needed to "clean" $TIDS and $ETIDS)


Let us know if it fixes your problem.
One of the Geeklog Core Developers.

Status: offline

alb3rt

Forum User
Chatty
Registered: 30/10/06
Posts: 59
Location:Mexico City
Thank you very much Laugh, I use gl 2.2.0 and the problem has been solved with your answer.

D Web Studio - www.d-webstudio.net

Status: offline

remy

Forum User
Full Member
Registered: 09/06/03
Posts: 148
Location:Rotterdam & Bonn
indescribable
Well, not in my case.
Patched the change in usersettings, and then comes

E_WARNING(2) - sizeof(): Parameter must be an array or an object that implements Countable @ /system/classes/XML/RPC.php line 1724


Though the user data seems to update.

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1343

Status: offline

remy

Forum User
Full Member
Registered: 09/06/03
Posts: 148
Location:Rotterdam & Bonn
Well, too bad. I can't run below php 7.1.
When is a clean version expected?

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1343
Geeklog v2.2.0 runs fine on PHP 7.1 (that is what I use). It is PHP 7.2 that it has problems with. The next release is more than a few months away probably.
One of the Geeklog Core Developers.

All times are EDT. The time is now 12:20 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content