• Resolved erbrown777

    (@erbrown)


    When adding or editing a season I get the following error

    Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home4/awethuor/public_html/website_8910ed38/wp-content/plugins/joomsport-achievements/includes/meta-boxes/joomsport-achievments-meta-season.php:309 Stack trace: #0 /home4/awethuor/public_html/website_8910ed38/wp-content/plugins/joomsport-achievements/includes/meta-boxes/joomsport-achievments-meta-season.php(259): JoomSportAchievmentsMetaSeason::saveMetaPoints(1050) #1 /home4/awethuor/public_html/website_8910ed38/wp-includes/class-wp-hook.php(326): JoomSportAchievmentsMetaSeason::joomsport_season_save_metabox(1050, Object(WP_Post)) #2 /home4/awethuor/public_html/website_8910ed38/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /home4/awethuor/public_html/website_8910ed38/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /home4/awethuor/public_html/website_8910ed38/wp-includes/post.php(4891): do_action('save_post', 1050, Object(WP_Post), true) #5 /home4/awethuor/public_html/website_8910ed38/wp-includes/post.php(4993): wp_insert_post(Array, false, true) #6 /home4/awethuor/public_html/website_8910ed38/wp-admin/includes/post.php(453): wp_update_post(Array) #7 /home4/awethuor/public_html/website_8910ed38/wp-admin/post.php(227): edit_post() #8 {main} thrown in /home4/awethuor/public_html/website_8910ed38/wp-content/plugins/joomsport-achievements/includes/meta-boxes/joomsport-achievments-meta-season.php on line 309

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author beardev

    (@beardev)

    Hi

    This is likely due to your version of PHP. Achievements product is not adjusted to 8.2. this is all i can say so far.

    Which version do you use please?

    Can you try to try lower version please?

    • This reply was modified 3 weeks, 2 days ago by beardev.
    Plugin Author beardev

    (@beardev)

    Once we know your PHP version please we might offer you the solution. Thank you!

    Thread Starter erbrown777

    (@erbrown)

    Hi @beardev, thank you for our response. PHP 8.3

    Plugin Author beardev

    (@beardev)

    ok. yes. PHP version is definitely the reason.

    Can you please try this solution:

    find

    wp-content/plugins/joomsport-achievements/includes/meta-boxes/joomsport-achievments-meta-season.php

    find

    for ($intA = 0; $intA < count($places); $intA++) { if (isset($places[$intA]) && isset($points[$intA])) { if (intval($places[$intA]) && floatval($points[$intA])) { $meta_data['pts_by_place'][$places[$intA]] = $points[$intA]; } } }

    change it to

    if($places && is_array($places)) { for ($intA = 0; $intA < count($places); $intA++) { if (isset($places[$intA]) && isset($points[$intA])) { if (intval($places[$intA]) && floatval($points[$intA])) { $meta_data['pts_by_place'][$places[$intA]] = $points[$intA]; } } } }

    we used this to fix on 8.2. This might help for 8.3 as well.

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