• Resolved ejw773

    (@ejw773)


    I’m getting this error when running PHP 8 (no problems when on PHP 7.4):

    [28-Jun-2022 13:08:01 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "REQUEST_URI" in /nas/content/live/bjuseminary/wp-content/plugins/widget-options/includes/widgets/display.php(400) : eval()'d code:1
    Stack trace:
    #0 /nas/content/live/bjuseminary/wp-content/plugins/widget-options/includes/widgets/display.php(400): eval()
    #1 /nas/content/live/bjuseminary/wp-content/plugins/widget-options/includes/widgets/extras.php(153): widgetopts_display_callback(Array, Object(stdClass), '')
    #2 /nas/content/live/bjuseminary/wp-includes/class-wp-hook.php(307): widgetopts_sidebars_widgets(Array)
    #3 /nas/content/live/bjuseminary/wp-includes/plugin.php(189): WP_Hook->apply_filters(Array, Array)
    #4 /nas/content/live/bjuseminary/wp-includes/widgets.php(1039): apply_filters('sidebars_widget...', Array)
    #5 /nas/content/live/bjuseminary/wp-includes/widgets.php(975): wp_get_sidebars_widgets()
    #6 /nas/content/live/bjuseminary/wp-content/themes/customwp/archive-viewpoint.php(70): is_active_sidebar('right_1')
    #7 /nas/content/live/bjuseminary/wp-includes/template-loader.php(106): include('/nas/content/li...')
    #8 /nas/content/live/bjuseminary/wp-blog-header.php(19): require_once('/nas/content/li...')
    #9 /nas/content/live/bjuseminary/index.php(17): require('/nas/content/li...')
    #10 {main}
      thrown in /nas/content/live/bjuseminary/wp-content/plugins/widget-options/includes/widgets/display.php(400) : eval()'d code on line 1
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mej de Castro

    (@mej)

    Hi @ejw773

    Thanks for letting us know about this. We will check and fix. Stay tuned!

    Kind Regards,
    Mej

    Thread Starter ejw773

    (@ejw773)

    I have an update: Searching through the codebase for references to $_SERVER[REQUEST_URI], I discovered that it does not actually appear in any of the PHP files for the plugin; I did, however, discover that it appears 13 times in the database!

    In the “options” table, under a few different “option_name”s like “widget_custom-post-type-categories”, it appears several times.

    I’m thinking I should install something like Better Search Replace, and change all of these to $_SERVER['REQUEST_URI']?

    Plugin Author Mej de Castro

    (@mej)

    Hi @ejw773

    Yes, updating from $_SERVER[REQUEST_URI] to $_SERVER[‘REQUEST_URI’] will fix the problem.

    We agreed using Better Search Replace. ??

    Thanks,
    Mej

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal Error on Upgrade to PHP 8’ is closed to new replies.