• Hi, this appeared on the user edit profile page in the backend of WP:

    Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, bool given in /web/wp-content/plugins/pie-register/classes/profile_admin.php:552 Stack trace: #0 /web/wp-includes/class-wp-hook.php(324): Profile_admin->edit_user_profile() #1 /web/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #2 /web/wp-includes/plugin.php(517): WP_Hook->do_action() #3 /web/wp-admin/user-edit.php(891): do_action() #4 {main} thrown in /web/wp-content/plugins/pie-register/classes/profile_admin.php on line 552

    The function sizeof() is being used on $this->data in profile_admin.php (line 552), but sometimes $this->data is false instead of an array. This happens when getCurrentFields($this->regFormForFreeVers()) returns false, causing a TypeError because sizeof() only works on arrays or countable objects.

    Potential solution that worked for me:

    Update line 552 to first check if $this->data is an array before using count().

    Fixed Code:

    if (is_array($this->data) && count($this->data) > 0)

    This prevents the error by ensuring count() is only used on an actual array.

Viewing 1 replies (of 1 total)
  • Plugin Support Ghulam Hemani

    (@ghulamhemani)

    Hi,

    Thank you for bringing this to our attention. We have shared this with our team, and they will review it. The issue will be addressed and fixed in our next release.
    Let us know if you need any further assistance.

    Thank you,
    Pie Register Support.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.