Make WordPress Core

Opened 10 months ago

Last modified 10 months ago

#59410 new defect (bug)

Getting waring related Warning: array_flip() expects parameter 1 to be array

Reported by: sumitsingh's profile sumitsingh Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3.1
Component: Administration Keywords: has-screenshots close 2nd-opinion reporter-feedback
Focuses: administration Cc:

Description

Hey Core Team,

when I am using the switch user plugin and after switching user gets a warning on the top bar more information you can see the mentioned screenshot.

For more information see mentioned screenshot.

Attachments (3)

Dashboard-‹-admin-—-WordPress.png (95.8 KB) - added by sumitsingh 10 months ago.
Warning: array_flip() expects parameter 1 to be array, null given in wp-admin/includes/menu.php on line 307
59410.diff (478 bytes) - added by sumitsingh 10 months ago.
I have checked condition before array_flip
Screenshot-2023-10-04-10.47.34.png (41.8 KB) - added by sumitsingh 10 months ago.
here issue related same array flip argument issue, So we can add condtion on wp code code as per my throught

Download all attachments as: .zip

Change History (6)

@sumitsingh
10 months ago

Warning: array_flip() expects parameter 1 to be array, null given in wp-admin/includes/menu.php on line 307

@sumitsingh
10 months ago

I have checked condition before array_flip

#1 @costdev
10 months ago

  • Component changed from General to Administration
  • Focuses coding-standards php-compatibility removed
  • Keywords close 2nd-opinion added

Thanks for creating this ticket @sumitsingh!

If a plugin is filtering the menu order and returning an invalid value, I think it's okay that PHP shows a warning. The plugin author should see this warning and act to resolve the issue.

Adding close and 2nd-opinion.

#2 @johnbillion
10 months ago

  • Keywords reporter-feedback added

What role does the user have?

Does this happen if you manually log into the affected user account (using the username and password) instead of switching?

Can you try deactivating your plugins one by one to see if one of them is causing this error?

#3 @sumitsingh
10 months ago

@johnbillion, I am switching admin to the subscriber user role.

@sumitsingh
10 months ago

here issue related same array flip argument issue, So we can add condtion on wp code code as per my throught

Note: See TracTickets for help on using tickets.