Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#43788 closed defect (bug) (worksforme)

Widgets.php Errors

Reported by: mtecuk's profile mtecuk Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.5
Component: Widgets Keywords: close
Focuses: Cc:


Getting some Array errors in widgets.php header output. Surely this is a duplicate, yet can't find anything in existing tickets. This doesn't appear to be a PHP version issue, as I have tested on 5.4 through to 7.2.

<br />
<b>Warning</b>:  array_merge(): Argument #5 is not an array in <b>../wp-includes/widgets.php</b> on line <b>1159</b><br />
<br />
<b>Warning</b>:  array_diff(): Argument #2 is not an array in <b>../wp-includes/widgets.php</b> on line <b>1160</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>../wp-includes/widgets.php</b> on line <b>1162</b><br />
<br />
<b>Warning</b>:  array_merge(): Argument #1 is not an array in <b>../wp-includes/widgets.php</b> on line <b>1170</b><br />

Attachments (1)

Screen Shot 2018-04-17 at 13.39.25.png (25.1 KB) - added by mtecuk 6 years ago.
Version Screnshot

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
6 years ago

  • Keywords reporter-feedback added

Hi @mtecuk, welcome to WordPress Trac! Thanks for the report.

These warnings were fixed in 4.9.2, see #42603. As far as I can see, it should no longer be possible for wp_map_sidebars_widgets() to return a non-array.

Could you confirm you're still seeing them in 4.9.5? Does it still happen with all plugins disabled and a default theme (Twenty Seventeen) activated? Does it happen if you switch to another theme and back to the current one?

6 years ago

Version Screnshot

#2 @mtecuk
6 years ago

Hi Sergy,

As you can see from the screenshot this is a 4.9.5 instance. I'll try switching to a default theme with plugs disabled.

#3 @mtecuk
6 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

OK I disabled all the plugins, switched theme to default and the error is no more. Switched back to theme and re-enabled plugs and it's not come back.

Must have been a caching issue of an old version of the file maybe as I had WP Super Cache enabled, must have forced a refresh of the cache when I disabled and re-enabled.

Thanks for the heads up.

#4 @mtecuk
6 years ago

  • Keywords close added; needs-patch reporter-feedback removed

#5 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review deleted

Thanks for the follow-up!

Note: See TracTickets for help on using tickets.