Opened 2 years ago
Closed 2 years ago
#16341 closed defect (bug) (fixed)
Sorting is reset after searching
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: |
Description (last modified by scribu)
- Go to /wp-admin/edit.php
- Sort by title
- Search for something
The search results are no longer sorted by title.
All list screens are affected.
Attachments (8)
Change History (26)
SergeyBiryukov
— 2 years ago
comment:1
scribu
— 2 years ago
16341.diff fixes the problem for edit.php, but the same needs to be done for all list screens.
comment:2
follow-up:
↓ 4
scribu
— 2 years ago
I like Sergey's patch better.
Maybe we should make it a method of WP_List_Table, to avoid code duplication.
comment:4
in reply to:
↑ 2
ocean90
— 2 years ago
Replying to scribu:
Maybe we should make it a method of WP_List_Table, to avoid code duplication.
+1
ocean90: scribu: Wouldn't be something like $wp_list_table->hidden_fields() nice? scribu: exactly ocean90: Which has some default fields and is extendable for example for the edit screen (post_type & post_status) scribu: yep
SergeyBiryukov
— 2 years ago
comment:5
SergeyBiryukov
— 2 years ago
16341.2.patch should do it for Posts, Media Library, Links, Pages, Comments and Users screens. Going to check Network screens.
comment:6
SergeyBiryukov
— 2 years ago
16341.3.patch should do it for Network screens as well.
SergeyBiryukov
— 2 years ago
comment:7
SergeyBiryukov
— 2 years ago
- Keywords has-patch added
comment:8
SergeyBiryukov
— 2 years ago
- Keywords needs-testing added
comment:9
follow-up:
↓ 10
nacin
— 2 years ago
Not a fan of all the churn here. Let's just add the method and call it hidden_order_fields(), call it everywhere, and don't bother with any other iterations at this point.
SergeyBiryukov
— 2 years ago
comment:10
in reply to:
↑ 9
SergeyBiryukov
— 2 years ago
Replying to nacin:
Let's just add the method and call it hidden_order_fields(), call it everywhere, and don't bother with any other iterations at this point.
Done.
SergeyBiryukov
— 2 years ago
comment:11
SergeyBiryukov
— 2 years ago
16341.6.patch may have better formatting in hidden_order_fields().
comment:12
nacin
— 2 years ago
We can also just sneak the logic into views() probably, as it's called on all the same pages. But thanks for the much simpler patch.
comment:13
SergeyBiryukov
— 2 years ago
views() is currently called outside of the search forms. Not sure how it would help here.
comment:14
SergeyBiryukov
— 2 years ago
Perhaps search_box() would be appropriate place?
SergeyBiryukov
— 2 years ago
comment:15
SergeyBiryukov
— 2 years ago
OK, here's even more simple patch :)
comment:16
scribu
— 2 years ago
I can agree with hidden_order_fields(), but slapping them onto search_box() is wrong, IMO.
comment:17
scribu
— 2 years ago
- Keywords commit added; needs-testing removed
From IRC:
(07:36:52 PM) nacin: scribu: the first thing I'm doing when 3.1 is released is rearchitecting this mess.
So let's go with 16341.7.patch
comment:18
nacin
— 2 years ago
- Resolution set to fixed
- Status changed from new to closed
for edit.php