Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#24869 closed defect (bug) (fixed)

"All" in post list table is incorrectly selected in some filtered views

Reported by: enej Owned by: wonderboymusic
Priority: normal Milestone: 4.2
Component: Posts, Post Types Version: 3.5.2
Severity: minor Keywords: has-patch needs-testing
Cc: Focuses: ui, administration

Description

When you are viewing the posts table and you have selected an author the all filter is incorrectly selected.

Attachments (5)

Posts_‹_CMS_Dev_—_WordPress.png (153.6 KB ) - added by enej 13 years ago.
screenshot
24869.diff (1.1 KB ) - added by enej 13 years ago.
patch that removed the selection of all.
24869.2.diff (1.1 KB ) - added by rmarks 13 years ago.
This patch includes 24869.diff​ by enej plus adds the cases when a category or tag is specified
24869.alt.diff (1.0 KB ) - added by rmarks 13 years ago.
24869.3.diff (1.7 KB ) - added by wonderboymusic 12 years ago.

Download all attachments as: .zip

Change History (25)

@enej
13 years ago

screenshot

@enej
13 years ago

patch that removed the selection of all.

#1 follow-up: @enej
13 years ago

  • Keywords has-patch added; needs-patch removed

This patch should fix it.

@rmarks
13 years ago

This patch includes 24869.diff​ by enej plus adds the cases when a category or tag is specified

#2 in reply to: ↑ 1 @rmarks
13 years ago

  • Cc rmarks@… added
  • Summary "All" in post list is incorectly selected when an author is selected."All" in post list is incorectly selected when an author, category, or tag is selected.

Replying to enej:

This patch should fix it.

I added to your patch by including the exceptions when a category or tag was specified.

#3 @helen
13 years ago

  • Summary "All" in post list is incorectly selected when an author, category, or tag is selected."All" in post list table is incorerctly selected in some filtered views

Is there something we can do besides continuing to add to the conditional? For example, as what is probably a TERRIBLE idea, comparing the post count of all vs. the current view.

#4 @helen
13 years ago

  • Summary "All" in post list table is incorerctly selected in some filtered views"All" in post list table is incorrectly selected in some filtered views

#5 @helen
13 years ago

  • Keywords ui-focus added

#6 @sworddance
13 years ago

@helen - "Is there something we can do besides continuing to add to the conditional?"

An alternative would be to see if the only $_REQUEST parameter is post_type. so something like:

count($_REQUEST) == 0 || count($_REQUEST) == 1 && isset($_REQUEST['post_type'])

Last edited 13 years ago by sworddance (previous) (diff)

#7 @sworddance
13 years ago

  • Cc sworddance added

@rmarks
13 years ago

#8 @rmarks
13 years ago

I have just uploaded an alternate diff that accomplishes @enej's intentions while using @sworddance's suggestions.

#9 @pauldewouters
13 years ago

I tested the patch and can confirm it fixes the issue

#10 @pauldewouters
13 years ago

  • Cc pauldewouters@… added

#11 @jeremyfelt
13 years ago

  • Component AdministrationPosts, Post Types
  • Focuses admin added

#12 @wonderboymusic
12 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone Awaiting Review4.2
  • Owner set to wonderboymusic
  • Status newassigned

I have been in list tables pretty deep recently, I would like to fix this

#13 @wonderboymusic
12 years ago

  • Keywords has-patch added; needs-patch removed

24869.3.diff fixes this, sorry it sat for so long, enej!

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


11 years ago

#15 @DrewAPicture
11 years ago

  • Keywords needs-docs added

Latest patch still applies, appears to fix the problem. The new method, is_base_request(), should have a DocBlock. Otherwise looks ready for commit consideration.

Last edited 11 years ago by DrewAPicture (previous) (diff)

#16 follow-up: @wonderboymusic
11 years ago

  • Resolutionfixed
  • Status assignedclosed

In 31828:

Add WP_Posts_List_Table::is_base_request() to determine if the current "view" is the "All" (default) view.

Fixes #24869.

#17 in reply to: ↑ 16 @nacin
11 years ago

Replying to wonderboymusic:

In 31828:

Add WP_Posts_List_Table::is_base_request() to determine if the current "view" is the "All" (default) view.

Fixes #24869.

@wonderboymusic, I don't think this is a problem in terms of how this is implemented (perhaps just how it is documented), but note that for Contributors and Authors (I think), the first section is actually "Mine", not "All".

#18 @DrewAPicture
11 years ago

  • Keywords needs-testing added; needs-docs removed
  • Resolution fixed
  • Status closedreopened

See comment:17. Also, not sure this is working correctly even for roles that lack the "Mine" section. When the "All" section is selected, none of them have the current class. I think we need another look here.

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


11 years ago

#20 @wonderboymusic
11 years ago

  • Resolutionfixed
  • Status reopenedclosed

In 31959:

In WP_Posts_List_Table::get_views(), don't add the current class to the all status link if ->user_posts_count has a value, which triggers the additional mine status.

See [31828].
Fixes #24869.

Note: See TracTickets for help on using tickets.