Created attachment 152250 [details] [review] Bug 33970: update DB
Created attachment 152251 [details] [review] Bug 33970: atomicupdate file
Created attachment 152252 [details] [review] Bug 33970: [DONT PUSH] dbic file
Original issue is mentioned in bug 20640. Do a search for "Duplicate ID" Don't apply patches. ILL set-up, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev-plus.sh) The above will fetch the latest of FreeForm and BLDSS, that are already compatible with this. Test plan: - Create a new BLDSS request, enter "9780822370451" on "Keywords" input field - Put "42" on cardnumber and pick a branch, submit - Next screen, on the far right of the table, click the "Request <BLLID>" link - Next screen, click the "Request" bottom button - Next screen, click the "Switch provider" button and pick "FreeForm" - Verify you have a "Duplicate ID" error, the logs say - Duplicate entry '2-author' for key 'PRIMARY' This is because both backends have a "author" illrequestattribute field. And switching provider maintains the same ILL request (thus illrequest_id). It's trying to add another row with composite key "1-author" in the illrequestattributes table. Apply patches, and either reset_all or updatedatabase.pl Do the test plan again, verify it now succeeds. This should also cover the use-case where different backends have different meaning for equal attribute keys.
A possible interesting follow-up would be to create a bottom section in the "Manage request" page titled "Details from previous backend(s)", where we'd list all illrequestattributes from backends different than the current one. Under the existing "Details from supplier (supplier name)" section, we'd update this list to just show the illrequestattributes from the current backend.
Created attachment 153263 [details] [review] Bug 33970: update DB Signed-off-by: Chris Walton <C.J.Walton@lboro.ac.uk>
Created attachment 153264 [details] [review] Bug 33970: atomicupdate file Signed-off-by: Chris Walton <C.J.Walton@lboro.ac.uk>
Created attachment 153265 [details] [review] Bug 33970: [DONT PUSH] dbic file Signed-off-by: Chris Walton <C.J.Walton@lboro.ac.uk>
(In reply to Pedro Amorim from comment #5) > A possible interesting follow-up would be to create a bottom section in the > "Manage request" page titled "Details from previous backend(s)", where we'd > list all illrequestattributes from backends different than the current one. > > Under the existing "Details from supplier (supplier name)" section, we'd > update this list to just show the illrequestattributes from the current > backend. Scratch this. This list is provided by the backend's metadata method, hence must be solved on the backend, not core.
Created attachment 154903 [details] [review] Bug 33970: Fix tests
Created attachment 157433 [details] [review] Bug 33970: Update DB Signed-off-by: Chris Walton <C.J.Walton@lboro.ac.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 157434 [details] [review] Bug 33970: Atomicupdate file Signed-off-by: Chris Walton <C.J.Walton@lboro.ac.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 157435 [details] [review] Bug 33970: [DONT PUSH] dbic file Signed-off-by: Chris Walton <C.J.Walton@lboro.ac.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 157436 [details] [review] Bug 33970: Fix tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 157437 [details] [review] Bug 33970: Compatability schim This adds a compatability option to allow older backends not passing their backend code through to the attributes on store. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I've added a schim that I think should help with backward compatibility for backends. Generally I think this is a really good move and shouldn't cause regressions. I'm going to PQA (scripts are happy etc).. but leave to the RM to have a look.. the code is simple but the consequences could be interesting.
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x