• Resolved joneiseman

    (@joneiseman)


    The plugin throws the following type of error in many places when using php 7.1 or greater (the currently recommended version of php for WordPress is 7.3).

    PHP Fatal error: Uncaught Error: [] operator not supported for strings in wp-content/plugins/simple-file-list/includes/ee-functions.php:261

    This problem exists in many places (wherever a string is added to $eeSFL_Log[…]).

    This error occurs when trying to upload a file on the front end.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mitchell Bennis

    (@eemitch)

    Please confirm you are running the latest version, 4.2.3 If running extensions, they should both be 2.1.1

    If you’ve just updated, clear any cache to ensure the proper javascript loads.

    The PHP version should not be an issue.

    Thread Starter joneiseman

    (@joneiseman)

    I’m running the latest version and I’m not using any extensions and I ran it in an incognito window in Chrome so there’s no caching in my browser and I’m not using any caching plugins. I still see the same error.

    In the code you will see lines like this:

    
     $eeSFL_Log['messages'][] = __('File Upload Complete', 'ee-simple-file-list');
    

    Adding to something that was not an array before would automatically create the array in older versions of php but starting in php 7.1 this became a fatal error.

    If I add the following lines before the above line then it resolves the problem:

    
       if (empty($eeSFL_Log))
           $eeSFL_Log = array();
       if (!array_key_exists('messages', $eeSFL_Log) || !is_array($eeSFL_Log['Add Files']))
           $eeSFL_Log['messages] = array();
    
    Thread Starter joneiseman

    (@joneiseman)

    Resolved?

    Plugin Author Mitchell Bennis

    (@eemitch)

    Yes, I am not seeing any issues using PHP 7.1, 7.2 or 7.3. The plugin should work back to 5.6

    I am glad you got it to work on your system.

    Thread Starter joneiseman

    (@joneiseman)

    You’re right the plugin does work with those PHP versions. The problem only shows up if multiple eeSFL shortcodes are used on the same page.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘not compatible with php >= 7.1’ is closed to new replies.