• Resolved nineplanetsllc

    (@nineplanetsllc)


    On a site we recently upgraded to the latest version of Litespeed Cache, we started getting this when trying to access the admin (we’ve since rolled back to 4.6 to get things working again):

    Error Details
    =============
    An error of type E_ERROR was caused in line 583 of the file /home/example/domains/example.com/public_html/wp-content/plugins/litespeed-cache/src/root.cls.php. Error message: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /home/example/domains/example.com/public_html/wp-content/plugins/litespeed-cache/src/root.cls.php:583
    Stack trace:
    #0 /home/example/domains/example.com/public_html/wp-content/plugins/litespeed-cache/src/root.cls.php(583): array_merge()
    #1 /home/example/domains/example.com/public_html/wp-content/plugins/litespeed-cache/tpl/banner/new_version.php(24): LiteSpeed\Root::save_summary()
    #2 /home/example/domains/example.com/public_html/wp-content/plugins/litespeed-cache/src/gui.cls.php(354): include('/home/example/...')
    #3 /home/example/domains/example.com/public_html/wp-content/plugins/litespeed-cache/src/admin-display.cls.php(185): LiteSpeed\GUI->show_promo()
    #4 /home/example/domains/example.com/public_html/wp-includes/class-wp-hook.php(307): LiteSpeed\Admin_Display->enqueue_scripts()
    #5 /home/example/domains/example.com/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #6 /home/example/domains/example.com/public_html/wp-includes/plugin.php(476): WP_Hook->do_action()
    #7 /home/example/domains/example.com/public_html/wp-admin/admin-header.php(118): do_action()
    #8 /home/example/domains/example.com/public_html/wp-admin/index.php(137): require_once('/home/example/...')
    #9 {main}
      thrown
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    May I know what is the PHP version and WordPress version ?

    Best regards,

    Thread Starter nineplanetsllc

    (@nineplanetsllc)

    WordPress 6.0.1 and PHP 8.0.

    Plugin Support Hai Zheng?

    (@hailite)

    Please try v5.0.0.1

    This issue also happened here. Completely blocked the dashboard, luckily the frontend kept working.

    Not sure what triggered the issue, nor what effects it could cause, but I’m not entirely sure that the 5.0.0.1 fix will prevent this to happen again.

    The error happens on line 583 of file litespeed-cache/src/root.cls.php , because there is no check to confirm that the variable $existing_summary is in fact an array, if it’s not it will return a Fatal error blocking the entire dashboard.

    As such, I advise to verify on line 580 if that variable is an array. I’ve created a pull request on git for that:

    https://github.com/litespeedtech/lscache_wp/pull/474

    auto update plugin and it kill our admin page…
    WordPress version 6.0.1
    Current plugin: LiteSpeed Cache (version 5.0)
    PHP version 8.1.6

    Error Details
    =============
    An error of type E_ERROR was caused in line 583 of the file /var/www/html/wp-content/plugins/litespeed-cache/src/root.cls.php. Error message: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /var/www/html/wp-content/plugins/litespeed-cache/src/root.cls.php:583
    Stack trace:
    #0 /var/www/html/wp-content/plugins/litespeed-cache/src/root.cls.php(583): array_merge()
    #1 /var/www/html/wp-content/plugins/litespeed-cache/tpl/banner/new_version.php(24): LiteSpeed\Root::save_summary()
    #2 /var/www/html/wp-content/plugins/litespeed-cache/src/gui.cls.php(354): include('...')
    #3 /var/www/html/wp-content/plugins/litespeed-cache/src/admin-display.cls.php(185): LiteSpeed\GUI->show_promo()
    #4 /var/www/html/wp-includes/class-wp-hook.php(307): LiteSpeed\Admin_Display->enqueue_scripts()
    #5 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #6 /var/www/html/wp-includes/plugin.php(476): WP_Hook->do_action()
    #7 /var/www/html/wp-admin/admin-header.php(118): do_action()
    #8 /var/www/html/wp-admin/index.php(137): require_once('...')
    #9 {main}
    thrown
    • This reply was modified 2 years, 4 months ago by cyberloner.
    Plugin Support Hai Zheng?

    (@hailite)

    @cantuaria Thanks for your PR.

    v5.0.1 to fix this issue will be released soon.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Uncaught TypeError: array_merge()’ is closed to new replies.