• Resolved dmaxx437

    (@dmaxx437)


    If upgrade to anything later than php 7.4, MediaList throws the following error:

    [03-Jul-2024 00:20:01 UTC] PHP Fatal error: Uncaught TypeError: array_change_key_case(): Argument #1 ($array) must be of type array, bool given in /home/cho/public_html/wp-content/plugins/media-list/medialist.php:68
    Stack trace:
    #0 /home/cho/public_html/wp-content/plugins/media-list/medialist.php(68): array_change_key_case(false)
    #1 /home/cho/public_html/wp-content/plugins/media-list/medialist.php(421): medialistpluginclass->medialistgeturlfilesize(Object(WP_Query))
    #2 /home/cho/public_html/wp-includes/shortcodes.php(393): medialistpluginclass->medialistmainplugin(Array, ”, ‘medialist’)
    #3 [internal function]: do_shortcode_tag(Array)
    #4 /home/cho/public_html/wp-includes/shortcodes.php(265): preg_replace_callback(‘/\\[(\\[?)(medial…’, ‘do_shortcode_ta…’, ‘\n<p>Chicago Reg…’)
    #5 /home/cho/public_html/wp-includes/class-wp-hook.php(308): do_shortcode(‘\n<p>Chicago Reg…’)
    #6 /home/cho/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘\n<p>Chicago Reg…’, Array)
    #7 /home/cho/public_html/wp-includes/post-template.php(255): apply_filters(‘the_content’, ‘<!– wp:paragra…’)
    #8 /home/cho/public_html/wp-content/themes/newsup-pro/single.php(80): the_content()
    #9 /home/cho/public_html/wp-includes/template-loader.php(106): include(‘/home/cho/publi…’)
    #10 /home/cho/public_html/wp-blog-header.php(19): require_once(‘/home/cho/publi…’)
    #11 /home/cho/public_html/index.php(17): require(‘/home/cho/publi…’)
    #12 {main}
    thrown in /home/cho/public_html/wp-content/plugins/media-list/medialist.php on line 68

    Any help would be appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author mauvedev

    (@mauvedev)

    I’m unsure unfortunately, I have checked the plugin to date in the latest WordPress and PHP 8.12 builds and it is working correctly. If you’re cacheing your site you can try clearing it and checking.

    You could also try loading your website into a staging environment or a local development platform like xampp.

    Thread Starter dmaxx437

    (@dmaxx437)

    We have our site in a staging environment. It fails their as well if we run with PHP > 7.4.

    Does your plugin require the PHP option: allow_url_fopen = 1?

    I’m getting the same critical error, using PHP 8.3

    Backend fatal error: PHP Fatal error: Uncaught TypeError: array_change_key_case(): Argument #1 ($array) must be of type array, bool given in /public_html/wp-content/plugins/media-list/medialist.php:68
    Stack trace: 0 /public_html/wp-content/plugins/media-list/medialist.php(68): array_change_key_case() 1 /public_html/wp-content/plugins/media-list/medialist.php(421): medialistpluginclass->medialistgeturlfilesize() 2 /public_html/wp-includes/shortcodes.php(434): medialistpluginclass->medialistmainplugin() 3 [internal function]: do_shortcode_tag()\n#4 /public_html/wp-includes/shortcodes.php(273): preg_replace_callback() 5 /public_html/wp-includes/class-wp-hook.php(324): do_shortcode() 6 /public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 7 /public_html/wp-includes/blocks/post-content.php(50): apply_filters() 8 /public_html/wp-includes/class-wp-block.php(519): render_block_core_post_content() 9 /public_html/wp-includes/class-wp-block.php(499): WP_Block->render() 10 /public_html/wp-includes/blocks.php(2061): WP_Block->render() 11 /public_html/wp-includes/blocks.php(2113): render_block() 12 /public_html/wp-includes/block-template.php(260): do_blocks() 13 /public_html/wp-includes/template-canvas.php(12): get_the_block_template_html() 14 /public_html/wp-includes/template-loader.php(106): include('/home/u169542p1…') 15 /public_html/wp-blog-header.php(19): require_once('/home/u169542p1…') 16 /public_html/index.php(17): require('/home/u169542p1…') 17 {main}\n thrown in /public_html/wp-content/plugins/media-list/medialist.php on line 68

    (I edited the path’s above to remove my site url.)

    When I disable the Medialist plugin, the page loads again.

    Any idea’s on how to fix this?

    Changing back to PHP 7.4 makes it work again.

    Could this be related to the change to get_headers?
    https://www.php.net/manual/en/function.get-headers.php
    8.0.0The?associative?has been changed from?int?to?bool.

    Plugin Author mauvedev

    (@mauvedev)

    I will have to take a look and see what php options are enabled in my staging environment, however the current version in my testing is 8.12 and plugin is loading and displaying media correctly without any errors. 8.3 is untested at this time.

    Plugin Author mauvedev

    (@mauvedev)

    I decided to test the current version of my plugin in a fresh enviroment with a default installation of WordPress 6.6.1 inside xampp running PHP 8.2.12 and I couldnt replicate the above, the plugin loaded as expected and displayed a variety of media content.

    Link to the environment used if you’d like to try and compare with your own, this would seem like a configuration issue somewhere.

    https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/8.2.12/

    Default loaded modules:

    core mod_win32 mpm_winnt http_core mod_so mod_access_compat mod_actions mod_alias mod_allowmethods mod_asis mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dav_lock mod_dir mod_env mod_headers mod_include mod_info mod_isapi mod_log_config mod_cache_disk mod_mime mod_negotiation mod_proxy mod_proxy_ajp mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl mod_status mod_php

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Unhandled exception in PHP later that 7.4’ is closed to new replies.