Make WordPress Core

Opened 3 years ago

Last modified 3 weeks ago

#56599 new defect (bug)

"All" view not selected for all relevant views for custom post type

Reported by: alpipego's profile alpipego Owned by:
Milestone: Awaiting Review Priority: normal
Severity: trivial Version: 4.2
Component: Posts, Post Types Keywords: has-patch has-test-info
Focuses: administration Cc:

Description

When the screen options get saved, the parameter mode=list gets appended to the URL. For the posts table, the “All” view gets the .current HTML class, since \WP_Posts_List_Table::is_base_request() returns true. For all other post types—including pages—it returns false.

Change History (9)

This ticket was mentioned in PR #3275 on WordPress/wordpress-develop by alpipego.


3 years ago
#1

  • Keywords has-patch added

Analogous to the paged parameter, unset mode whet checking whether
this is the base request for the \WP_Posts_List_Table.

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

#2 @alpipego
3 years ago

We noticed the same happens for order and orderby—even for the posts table. I have updated the patch to consider order and orderby as well.

#3 @costdev
3 years ago

  • Component changed from General to Posts, Post Types
  • Focuses administration added
  • Keywords has-testing-info added
  • Version set to 4.2

Test Report

This report validates that the issue can be reproduced and that the patch resolves the issue.

Patch tested: PR 3275

Steps to Reproduce or Test

  1. Navigate to Posts.
  2. Open the Screen Options tab and make a change.
  3. 🐞 Click Apply.
  4. Apply the patch.
  5. Refresh the page.
  6. Additional: Test Pages and a custom post type.

Expected Results

When reproducing the issue:

  • ❌ The All view is not bold.

When testing the patch:

  • ✅ The All view is bold.
  • ✅ No regressions detected.

Environment

  • OS: Windows 10
  • Web Server: Apache (WSL2 - Ubuntu)
  • PHP: 7.4
  • WordPress: 6.1-alpha-54198
  • Browser: Chrome 105.0.5195.125
  • Theme: Twenty Twenty-Two
  • Active Plugins: None activated.

Actual Results

When reproducing the issue:

  • ✅ The All view is not bold. Issue reproduced.

When testing the patch:

  • ✅ The All view is bold.
  • ✅ No regressions detected.
  • The patch seems to resolve the issue without introducing a regression.

Additional Notes

  • This began happening from WordPress 4.2 onwards.
  • This may benefit from additional testing for plugins that extend the WP_Posts_List_Table class. Adding needs-testing until this is done.
Last edited 3 years ago by costdev (previous) (diff)

#4 @costdev
3 years ago

  • Keywords needs-testing added

Per notes in the test report above:

This may benefit from additional testing for plugins that extend the WP_Posts_List_Table class. Adding needs-testing until this is done.

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


14 months ago
#5

Analogous to the paged parameter, unset mode whet checking whether this is the base request for the \WP_Posts_List_Table.

https://core.trac.wordpress.org/ticket/56599

Trac ticket:

#6 @alpipego
14 months ago

After accidentally closing the old PR, I have created a new one and rebased it on the current trunk.

https://github.com/WordPress/wordpress-develop/pull/8056

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


14 months ago

#8 @wordpressdotorg
9 months ago

  • Keywords has-test-info added; has-testing-info removed

#9 @huzaifaalmesbah
3 weeks ago

  • Keywords needs-testing removed

Patch Testing Report

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/8056

Environment

  • WordPress: 7.0-alpha-61215-src
  • PHP: 8.2.30
  • Server: nginx/1.29.4
  • Database: mysqli (Server: 9.5.0 / Client: mysqlnd 8.2.30)
  • Browser: Chrome 143.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Custom Post Type 1.0
    • Test Reports 1.2.1

Steps taken

  1. Navigate to Posts → All Posts.
  2. Open the Screen Options panel.
  3. Change any option (e.g. number of items per page).
  4. Click Apply.
  5. Observe the “All” view state before applying the patch.
  6. Apply the patch from PR.
  7. Refresh the page.
  8. Repeat the same steps for:
    • Pages
    • Custom Post Type (Test)
  1. ✅ Patch is solving the problem

Expected result

  • Before applying the patch:
    • ❌ The “All” view is not highlighted (not bold) for Pages and Custom Post Types.
  • After applying the patch:
    • ✅ The “All” view is correctly highlighted (bold) for Posts, Pages, and Custom Post Types.
    • ✅ No regressions observed.

Screenshots/Screencast with results

Last edited 3 weeks ago by huzaifaalmesbah (previous) (diff)
Note: See TracTickets for help on using tickets.