A changed introduced in Bug 26744 affects the order in which patron attribtes are saved, so that one no longer can rely on that the attribute ids are assigned in the same order as the data was passed in. This has very minor implications in Koha itself. since attributes are sorted by other columns when retrieved. but many tests in t/db_dependent/api/v1/patrons_extended_attributes.t now fail because of this. This patch makes sure the order is preserved when saving the attributes, and tests should now work again.
Created attachment 179329 [details] [review] Bug 39334: (follow up) Preserve order when adding patron attributes To test: 1) Run tests in t/db_dependent/api/v1/patrons_extended_attributes.t, serveral should fail 2) Apply patch 3) Run the tests in 1) again, all should now pass
Hi David, please make sure you are using the newest components (newest ktd, nuke erm_module, yarn install...) - the patch was not tidy. I fixed before pushing and treating this as a follow-up to the original bug
Hm, on second thought: since this doesn't fix the tests but changes the code I am asking for a set of QA eyes here too please. Attaching the tidied patch.
Created attachment 179377 [details] [review] Bug 39334: (follow-up) Preserve order when adding patron attributes To test: 1) Run tests in t/db_dependent/api/v1/patrons_extended_attributes.t, serveral should fail 2) Apply patch 3) Run the tests in 1) again, all should now pass
Created attachment 179388 [details] [review] Bug 39334: (follow-up) Preserve order when adding patron attributes To test: 1) Run tests in t/db_dependent/api/v1/patrons_extended_attributes.t, serveral should fail 2) Apply patch 3) Run the tests in 1) again, all should now pass Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(In reply to Katrin Fischer from comment #2) > Hi David, please make sure you are using the newest components (newest ktd, > nuke erm_module, yarn install...) - the patch was not tidy. I fixed before > pushing and treating this as a follow-up to the original bug Ok, thanks!
Pushed for 25.05! Well done everyone, thank you!