Make WordPress Core

Opened 6 months ago

Last modified 7 weeks ago

#58479 assigned defect (bug)

Add notice if no posts are selected in Bulk Edit

Reported by: sumitsingh's profile sumitsingh Owned by: quadthemes's profile quadthemes
Milestone: 6.5 Priority: normal
Severity: normal Version: 6.2.2
Component: Quick/Bulk Edit Keywords: has-screenshots has-patch needs-testing
Focuses: accessibility, javascript, administration Cc:

Description (last modified by sabernhardt)

On the Posts screen(s), clicking the bulk actions Apply button without selecting any posts does not show an error message.

  1. Visit the Posts screen.
  2. Choose "Edit" in the Bulk actions dropdown.
  3. Without checking any checkboxes, click the Apply button. Nothing seems to happen.
  4. Choose "Move to Trash" in the Bulk actions dropdown.
  5. Click the Apply button. The page reloads but cannot move anything to Trash.
  6. Choose "Bulk actions" at the top of the Bulk actions dropdown.
  7. Click the Apply button. The page reloads with a query string in the URL.

I have checked and it should be a message on the page/post list as per added notice message on the plugin page.

For more information, you can see mentioned quick video.

Thank you

Attachments (4)

Posts ‹ wptest — WordPress.mp4 (941.1 KB) - added by sumitsingh 6 months ago.
here quick video for more clear about suggetion
Posts-‹-wptest-—-WordPress.png (57.2 KB) - added by sumitsingh 6 months ago.
My suggetion
Plugins-‹-wptest-—-WordPress.png (237.6 KB) - added by sumitsingh 6 months ago.
existing example
58479-1.diff (1.9 KB) - added by nihar007 6 months ago.
I added only "no post selected" alert

Download all attachments as: .zip

Change History (28)

@sumitsingh
6 months ago

here quick video for more clear about suggetion

@sumitsingh
6 months ago

existing example

@nihar007
6 months ago

I added only "no post selected" alert

#1 @sabernhardt
6 months ago

  • Component changed from Posts, Post Types to Quick/Bulk Edit
  • Description modified (diff)
  • Focuses javascript added; coding-standards removed
  • Keywords has-patch added
  • Summary changed from We need to add notice on page/post similar to plugin list page to Add notice if no posts are selected in Bulk Edit

#2 @sabernhardt
6 months ago

Categories and Tags pages may need something similar, too (separate ticket?). Those pages reload without an error/notice if no items are selected.

#3 @sumitsingh
6 months ago

I think we can manage in this ticket @sabernhardt. Let me know if I need to create separate for other screen like this validation overall backed side.

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


5 months ago

#5 @joedolson
5 months ago

  • Milestone changed from Awaiting Review to 6.4
  • Owner set to joedolson
  • Status changed from new to accepted

#6 @oglekler
3 months ago

@sumitsingh and @joedolson, I wonder if the better approach is to disable button until something will be selected, otherwise page reload is pointless. And message needs to be appear close to button if person is trying to click it that nothing will be changed.

#7 follow-up: @joedolson
3 months ago

See also #45006 and #31634, as well. Disabling the button was tried for 31634, but was not as great a solution as it seemed. There were a lot of accessibility problems.

This patch looks like it could use some refinement, as well.

1) This should probably be an inline admin notice. Then we don't need to disruptively change the viewport position for the user.
2) It should also use wp.a11y.speak so that there's a verbal announcements.

#8 @joedolson
3 months ago

  • Keywords changes-requested added

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


3 months ago

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


2 months ago

#11 @joedolson
2 months ago

  • Owner changed from joedolson to quadthemes
  • Status changed from accepted to assigned

#12 in reply to: ↑ 7 @quadthemes
2 months ago

Adding inline admin notice to bulk action section would result in error being shown at both places(before and after the list). Though it's much better than scroll to top that is currently happening on plugins page. Any opinions? @joedolson

Replying to joedolson:

See also #45006 and #31634, as well. Disabling the button was tried for 31634, but was not as great a solution as it seemed. There were a lot of accessibility problems.

This patch looks like it could use some refinement, as well.

1) This should probably be an inline admin notice. Then we don't need to disruptively change the viewport position for the user.
2) It should also use wp.a11y.speak so that there's a verbal announcements.

Last edited 2 months ago by quadthemes (previous) (diff)

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


2 months ago

#14 @marybaum
2 months ago

Can yall get this patch refined in a week? We will look at this again next Tuesday.

#16 @oglekler
2 months ago

  • Keywords needs-testing added; changes-requested removed

Thank you, @quadthemes for the patch. Let's test it.

This ticket was mentioned in Slack in #core-test by oglekler. View the logs.


2 months ago

#18 @huzaifaalmesbah
2 months ago

I've been trying to test and haven't noticed any changes.

#19 @Ankit K Gupta
2 months ago

  • Keywords 2nd-opinion added

Tested the patch https://github.com/WordPress/wordpress-develop/pull/5423 and it works as explained here:

Adding inline admin notice to bulk action section would result in error being shown at both places(before and after the list). Though it's much better than scroll to top that is currently happening on the plugins page.

Plugins Page After the patch:

https://i.imgur.com/blPyiSV.jpg

Posts Page After the Patch:

https://i.imgur.com/WD8QCqJ.jpg

IMO, just showing the message at the top is fine instead of showing the same message in two places on same screen.

Let's wait for another opinion.

#20 @fnpen
2 months ago

@ankit-k-gupta, I also see it only on the top of the page (Plugins), and does not work on posts page.

Last edited 2 months ago by fnpen (previous) (diff)

This ticket was mentioned in PR #5433 on WordPress/wordpress-develop by @fnpen.


2 months ago
#21

#22 @fnpen
2 months ago

This part of the features has a partial implementation for Plugins, but it does not show when action is not selected.

Also, we can select actions for Users and Change Roles where it is a similar requirement to pick rows. The plugins page shows only one notification on top and scrolls the page up.

Implementation:

  • Covers cases of any list table with role selector and plugins page.
  • Shows one notification when no action or item is selected

'addAdminNotice' will be a good idea to make it global and universal.

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


8 weeks ago

#24 @oglekler
7 weeks ago

  • Keywords 2nd-opinion removed
  • Milestone changed from 6.4 to 6.5

We have RC1 tomorrow, so, I am moving this to the next milestone. Right now we can work further on the ticket, and it can land into the 6.5 as soon as it will be ready.

Note: See TracTickets for help on using tickets.