This patch ensures that the relative hold queue position
displayed in the webstaff Hold Shelf and Record -> View Holds
interfaces is calculated in the correct order, i.e., (cut-in-line aside)
with holds requested earlier having a lower queue position than
holds requested later.
To test
-------
[1] Set up a bib with a number of hold requests.
[2] Under Record -> Viwe Holds, note that the queue
positions are reversed, with later holds having lower
queue positions.
[3] Apply the patch and repeat step #2. This time, the queue
positions should be correct.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
ROW_NUMBER() OVER (
PARTITION BY r.bib_record
- ORDER BY h.cut_in_line DESC NULLS LAST, h.request_time DESC
+ ORDER BY h.cut_in_line DESC NULLS LAST, h.request_time ASC
) AS relative_queue_position,
EXTRACT(EPOCH FROM COALESCE(