Make WordPress Core

Changes between Initial Version and Version 5 of Ticket #57469


Ignore:
Timestamp:
08/08/2023 02:32:08 PM (14 months ago)
Author:
hellofromTonya
Comment:

Changes in the ticket:

  • Updated the Summary to better reflect the issue being reported, i.e. for discoverability.
  • Updated the Version to 4.9.
  • Wrapped the PHP error in the Description.
  • Reset the keywords as the PR was closed.
  • Changed keyword to php80 to identify which PHP version increased the error's severity.

Error across PHP versions: If null or a non-array is set for the widgets of a sidebar, then PHP throws an error (see it in action https://3v4l.org/i45nZ):

  • < 7.3: Warning: array_merge(): Argument #3 is not an array
  • PHP 7.3 to 7.4: Warning: array_merge(): Expected parameter 3 to be an array, null given
  • PHP 8+: Fatal error: Uncaught TypeError: array_merge(): Argument #3 must be of type array, null given.

Historical context:

  • [41555] / #39693 (during WP 4.9):
    • Introduced wp_map_sidebars_widgets().
    • retrieve_widgets():
      • Invoked wp_map_sidebars_widgets() to map $sidebars_widgets
      • Added $shown_widgets = call_user_func_array( 'array_merge', $sidebars_widgets );.
  • [48839] / #50913 (during WP 5.6):
    • retrieve_widgets(): changed call_user_func_array( 'array_merge', $sidebars_widgets ); to array_merge( ...array_values( $sidebars_widgets ) );.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57469

    • Property Keywords php80 close added
    • Property Version changed from 6.1.1 to 4.9
    • Property Summary changed from Uncaught Error: array_merge(): Argument #3 must be of type array, null given in wp-includes/widgets.php on line 1342 to retrieve_widgets(): fatal error when a sidebar's widgets set to null (array is expected)
    • Property Milestone changed from Awaiting Review to
  • Ticket #57469 – Description

    initial v5  
    11When changing from PHP 7.4 to PHP 8.0 it's not possible to activate our theme.
    22
    3 
     3{{{
    44Fatal error: Uncaught Error: array_merge(): Argument #3 must be of type array, null given in wp-includes/widgets.php on line 1342
     5}}}
    56
    67