• Resolved Sara Patricia

    (@sarapatricia)


    After upgrading to PHP 8.1 I can no longer access the WPtouch settings page ./wp-admin/admin.php?page=wptouch-admin-general-settings and this E_ERROR is thrown:

    Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /wordpress/wp-content/plugins/wptouch/core/class-array-iterator.php:12
    Stack trace:
    #0 /wordpress/wp-content/plugins/wptouch/core/admin-custom-icons.php(18): WPtouchArrayIterator->__construct(NULL)
    #1 /wordpress/wp-content/plugins/wptouch/admin/settings/html/custom_icon_management.php(2): wptouch_have_custom_icons()
    #2 /wordpress/wp-content/plugins/wptouch/core/admin-load.php(224): include('/homepages/34/d...')
    #3 /wordpress/wp-content/plugins/wptouch/core/admin-load.php(180): wptouch_admin_render_special_setting(Object(stdClass))
    #4 /wordpress/wp-content/plugins/wptouch/core/admin-render.php(171): wptouch_admin_render_setting(Object(stdClass))
    #5 /wordpress/wp-content/plugins/wptouch/core/admin-load.php(173): include('/homepages/34/d...')
    #6 /wordpress/wp-includes/class-wp-hook.php(307): wptouch_admin_render_menu('')
    #7 /wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #8 /wordpress/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #9 /wordpress/wp-admin/admin.php(259): do_action('toplevel_page_w...')
    #10 {main}
      thrown

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • I also met this problem and i modified the file wptouch/core/class-array-iterator.php line 12 to $this->count = is_countable($a) ? count( $a ) : 0;, then work well. You can have a try.

    PS: Don’t upgrade wordpress to 6.0, there are also something incompatible.

    Thread Starter Sara Patricia

    (@sarapatricia)

    Thanks – that did the trick.

    Not sure what you mean with

    Don’t upgrade wordpress to 6.0, there are also something incompatible.

    It seems to work ok for me with WordPress 6.0.2. In case you refer to https://ww.wp.xz.cn/support/topic/http_user_agent-error/ that’s just a warning.

    Thread Starter Sara Patricia

    (@sarapatricia)

    I just upgraded WPtouch to version 4.3.42 hoping that this issue got finally fixed, but unfortunately it wasn’t and I had to apply @boboyu’s fix manually once more.

    I really wonder why this issue was set to “resolved”.

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

The topic ‘WPtouch incompatible with PHP 8.1’ is closed to new replies.