Items are incorrectly sorting when using the Sort By Publication date feature

Bug #1470957 reported by Steve Callender on 2015-07-02
This bug affects 3 people
Affects Status Importance Assigned to Milestone

Bug Description

When using "Sort by Publication Date" in the advanced search menu, items that have a date1 value of "||||" rather than an actual date are being sorted to the top of the list when sorting by newest first. At the very least, these should be moved to the back of the sort list since they do not have an actual date. It looks like if spaces are used instead, it does put it at the end but may still move to the front when sorting by oldest items first.

I believe Items without a proper pub date should be tacked on to the very end of a sort list. Whether it's newest first or oldest first, I would expect no-dates to either not show up, or show after all the items with dates have been sorted.

I've tested this in 2.7.


Mike Rylander (mrylander) wrote :

This comes from a lack of stock configuration for normalizing the pubdate sorter. We also don't install the normalizers for date1 and date2, which is also addressed herein. The latter will help before, after, between, and during searches.

From the commit message:

We supply a normalizer function for making sure date-ish values are
always numeric (several, in fact) but we don't enable them by default
for appropriate fields. This does that.

Additionally, we allow NULL sorters so that the reingest of a "broken"
record will get fixed.

We avoid the need for a reingest to cover the sorter issue by removing
non-numeric pubdate sorters.

Branch coords:;a=shortlog;h=refs/heads/user/miker/lp1470957-allow-null-FF-sorter-via-normalization

Test plan

Sort a result containing date1 values that equal "||||" by date descending, and the "bad" values will be at the top. Apply patch and they'll be at the bottom as they should be.

No release notes, as this is a bug fix for pubdate sorting.

Mike Rylander (mrylander) wrote :


I just force-pushed a typo fix. But, adding pullrequest now!

tags: added: pullrequest
Changed in evergreen:
milestone: none → 2.9-alpha
Changed in evergreen:
milestone: 2.9-alpha → 2.9-beta
Changed in evergreen:
milestone: 2.9-beta → 2.9.0
Changed in evergreen:
milestone: 2.9.0 → 2.9.1
Changed in evergreen:
milestone: 2.9.1 →
Kathy Lussier (klussier) on 2015-12-09
Changed in evergreen:
importance: Undecided → Medium
Changed in evergreen:
assignee: nobody → Jennifer Pringle (jpringle-u)
Jennifer Pringle (jpringle-u) wrote :


With the fix the sort order is valid date, ||||, blank

Newest to Oldest - 2010, 2009, 2008, ||||, blank
Oldest to Newest - 2008, 2009, 2010, ||||, blank

Jennifer Pringle (jpringle-u) wrote :

I have tested this code and consent to signing off on it with my email address, <email address hidden>, and name, Jennifer Pringle.

Changed in evergreen:
assignee: Jennifer Pringle (jpringle-u) → nobody
tags: added: signedoff
Galen Charlton (gmc) on 2016-03-02
Changed in evergreen:
milestone: → 2.10-beta
Galen Charlton (gmc) wrote :

Pushed to master along with some test cases; thanks, Mike and Jennifer.

Holding off on backporting for the moment in case there's any questions about the fact that 008/Date1 = " " is now normalized to "0000".

Changed in evergreen:
status: New → Fix Committed
milestone: 2.10-beta → 2.10-rc
milestone: 2.10-rc → 2.10-beta
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers