• HighRollerUSA

    (@highrollerusa)


    Hi Ed,
    I’m glad to hear that you’ll still be working on RootsPersona (time allowing of course). I understand that you’ve been keeping it compatible with the latest PHP and WordPress versions, so I’m curious if you know the source of the following errors. I’m not sure when they first appeared (my site gets low traffic and user’s hadn’t notified me), but I’m recently getting hundreds of the following errors repeating on the page:

    Warning: count(): Parameter must be an array or an object that implements Countable in /htdocs/wp-content/plugins/rootspersona/php/class-RP-Persona-Factory.php on line 223
    
    Warning: count(): Parameter must be an array or an object that implements Countable in /htdocs/wp-content/plugins/rootspersona/php/class-RP-Persona-Factory.php on line 328

    On that page I have a simple shortcode of :
    [rootsPersonaDescendancy personId='I1363' batchId='1' /]

    When I tried to edit the page in admin, those errors overwhelmed the screen and I couldn’t navigate away. I then installed “Disable Gutenberg” plugin, and I was at least able to then edit the page in admin, but the errors on the front end remain.

    I’m on PHP 7.3 and WP 5.3.
    I hope you can point me in the right direction.

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter HighRollerUSA

    (@highrollerusa)

    Line 223 of /rootspersona/php/class-RP-Persona-Factory.php is where the error is thrown.

    222: $marriages = RP_Dao_Factory::get_rp_persona_dao()->get_marriages($persona);
    223: $cnt = count($marriages);

    It is looking for a countable variable in $marriages, but is not finding it.

    By putting
    var_dump($marriages);
    before line 223, I can see that [“marriages”]=> NULL .

    I can scan for and correct the error in the variable by putting
    if(!is_array($marriages) || empty($marriages)) $marriages = array(); // FIX ERROR!!!
    before line 223.

    NOTE: this gets rid of the warnings, but it does not fix the problem of bad data coming from the array.

    Plugin Author ed4becky

    (@ed4becky)

    Can you send me a copy of the file you are trying to import?

    Also, what version of RP are you running?

    Thread Starter HighRollerUSA

    (@highrollerusa)

    Hi Ed,

    I am using RP Version 3.7.1, PHP 7.3, and WP 5.3.

    I wasn’t trying to import anything, this is simply the display of the page with the RP Descendency shortcode:
    [rootsPersonaDescendancy personId='I1363' batchId='1' /]

    Thanks!

    Having same issue here. Hope there’s a solution

    Was there a resolution to this issue? I am having something similar but am unsure how to proceed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Parameter and array errors on front end’ is closed to new replies.