• Resolved minutemedia

    (@minutemedia)


    Hi, encountering some fatal errors related to array_merge() and array_key_exists() usage when trying to upgrade to php 8.1 / wp 6.1. These appear to have been fixed in the “pro” version of this plugin. Are there plans to release php8.1 compatibility for the free version as well? Thank you!

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

    (@shinephp)

    Hi,

    Can you please show error messages with file name and line number, where error takes place?

    Pro version includes the exact copy of a free version. So, if I missed something, fix is needed for both versions.

    Thread Starter minutemedia

    (@minutemedia)

    Thanks for the reply- I get the following error when visiting /wp-admin/users.php?page=users-user-role-editor.php

    PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, int given in /www/wp-content/plugin
    s/user-role-editor/includes/classes/view.php:81

    I (maybe wrongly) thought the free version (4.63.2) was slightly behind the pro version (4.63.4). My version info:

    $ php -v
    PHP 8.1.13 (cli) (built: Dec  6 2022 05:53:26) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.13, Copyright (c) Zend Technologies
        with Zend OPcache v8.1.13, Copyright (c), by Zend Technologies
        with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethanst
    
    $ wp core version
    6.1.1
    
    $ wp plugin status user-role-editor
    Plugin user-role-editor details:
        Name: User Role Editor
        Status: Network Active
        Version: 4.63.2
        Author: Vladimir Garagulya
        Description: Change/add/delete WordPress user roles and capabilities.
    Plugin Author Vladimir Garagulya

    (@shinephp)

    Thank you. I added additional type checking to the code. It will be available with the next update.

    Btw., line #81 calls in_array() this way:

    in_array('deprecated', $builtin_wp_caps[$cap_id] )

    where $builtin_wp_caps is URE’s internal data structure, and the only case when $builtin_wp_caps[$cap_id] can be an integer instead of array of capabilities groups ID is an invalid use of ‘ure_built_in_wp_caps’ filter. Do you or one of your plugins use ‘ure_built_in_wp_caps’ filter?

    Thread Starter minutemedia

    (@minutemedia)

    Thanks a lot! You are 100% correct, we were using the filter wrong. Appreciate your help, and your great work on this plugin!

    • This reply was modified 2 years, 4 months ago by minutemedia.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal Errors w/ PHP 8.1’ is closed to new replies.