Make WordPress Core

Opened 10 days ago

Last modified 8 days ago

#48205 new defect (bug)

Warning: Cannot use a scalar value as an array

Reported by: radevwp Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.2.3
Component: Script Loader Keywords: reporter-feedback
Focuses: Cc:
PR Number:


Warning: Cannot use a scalar value as an array in /nas/content/staging/nuestravision/wp-includes/class.wp-scripts.php on line 454

I have already deactivated the theme and plugins and reactivated one by one with no successful results.

Change History (7)

#1 @pbiron
10 days ago

Hi @radevwp, welcome to Trac! Thanx for the ticket.

Can you please provide a little more information? For starters, what are you doing when you get this error? Are you in the back-end or the front-end? If on the back-end, what screen are you on?

#2 @desrosj
10 days ago

  • Keywords reporter-feedback added

#3 @radevwp
10 days ago

hello and thank you for responding. I am using wpengine and we have a multisite. But the issue is only showing up on our staging website. The warning just shows up on top of the admin dashboard backend.

#4 @desrosj
10 days ago

Thanks for the additional details, @radevwp. However, it's still not enough information to try and reproduce to debug. Can you answer these questions?

  • What pages does it appear on in the admin? Every page? Specific ones?
  • Does it appear when the page loads? Or when you do something specific?
  • Which version of PHP are you using?
  • Is your production site using the exact same set of plugins as staging? Same WordPress version?
  • Have you disabled all of your plugins to see if this persists?

#5 @radevwp
9 days ago

  1. The warning message shows up on the admin dashboard page.
  1. Yes, it appears when the page is loading also.
  1. We are using PHP 7.3
  1. Yes, the production site is the same as the staging site. we push to staging at least once a week and this warning message has been around for at most 2 or 3.
  1. And yes I turned off all plugins and even themes and still, the warning showed up on the same page.
Last edited 9 days ago by radevwp (previous) (diff)

#6 @SergeyBiryukov
9 days ago

  • Component changed from General to Script Loader

#7 @jrf
8 days ago

@radevwp I've had a quick look at the code in question, but the only way this could happen is if the localize() function was called with $l10n set to a scalar value instead of an array.

To figure out where that function call is made from, a debug backtrace is needed.

Could you please provide that ?

If you don't know how to get a debug backtrace of the error, have a look here at some code you can inject into the wp-config.php file on your staging server to generate it: https://gist.github.com/jrfnl/5925642

As a side-note: yes, the function could be coded slightly more defensively, but finding out where this is coming from is the more important issue.

Note: See TracTickets for help on using tickets.