Some libraries need to send a different field as the collection code, depending on how the library catalogs items. We should allow any arbitrary item field to be used as the value for the CR field.
Created attachment 82998 [details] [review] Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Some libraries need to send a different field as the collection code, depending on how the library catalogs items. We should allow any arbitrary item field to be used as the value for the CR field. Test Plan: 1) Apply this patch 2) Set the new option cr_item_field to 'shelving_location' 3) Restart the SIP server 3) Perform a checkin via SIP 4) Note the CR field contains the shelving location code in the response 5) Perform an item information request 6) Note the CR field contains the shelving location code in the response
Created attachment 83102 [details] [review] Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Some libraries need to send a different field as the collection code, depending on how the library catalogs items. We should allow any arbitrary item field to be used as the value for the CR field. Test Plan: 1) Apply this patch 2) Set the new option cr_item_field to 'shelving_location' 3) Restart the SIP server 3) Perform a checkin via SIP 4) Note the CR field contains the shelving location code in the response 5) Perform an item information request 6) Note the CR field contains the shelving location code in the response
Hi Kyle, There are a few merge conflicts with this patch.
Created attachment 93358 [details] [review] Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Some libraries need to send a different field as the collection code, depending on how the library catalogs items. We should allow any arbitrary item field to be used as the value for the CR field. Test Plan: 1) Apply this patch 2) Set the new option cr_item_field to 'shelving_location' 3) Restart the SIP server 3) Perform a checkin via SIP 4) Note the CR field contains the shelving location code in the response 5) Perform an item information request 6) Note the CR field contains the shelving location code in the response
Created attachment 93535 [details] [review] Works as expected. Thanks. -JesseM Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Some libraries need to send a different field as the collection code, depending on how the library catalogs items. We should allow any arbitrary item field to be used as the value for the CR field. Test Plan: 1) Apply this patch 2) Set the new option cr_item_field to 'shelving_location' 3) Restart the SIP server 3) Perform a checkin via SIP 4) Note the CR field contains the shelving location code in the response 5) Perform an item information request 6) Note the CR field contains the shelving location code in the response Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Hi Kyle, We have conflict in etc/SIPconfig.xml when applying. Bug 21979 - Add option to SIP2 config to send arbitrary item field in CR instead of collection code 93535 - Works as expected. Thanks. Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Using index info to reconstruct a base tree... M etc/SIPconfig.xml Falling back to patching base and 3-way merge... Auto-merging etc/SIPconfig.xml CONFLICT (content): Merge conflict in etc/SIPconfig.xml error: Failed to merge in the changes. Patch failed at 0001 Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Works-as-expected-Thanks-ELLAUG.patch
Kyle, I did not test but I see: + $resp .= maybe_add( FID_COLLECTION_CODE, $item->collection_code, $server ); then: + if ( my $CR = $server->{account}->{cr_item_field} ) { + $resp .= maybe_add( FID_COLLECTION_CODE, $item->{$CR} ); + } else { + $resp .= maybe_add( FID_COLLECTION_CODE, $item->collection_code ); + } Is that correct? (twice maybe_add with FID_COLLECTION_CODE)
Created attachment 98066 [details] [review] Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Some libraries need to send a different field as the collection code, depending on how the library catalogs items. We should allow any arbitrary item field to be used as the value for the CR field. Test Plan: 1) Apply this patch 2) Set the new option cr_item_field to 'shelving_location' 3) Restart the SIP server 3) Perform a checkin via SIP 4) Note the CR field contains the shelving location code in the response 5) Perform an item information request 6) Note the CR field contains the shelving location code in the response Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
(In reply to Jonathan Druart from comment #7) > Kyle, I did not test but I see: > > + $resp .= maybe_add( FID_COLLECTION_CODE, > $item->collection_code, $server ); > > then: > > + if ( my $CR = $server->{account}->{cr_item_field} ) { > + $resp .= maybe_add( FID_COLLECTION_CODE, $item->{$CR} ); > + } else { > + $resp .= maybe_add( FID_COLLECTION_CODE, > $item->collection_code ); > + } > > Is that correct? (twice maybe_add with FID_COLLECTION_CODE) Fixed! Looks like the original patch got a bad rebase perhaps.
Created attachment 101308 [details] [review] Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Some libraries need to send a different field as the collection code, depending on how the library catalogs items. We should allow any arbitrary item field to be used as the value for the CR field. Test Plan: 1) Apply this patch 2) Set the new option cr_item_field to 'shelving_location' 3) Restart the SIP server 3) Perform a checkin via SIP 4) Note the CR field contains the shelving location code in the response 5) Perform an item information request 6) Note the CR field contains the shelving location code in the response Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Patch no longer applies, please rebase! Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Using index info to reconstruct a base tree... M C4/SIP/ILS/Item.pm M C4/SIP/Sip/MsgType.pm M etc/SIPconfig.xml Falling back to patching base and 3-way merge... Auto-merging etc/SIPconfig.xml Auto-merging C4/SIP/Sip/MsgType.pm Auto-merging C4/SIP/ILS/Item.pm CONFLICT (content): Merge conflict in C4/SIP/ILS/Item.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-21979-Add-option-to-SIP2-config-to-send-arbitr-uD5jqS.patch I have some issues setting up SIP on my kohadevbox - looking for a tutor!
Created attachment 108502 [details] [review] Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Some libraries need to send a different field as the collection code, depending on how the library catalogs items. We should allow any arbitrary item field to be used as the value for the CR field. Test Plan: 1) Apply this patch 2) Set the new option cr_item_field to 'shelving_location' 3) Restart the SIP server 3) Perform a checkin via SIP 4) Note the CR field contains the shelving location code in the response 5) Perform an item information request 6) Note the CR field contains the shelving location code in the response Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Created attachment 110746 [details] [review] Bug 21979: Add option to SIP2 config to send arbitrary item field in CR instead of collection code Some libraries need to send a different field as the collection code, depending on how the library catalogs items. We should allow any arbitrary item field to be used as the value for the CR field. Test Plan: 1) Apply this patch 2) Set the new option cr_item_field to 'shelving_location' 3) Restart the SIP server 3) Perform a checkin via SIP 4) Note the CR field contains the shelving location code in the response 5) Perform an item information request 6) Note the CR field contains the shelving location code in the response Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This works as expected and the code reads well... Should we be adding Unit Tests for these SIP additions however...? Passing QA and letting the RM weight in on the above.
Created attachment 110757 [details] [review] Bug 21979: Add unit tests
Pushed to master for 20.11, thanks to everybody involved!
enhancement will not be backported to 20.05.x