[wp-trac] [WordPress Trac] #64467: Grid view displays attachments in the wrong order when an order query var is present but not normalized

WordPress Trac noreply at wordpress.org
Tue Mar 10 15:59:54 UTC 2026


#64467: Grid view displays attachments in the wrong order when an order query var
is present but not normalized
-------------------------------------+-------------------------------------
 Reporter:  trivedikavit             |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  7.0
Component:  Media                    |     Version:
 Severity:  minor                    |  Resolution:
 Keywords:  has-screenshots          |     Focuses:  javascript,
  changes-requested has-patch has-   |  administration
  unit-tests                         |
-------------------------------------+-------------------------------------

Comment (by ozgursar):

 == Patch Testing Report

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

 === Environment
 - WordPress: 7.0-beta3-61849-src
 - PHP: 8.2.29
 - Server: nginx/1.29.4
 - Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
 - Browser: Chrome 145.0.0.0
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.4
 - MU Plugins: None activated
 - Plugins:
   * Test Reports 1.2.1

 === Steps taken
 1. Add images to media library that you can distinguish their orders
 2. Visit `/wp-admin/upload.php?mode=grid&orderby=date&order=desc` and
 observe orders
 3. Confirm that they are ordered from 1 to 10
 4. Apply patch
 5. Visit `/wp-admin/upload.php?mode=grid&orderby=date&order=desc` and
 observe orders
 6. Confirm that they are ordered from 10 to 1
 x. ✅ Patch is solving the problem

 === Expected result
 - We expect the `order` query parameter to return results correctly.

 === Additional Notes
 - Before applying the patch using capital letters `order=DESC`, or
 `order=pizza` didn't change the results for me.

 === Screenshots/Screencast with results
 Before
 [[Image(https://i.imgur.com/7nEtf5V.png)]]

 After
 [[Image(https://i.imgur.com/1jqmRWI.png)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64467#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list