Make direct queries of ahopl ("Holds On Pull List") IDL class return distinct results
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Medium
|
Unassigned | ||
3.9 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
EG 3.7.2
PG 9.6
We found that the pull list interface will show fewer results than it should. If you ask for 5 rows, it can show you 4, and pagination is disabled. Pretty strange when you change the dropdown and ask for 10 rows and it gives you 9! Indicating to you that there are more than 4 rows, even though you wanted 5 to begin with.
The issue ended up having to do with the IDL query for ahopl. That query can return identical rows when a patron has more than one penalty. Specifically penalties that do not block CAPTURE.
I've come up with a query that should help find branches in your ILS that could* show this bug:
select aou.shortname
from
actor.org_unit aou
join action.hold_request ahr2 on (ahr2.pickup_
join
(
select ahr.id,count(*)
from
action.hold_request ahr
join actor.usr au on(au.id=ahr.usr)
join actor.usr_
LEFT JOIN config.
ON (
csp.id = ausp.standing_
csp.block_list LIKE '%CAPTURE%' AND (
(csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
(csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
SELECT id FROM actor.org_
)
)
)
where
ahr.capture_time IS NULL AND
ahr.cancel_time IS NULL AND
csp.id IS NULL AND
(ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
csp.id is null
group by 1
having count(*) > 1
) bug_ids
on (bug_ids.
group by 1
If this makes any results for you:
1. Register a workstation at one of those branches.
2. Login to the staff client with that workstation
3. Run the pull list. Start with 100 rows to get an idea of the total number you would expect.
4. Change it back down to 5 rows
5. Page through until the interface stops returning rows well before you would expect it.
The solution (I think) is to tweak that IDL query such that it doesn't return duplicate rows. I've solved it locally by adding DISTINCT at the top of the query. I'll post a branch, but any other suggestions are welcome!
Changed in evergreen: | |
milestone: | none → 3.9.1 |
Changed in evergreen: | |
milestone: | 3.9.1 → 3.9.2 |
Changed in evergreen: | |
milestone: | 3.9.2 → 3.10.2 |
importance: | Undecided → Medium |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Branch:
https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ blake/LP1964986 _Pull_list_ can_lose_ pagination_ when_a_ patron_ has_more_ than_one_ penalty