Skip to content

Commit b5b2c6e

Browse files
spaceisntsyntaxSteven Callender
authored andcommitted
LP#2097281: Fix for last_captured_hold Item link
A new source, alhr (action.last_hold_request), was created in commit 5b4b700 and was linked from the item table (asset.copy). Unfortunately, there was a misunderstanding about what the various reltype values are used for, and the incorrect one was used here. This commit changes the reltype to "might_have" so that the correct SQL joins can be created by the reporter, and so that fleshing requests for this field can be performed correctly by the C-based storage services. Reports based on this link from Item (acp) to Last Captured Hold (alhr) will have to be recreated, as the reltype value is used to build the core template join tree. For reference, the three reltype values and their uses are: * has_a - the field on the class holding the link is backed by an actual column on class's the table. There is only every one object present through "has_a" linked fields. * has_many - the field on the class (the local class) holding the link is a virtual field, is not backed by an actual column on the table, but instead describes a relationship where the foreign class holds a field (and has a real table column) that points back to this class using the primary key value of the specific, local object. There can be multiple foreign objects pointing to the local object, and therefore the data is always represented as an array when fleshed. * might_have - just like "has_many", where the field on the local class is not backed by an actual table column, but instead the foreign class points to it using the local primary key. Unlike "has_many", there will only every be one foreign object pointing to the local object, so when fleshed the content of the virtual field is never an array of objects, but either one specific object or NULL. To test: 1) Attempt to run a report based on a template that goes through the last_captured_hold link 2) See that it fails due to a join on a column that does not exist. 2) Fully install the updated IDL 3) Repeat (1); see that the report does not fail Release-note: Fixes reporting source Item's link for last captured hold Co-authored-by: Steven Callender <[email protected]> Signed-off-by: Steven Callender <[email protected]> Signed-off-by: Mike Rylander <[email protected]> Signed-off-by: Galen Charlton <[email protected]>
1 parent 43da6b1 commit b5b2c6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Open-ILS/examples/fm_IDL.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8240,7 +8240,7 @@ SELECT usr,
82408240
<link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
82418241
<link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
82428242
<link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8243-
<link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8243+
<link field="last_captured_hold" reltype="might_have" key="current_copy" map="" class="alhr"/>
82448244
<link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
82458245
<link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
82468246
<link field="floating" reltype="has_a" key="id" map="" class="cfg"/>

0 commit comments

Comments
 (0)