Make WordPress Core

#64125 closed defect (bug) (fixed)

Command Palate: Don't include palate on Network Admin

Reported by: jorbin Owned by: wildworks
Priority: normal Milestone: 6.9
Component: Editor Version: 6.9
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

Follow up to #63845 and [61022]

The commands are all single site focused and selecting many of them leads to a 404. For 6.9, I think we should remove it from the network admin and then in the future we can explore network admin specific commands.

Change History (14)

#1 @wildworks
13 months ago

Thanks for reporting. Does this ticket mean that in multisite, the command palette should be removed from all screens, or is it just meant to be disabled on the dashboard?

#2 @jorbin
13 months ago

Just the network admin: /wp-admin/network/

I think an is_network_admin check and early return inside wp_enqueue_command_palette_assets would work.

This ticket was mentioned in ​PR #10377 on ​WordPress/wordpress-develop by ​@wildworks.


13 months ago
#3

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/64125

In the network admin screen, commands primarily intended for site editors don't work, such as Go to : Styles and Go to: Templates.

These commands are registered in JS, namely Gutenberg. Ideally, we'd need to detect network admin status client-side and disable comments. As a temporary fix, disable the command palette itself in the network admin area to avoid 404 errors.

### Testing Instructions

  • Define LOCAL_MULTISITE=true in the .env file
  • Run: npm run env:start, npm run env:install, and npm run dev
  • Access to http://localhost:8889/wp-admin/network/
  • Try to launch the Comand Palette and confirm that nothing happens

#4 @wildworks
13 months ago

Gutenberg issue for aiming for the ideal solution: ​https://github.com/WordPress/gutenberg/issues/72527

​@wildworks commented on ​PR #10377:


13 months ago
#5

This issue may be better resolved on the client side rather than the server side, so I'm closing this PR for now. See: ​https://github.com/WordPress/gutenberg/pull/72572

This ticket was mentioned in ​Slack in #core by amykamala. ​View the logs.


13 months ago

#7 @wildworks
13 months ago

  • Resolution → fixed
  • Status new → closed

This issue has been fixed on the client side: ​https://github.com/WordPress/gutenberg/pull/72572

This problem should be resolved in the Beta 2 release.

This ticket was mentioned in ​PR #10422 on ​WordPress/wordpress-develop by ​@wildworks.


13 months ago
#8

#9 @wildworks
13 months ago

  • Resolution fixed
  • Status closed → reopened

This issue has been fixed on the client side: ​https://github.com/WordPress/gutenberg/pull/72572
This problem should be resolved in the Beta 2 release.

The client-side approach was not ideal. I decided to check whether the current screen is Network Admin on the server side and conditionally enable commands based on that result.

Last edited 13 months ago by wildworks (previous) (diff)

This ticket was mentioned in ​Slack in #core-committers by wildworks. ​View the logs.


13 months ago

#11 @wildworks
13 months ago

  • Keywords commit added
  • Owner set to wildworks
  • Status reopened → assigned

#12 @wildworks
13 months ago

I'd like to commit ​PR 10422 before Beta3, but could you review the commit message?

Command Palette: Add network admin check

To prevent the registration of commands that would cause a 404 error in the network administration screen, pass the result of the `is_network_admin` check to the command palette initialization function.

Follow-up to [27195], [41062].

Props jorbin, ntsekouras, soean, tobiasbg
Fixes #64125.

I included soean and tobiasbg in the props because they pointed out the problem here: ​https://github.com/WordPress/gutenberg/pull/72572#issuecomment-3442252889

#13 @wildworks
13 months ago

I will commit this patch by 6.9 Beta3.

#14 @wildworks
13 months ago

  • Resolution → fixed
  • Status assigned → closed

In 61121:

Command Palette: Add network admin check

To prevent the registration of commands that would cause a 404 error in the network admin screen, pass the result of the is_network_admin() check to the command palette initialization function.

Follow-up to [61022].

Props jorbin, ntsekouras, soean, tobiasbg
Fixes #64125.

Note: See TracTickets for help on using tickets.