LP#1964986: encourage distinct results when querying the ahopl IDL source
authorblake <blake@mobiusconsortium.org>
Tue, 15 Mar 2022 16:48:12 +0000 (11:48 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 29 Mar 2023 14:55:25 +0000 (10:55 -0400)
This patch addresses a now-theoretical issue where a direct PCRUD
query of ahopl could return duplicate rows in cases where the patron
linked to the hold request has multiple penalties attached.

The significance of this change is likely minor nowadays, as ahopl
was directly used by Evergreen only by the Dojo and AngularJS hold
pull lists, and as of 3.8 the Evergreen Angular pull list uses a
different approach for querying the pull list. However, until such
time as ahopl is deprecated and removed, this change may help
local integrations.

Signed-off-by: blake <blake@mobiusconsortium.org>
Signed-off-by: Jennifer Weston <jennifer.weston@equinoxOLI.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/examples/fm_IDL.xml

index e4b88ca..916958b 100644 (file)
@@ -6872,7 +6872,7 @@ SELECT  usr,
        </class>
        <class id="ahopl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_on_pull_list" reporter:label="Hold On Pull List" oils_persist:readonly="true">
                <oils_persist:source_definition><![CDATA[
-               SELECT
+               SELECT DISTINCT
                        ahr.*,
                        COALESCE(acplo.position, acpl_ordered.fallback_position) AS
                                copy_location_order_position,