Title: Parameter and array errors on front end
Last modified: November 26, 2019

---

# Parameter and array errors on front end

 *  [HighRollerUSA](https://wordpress.org/support/users/highrollerusa/)
 * (@highrollerusa)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/parameter-and-array-errors-on-front-end/)
 * 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!
    -  This topic was modified 6 years, 6 months ago by [HighRollerUSA](https://wordpress.org/support/users/highrollerusa/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fparameter-and-array-errors-on-front-end%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [HighRollerUSA](https://wordpress.org/support/users/highrollerusa/)
 * (@highrollerusa)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/parameter-and-array-errors-on-front-end/#post-12194230)
 * 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](https://wordpress.org/support/users/ed4becky/)
 * (@ed4becky)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/parameter-and-array-errors-on-front-end/#post-12216587)
 * 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](https://wordpress.org/support/users/highrollerusa/)
 * (@highrollerusa)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/parameter-and-array-errors-on-front-end/#post-12217624)
 * 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!
 *  [Cicuta33](https://wordpress.org/support/users/cicuta33/)
 * (@cicuta33)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/parameter-and-array-errors-on-front-end/#post-12321384)
 * Having same issue here. Hope there’s a solution
 *  [Jonathan Emmert](https://wordpress.org/support/users/emmertjo/)
 * (@emmertjo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/parameter-and-array-errors-on-front-end/#post-12719886)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/rootspersona_d7ebd4.svg)
 * [RootsPersona](https://wordpress.org/plugins/rootspersona/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rootspersona/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rootspersona/)
 * [Active Topics](https://wordpress.org/support/plugin/rootspersona/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rootspersona/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rootspersona/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [Jonathan Emmert](https://wordpress.org/support/users/emmertjo/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/parameter-and-array-errors-on-front-end/#post-12719886)
 * Status: not resolved