[Bug 26744] New: Log changes to extended patron attributes
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Bug ID: 26744 Summary: Log changes to extended patron attributes Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com It looks like changes to a patron's "extended patron attributes" are not logged, when BorrowersLog is on. They should probably be. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- If we want to be really flexible, we could make logging a per-attribute setting. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Anneli Österman <anneli.osterman@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anneli.osterman@koha-suomi. | |fi --- Comment #2 from Anneli Österman <anneli.osterman@koha-suomi.fi> --- Logging would be a good thing. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 George Williams (NEKLS) <george@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |george@nekls.org --- Comment #3 from George Williams (NEKLS) <george@nekls.org> --- +1 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Sara Brown <sbrown@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sbrown@bywatersolutions.com --- Comment #4 from Sara Brown <sbrown@bywatersolutions.com> --- Still relevant in 21.11 and still would be useful! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |22794 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22794 [Bug 22794] Omnibus: Improve and extend logging in Koha -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lisette Scheer <lisette.scheer@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette.scheer@bywatersolut | |ions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 hebah@bywatersolutions.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hebah@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Andrew Fuerste-Henry <andrewfh@dubcolib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrewfh@dubcolib.org --- Comment #5 from Andrew Fuerste-Henry <andrewfh@dubcolib.org> --- +1, this would be helpful -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #6 from David Gustafsson <glasklas@gmail.com> --- Created attachment 163957 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163957&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |glasklas@gmail.com |ity.org | CC| |glasklas@gmail.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163957|0 |1 is obsolete| | --- Comment #7 from David Gustafsson <glasklas@gmail.com> --- Created attachment 163958 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163958&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #8 from David Gustafsson <glasklas@gmail.com> --- Created attachment 163959 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163959&action=edit Bug 26744: Only log if BorrowersLog syspref is enabled -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- This works as described so I will sign-off. Why not log repeatable attributes as well? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163958|0 |1 is obsolete| | --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 164034 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164034&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163959|0 |1 is obsolete| | --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 164035 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164035&action=edit Bug 26744: Only log if BorrowersLog syspref is enabled Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #12 from David Gustafsson <glasklas@gmail.com> --- I actually don't know since I'm not the original author of this patch, but I guess there is sole technical reasons. My guess would be it's harder to figure out a hood way of representing the change, and especially tricky if you just want one log message when adding multiple instances of a repeatable field since the stores method would be called repeatedly for each existing and added change. If the logging was performed in the extended_attributes method it could be doable, but that might not catch all modifications and think there might be more patrons performing modification that would have to be handled as well. Can ask my collegue tomorrow about this. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Stefan Berndtsson <stefan.berndtsson@ub.gu.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stefan.berndtsson@ub.gu.se --- Comment #13 from Stefan Berndtsson <stefan.berndtsson@ub.gu.se> --- (In reply to Lucas Gass from comment #9)
This works as described so I will sign-off. Why not log repeatable attributes as well?
I'm the one who wrote the original patch here. The way editing of extended attributes work is that they're all first deleted, then they're recreated from the form. Since all of the previous attributes are just deleted, I have no way that I can see to know which of the repeatable attributes that was changed into what. It there had been a more conventional way to edit the existing attributes this would've been easy. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #14 from David Gustafsson <glasklas@gmail.com> --- Created attachment 164098 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164098&action=edit Bug 26744: Add support for repeatable and deleted attributes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #15 from David Gustafsson <glasklas@gmail.com> --- I realised it actually was not too much trouble also logging changes to repeatable attributes (and deletions) if instead performing the logging in Koha::Patron->extended_attributes, so I revised the patch to do that instead. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Anneli Österman <anneli.osterman@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #16 from Anneli Österman <anneli.osterman@koha-suomi.fi> --- I tested this in sandbox with three patron attributes: SSN (not repetable), HOLDID (not repetable) and AUTOTYPE (repetable). When I made a change to attribute the after value is recorded to the action logs but not the before value. The repetable AUTOTYPE attribute recorded changes only to one of the values. Deletion of SSN-value was not recorderd. It seems to me that this does not work as intended. Here are explained the actions that I took and how they showed in the action logs. Changed AUTOTYPE values from Palautusautomaatti -> Palautusautomaatti 2 AND Lainausautomaatti -> Lainausautomaatti2. The latter was not recorded to the action log. 04/19/2024 06:50 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute AUTOTYPE: { "after" : [ "Palautusautomaatti2" ], "before" : [] } Intranet Changed HOLDID value from 12345678 to 123456789 04/19/2024 06:50 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute HOLDID: { "after" : "123456789", "before" : "" } Intranet Changed SSN value from sotu123456 to sotu1234567 04/19/2024 06:50 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute SSN: { "after" : "sotu1234567", "before" : "" } Intranet Changed HOLDID value from 123456789 to 1234567890 04/19/2024 06:51 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute HOLDID: { "after" : "1234567890", "before" : "" } Intranet Changed SSN value from sotu1234567 to sotu123456 04/19/2024 06:51 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute SSN: { "after" : "sotu123456", "before" : "" } Intranet Changed AUTOTYPE values from Palautusautomaatti2 -> Palautusautomaatti AND Lainausautomaatti2 -> Lainausautomaatti. The latter was not recorded to the action log. 04/19/2024 06:51 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute AUTOTYPE: { "after" : [ "Palautusautomaatti" ], "before" : [] } Intranet Deleted value from SSN and saved. The deletion was not recorded but there were actions logged for AUTOTYPE and HOLDID which were not changed any way before saving the patron. 04/19/2024 06:52 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute AUTOTYPE: { "after" : [ "Palautusautomaatti" ], "before" : [] } Intranet 04/19/2024 06:52 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute HOLDID: { "after" : "1234567890", "before" : "" } Intranet Added value for SSN, did not change other attributes. Still there we lines for them. 04/19/2024 07:04 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute AUTOTYPE: { "after" : [ "Palautusautomaatti" ], "before" : [] } Intranet 04/19/2024 07:04 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute SSN: { "after" : "sotu234567", "before" : "" } Intranet 04/19/2024 07:04 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute HOLDID: { "after" : "1234567890", "before" : "" } Intranet Cleared repeting AUTOTYPE Lainausautomaatti. No record of it but there were record of others which were not changed. 04/19/2024 07:04 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute AUTOTYPE: { "after" : [ "Palautusautomaatti" ], "before" : [] } Intranet 04/19/2024 07:04 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute SSN: { "after" : "sotu234567", "before" : "" } Intranet 04/19/2024 07:04 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute HOLDID: { "after" : "1234567890", "before" : "" } Intranet Added back the cleared AUTOTYPE Lainausautomaatti. No record of it. 04/19/2024 07:08 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute SSN: { "after" : "sotu234567", "before" : "" } Intranet 04/19/2024 07:08 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute HOLDID: { "after" : "1234567890", "before" : "" } Intranet 04/19/2024 07:08 koha (51) Patrons Modify Joyce Gaines (22) Patron attribute AUTOTYPE: { "after" : [ "Palautusautomaatti" ], "before" : [] } Intranet -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #17 from David Gustafsson <glasklas@gmail.com> --- Created attachment 165212 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165212&action=edit Bug 26744: Don't delete extended attributes outside of method And fix bug where $attribute_changes was overwritten instead of assigned default value. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #18 from David Gustafsson <glasklas@gmail.com> --- Created attachment 165213 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165213&action=edit Bug 26744: Add test for multiple values of repeatable fields -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #19 from David Gustafsson <glasklas@gmail.com> --- @Anneli Österman Thanks for the extensive testing, I should have added tests also for updates with multiple values. There was a line outside of the extended_attributes method that deleted the attributes in memberentry.pl that was not caught by the tests as the method is tested in isolation. But there was also a bug where the stashed repeatable attributes was overwritten where a default value should be assigned, both are now fixed and tests have been added to cover the latter case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #20 from Clemens Tubach <clemens.tubach@kit.edu> --- Created attachment 165301 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165301&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Clemens Tubach <clemens.tubach@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164035|0 |1 is obsolete| | --- Comment #21 from Clemens Tubach <clemens.tubach@kit.edu> --- Created attachment 165302 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165302&action=edit Bug 26744: Only log if BorrowersLog syspref is enabled Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Clemens Tubach <clemens.tubach@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164098|0 |1 is obsolete| | --- Comment #22 from Clemens Tubach <clemens.tubach@kit.edu> --- Created attachment 165303 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165303&action=edit Bug 26744: Add support for repeatable and deleted attributes Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Clemens Tubach <clemens.tubach@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165212|0 |1 is obsolete| | --- Comment #23 from Clemens Tubach <clemens.tubach@kit.edu> --- Created attachment 165304 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165304&action=edit Bug 26744: Don't delete extended attributes outside of method And fix bug where $attribute_changes was overwritten instead of assigned default value. Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Clemens Tubach <clemens.tubach@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165213|0 |1 is obsolete| | --- Comment #24 from Clemens Tubach <clemens.tubach@kit.edu> --- Created attachment 165305 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165305&action=edit Bug 26744: Add test for multiple values of repeatable fields Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Clemens Tubach <clemens.tubach@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clemens.tubach@kit.edu Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Clemens Tubach <clemens.tubach@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164034|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@ptfs-europe.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_24_05_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_24_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165301|0 |1 is obsolete| | Attachment #165302|0 |1 is obsolete| | Attachment #165303|0 |1 is obsolete| | Attachment #165304|0 |1 is obsolete| | Attachment #165305|0 |1 is obsolete| | --- Comment #25 from David Gustafsson <glasklas@gmail.com> --- Created attachment 177605 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177605&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #26 from David Gustafsson <glasklas@gmail.com> --- Squashed (to simplify rabase and review) and rebasted against master. The changes in bug 35508 required some refactoring, and the changes in made there could be unified with the code here since both bugs deal with comparing changes for attributes.The comparison is now more granular and instead of replacing all attributes if anything changes the replacement is now on an attribute type level. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #27 from David Gustafsson <glasklas@gmail.com> --- Will probably have to perform som more manual testing, and perhaps add some more tests, before totally confident everything works as it should. But feel free to review the code meanwhile. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #28 from David Gustafsson <glasklas@gmail.com> --- Another improvement is that the comparison (that decides if attributes has changed) now resides in the extended_attributes method, and not outside in memberentry.pl, so the updated column will not be set if patron attributes are updated some where else using this method, when no value has changed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177605|0 |1 is obsolete| | --- Comment #29 from David Gustafsson <glasklas@gmail.com> --- Created attachment 177652 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177652&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177652|0 |1 is obsolete| | --- Comment #30 from David Gustafsson <glasklas@gmail.com> --- Created attachment 178728 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178728&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #31 from David Gustafsson <glasklas@gmail.com> --- Rebased against main. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177652|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178728|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177652|0 |1 is obsolete| | --- Comment #32 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 178771 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178771&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #33 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Since it was just a rebase we can keep Clemens SO line here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #34 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- The only problem I now see here is that changes are not logged when I update attributes with the Batch patron modification tool. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #35 from David Gustafsson <glasklas@gmail.com> --- Created attachment 178787 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178787&action=edit Bug 26744: Log changes also in modborrowers.pl and when calling add_extended_attribute -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178787|0 |1 is obsolete| | --- Comment #36 from David Gustafsson <glasklas@gmail.com> --- Created attachment 178788 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178788&action=edit Bug 26744: Log changes also in modborrowers.pl and when calling add_extended_attribute -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #37 from David Gustafsson <glasklas@gmail.com> --- (In reply to Lucas Gass (lukeg) from comment #34)
The only problem I now see here is that changes are not logged when I update attributes with the Batch patron modification tool.
Ok! This has now been fixed so that modborrowers.pl use the extended_attributes method instead and changes are logged. There is also a case in Koha::Patron->merge_with where patron attributes are modified by the add_extended_attribute method. The way it's used is not possible to replace it with the extended_attributes method, but I added logging also for add_extended_attribute, which is better really as it possibly cover other cases. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178788|0 |1 is obsolete| | --- Comment #38 from David Gustafsson <glasklas@gmail.com> --- Created attachment 178789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178789&action=edit Bug 26744: Log changes also in modborrowers.pl and when calling add_extended_attribute -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178771|0 |1 is obsolete| | --- Comment #39 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 178801 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178801&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178789|0 |1 is obsolete| | --- Comment #40 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 178802 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178802&action=edit Bug 26744: Log changes also in modborrowers.pl and when calling add_extended_attribute Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #41 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Small note, the string this puts into the info field isn't formatted exactly like edits of other parts of the patron record. For example, here's an edit to a name field: { "preferred_name" : { "after" : "Huey", "before" : "Hank" } } And an edit to an attribute: Patron attribute SHOW_BCODE: { "after" : "1", "before" : "" } Not a blocker, but worth noting for its impact on reports. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #42 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 178803 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178803&action=edit Bug 26744: (QA follow up) Tidy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #43 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- David, this is looking very nice. I tidied some things but you might want to look into pulling fresh ktd images and use the new pre-commit tidy stuff. See Bug 38664. You might face more QA challenges in the future without. I have one question here: Is List::Util's zip6 really necessary for comparison? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |The enhancements allows for release notes| |the logging of patron | |attribute types when | |adding, removing, or | |updating them in a patron | |record. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |lucas@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #44 from David Gustafsson <glasklas@gmail.com> --- Created attachment 178817 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178817&action=edit Bug 26744: Cosolidate changes and change log format -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #45 from David Gustafsson <glasklas@gmail.com> --- (In reply to Andrew Fuerste-Henry from comment #41)
Small note, the string this puts into the info field isn't formatted exactly like edits of other parts of the patron record. For example, here's an edit to a name field: { "preferred_name" : { "after" : "Huey", "before" : "Hank" } }
And an edit to an attribute: Patron attribute SHOW_BCODE: { "after" : "1", "before" : "" }
Not a blocker, but worth noting for its impact on reports.
Ok! I changed the log format to pure json, prepending "attribute." to the "field" name. Also saw that the normal field logging writes one log entry for all field changes, so fixed so this is done also for attribute changes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #46 from David Gustafsson <glasklas@gmail.com> --- (In reply to Lucas Gass (lukeg) from comment #43)
David, this is looking very nice. I tidied some things but you might want to look into pulling fresh ktd images and use the new pre-commit tidy stuff. See Bug 38664. You might face more QA challenges in the future without.
I have one question here:
Is List::Util's zip6 really necessary for comparison?
It could of course be done in other ways, but I don't see why using zip6 would be a problem as it makes the code compact and concise. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #47 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to David Gustafsson from comment #45)
(In reply to Andrew Fuerste-Henry from comment #41)
Small note, the string this puts into the info field isn't formatted exactly like edits of other parts of the patron record. For example, here's an edit to a name field: { "preferred_name" : { "after" : "Huey", "before" : "Hank" } }
And an edit to an attribute: Patron attribute SHOW_BCODE: { "after" : "1", "before" : "" }
Not a blocker, but worth noting for its impact on reports.
Ok! I changed the log format to pure json, prepending "attribute." to the "field" name. Also saw that the normal field logging writes one log entry for all field changes, so fixed so this is done also for attribute changes.
Thanks, David! I can confirm the syntax change looks good and multiple attribute changes all log as one entry. Is there some inherent reason attribute changes and edits to the regular borrower fields couldn't all go in one log line when performed together? If that's feasible, I may file a followup bug for it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178801|0 |1 is obsolete| | --- Comment #48 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 178839 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178839&action=edit Bug 26744: Log changes to extended patron attributes Log non-repeatable attributes and only log changes and creations, not deletions. When changed, attributes are first all deleted, then the relevant ones are recreated. This patch catches all deletions, and checks against them in the creation phase, logging only the attributes that have changed (with before/after content). This makes it impossible to log actual deletions. To test: 1) Ensure tests in t/db_dependent/Koha/Patron/Attribute.t passes Sponsored-by: Gothenburg University Library Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178802|0 |1 is obsolete| | --- Comment #49 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 178840 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178840&action=edit Bug 26744: Log changes also in modborrowers.pl and when calling add_extended_attribute Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178803|0 |1 is obsolete| | --- Comment #50 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 178841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178841&action=edit Bug 26744: (QA follow up) Tidy Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178817|0 |1 is obsolete| | --- Comment #51 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 178842 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178842&action=edit Bug 26744: Cosolidate changes and change log format Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #52 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #53 from David Gustafsson <glasklas@gmail.com> --- (In reply to Andrew Fuerste-Henry from comment #47)
(In reply to David Gustafsson from comment #45)
(In reply to Andrew Fuerste-Henry from comment #41)
Small note, the string this puts into the info field isn't formatted exactly like edits of other parts of the patron record. For example, here's an edit to a name field: { "preferred_name" : { "after" : "Huey", "before" : "Hank" } }
And an edit to an attribute: Patron attribute SHOW_BCODE: { "after" : "1", "before" : "" }
Not a blocker, but worth noting for its impact on reports.
Ok! I changed the log format to pure json, prepending "attribute." to the "field" name. Also saw that the normal field logging writes one log entry for all field changes, so fixed so this is done also for attribute changes.
Thanks, David! I can confirm the syntax change looks good and multiple attribute changes all log as one entry. Is there some inherent reason attribute changes and edits to the regular borrower fields couldn't all go in one log line when performed together? If that's feasible, I may file a followup bug for it.
That's not practically possible I'm afraid, even though I can se how it makes sense from a user perspective. as code wise fields and attributes are very different things, with no common methods for updates/changes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #54 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to David Gustafsson from comment #53)
That's not practically possible I'm afraid, even though I can se how it makes sense from a user perspective. as code wise fields and attributes are very different things, with no common methods for updates/changes.
Thanks for confirming! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com Keywords| |additional_work_needed --- Comment #55 from Jonathan Druart <jonathan.druart@gmail.com> --- I suspect this change to be the cause of the following 2 failures: $ prove t/db_dependent/api/v1/patrons.t t/db_dependent/api/v1/patrons.t .. 3/7 # Failed test at t/db_dependent/api/v1/patrons.t line 1042. # got: 'zmEXaS_1HNKHibXWfmUaGo2s8GVHLodtQe5ulfn2oLO' # expected: 'pD7HHacPDh6DExQ7wl2XBBZNj2cmz3_F0_iSUhNAFEVY4Wv16OS55oN9aVWVjB' # Failed test at t/db_dependent/api/v1/patrons.t line 1042. # got: 'zmEXaS_1HNKHibXWfmUaGo2s8GVHLodtQe5ulfn2oLO' # expected: 'Z1dK8ALzVvAz3pjOgpVOzM9cVizAnWw7Fy8rB9eTfuLvCRCdhzqpgFcMN3' # Failed test at t/db_dependent/api/v1/patrons.t line 1042. # got: 'Z1dK8ALzVvAz3pjOgpVOzM9cVizAnWw7Fy8rB9eTfuLvCRCdhzqpgFcMN3' # expected: 'zmEXaS_1HNKHibXWfmUaGo2s8GVHLodtQe5ulfn2oLO' # Failed test at t/db_dependent/api/v1/patrons.t line 1042. # got: 'pD7HHacPDh6DExQ7wl2XBBZNj2cmz3_F0_iSUhNAFEVY4Wv16OS55oN9aVWVjB' # expected: 'zmEXaS_1HNKHibXWfmUaGo2s8GVHLodtQe5ulfn2oLO' # Looks like you failed 4 tests of 26. # Failed test 'extended_attributes tests' # at t/db_dependent/api/v1/patrons.t line 1045. # Looks like you failed 1 test of 44. # Failed test 'librarian access tests' # at t/db_dependent/api/v1/patrons.t line 1048. # Looks like you failed 1 test of 2. t/db_dependent/api/v1/patrons.t .. 4/7 # Failed test 'update() tests' # at t/db_dependent/api/v1/patrons.t line 1049. t/db_dependent/api/v1/patrons.t .. 7/7 # Looks like you failed 1 test of 7. t/db_dependent/api/v1/patrons.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/7 subtests $ prove t/db_dependent/api/v1/patrons_extended_attributes.t t/db_dependent/api/v1/patrons_extended_attributes.t .. 2/5 # Failed test 'exact match for JSON Pointer "/0/type"' # at t/db_dependent/api/v1/patrons_extended_attributes.t line 358. # got: 'KDtH_WsRVKD5KY5R9N_VTJTJkZ6xfGKtqmD' # expected: 'DDqUW_ML8Mz3FfSWsx2kOUoywRGNwi2UuGvNjhVKyqkoKexxB_0aidSXowl6' # Failed test 'exact match for JSON Pointer "/0/value"' # at t/db_dependent/api/v1/patrons_extended_attributes.t line 358. # got: 'updated_mandatory' # expected: 'updated_repeatable_1' # Failed test 'exact match for JSON Pointer "/1/value"' # at t/db_dependent/api/v1/patrons_extended_attributes.t line 358. # got: 'updated_repeatable_1' # expected: 'updated_repeatable_2' # Failed test 'exact match for JSON Pointer "/2/value"' # at t/db_dependent/api/v1/patrons_extended_attributes.t line 358. # got: 'updated_repeatable_2' # expected: 'updated_repeatable_3' # Failed test 'exact match for JSON Pointer "/3/type"' # at t/db_dependent/api/v1/patrons_extended_attributes.t line 358. # got: 'DDqUW_ML8Mz3FfSWsx2kOUoywRGNwi2UuGvNjhVKyqkoKexxB_0aidSXowl6' # expected: 'KDtH_WsRVKD5KY5R9N_VTJTJkZ6xfGKtqmD' # Failed test 'exact match for JSON Pointer "/3/value"' # at t/db_dependent/api/v1/patrons_extended_attributes.t line 358. # got: 'updated_repeatable_3' # expected: 'updated_mandatory' # Looks like you failed 6 tests of 29. t/db_dependent/api/v1/patrons_extended_attributes.t .. 3/5 # Failed test 'overwrite() tests' # at t/db_dependent/api/v1/patrons_extended_attributes.t line 361. They could eventually pass as it's a random failure, but it's failing almost every run locally. The problem is the following: We send some attributes to the PUT route, but return the attributes in a different order. My guess is that the culprit is this line: Koha/Patron.pm 2308 # Sort new attributes by code 2309 @new_attributes = sort { $a->attribute cmp $b->attribute } @new_attributes; Please fix ASAP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #56 from David Gustafsson <glasklas@gmail.com> --- I'm looking into it. I made sure the attributes is now saved in the order they where passed in, but also encountering some other failed tests. Not sure what is happening, but will sort it out. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #57 from David Gustafsson <glasklas@gmail.com> --- Created attachment 179284 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179284&action=edit Bug 26744i: (follow up) Preserve order when adding patron attributes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179284|0 |1 is obsolete| | --- Comment #58 from David Gustafsson <glasklas@gmail.com> --- Created attachment 179285 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179285&action=edit Bug 26744: (follow up) Preserve order when adding patron attributes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #59 from David Gustafsson <glasklas@gmail.com> --- I'm not sure about now patches for bugs that has already been push are handled, should I have created a new bug for this? Posting the patch her meanwhile. It was the insertion order that was the issue, but I initially put the code that checks for required types before storing the attributes, while it previously was the other way around, so tests failed since some errors that exceptions where thrown in a different order, so when there where many validation errors a different one showed up in the tests. When preserving the same order as before all tests pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179285|0 |1 is obsolete| | --- Comment #60 from David Gustafsson <glasklas@gmail.com> --- Created attachment 179286 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179286&action=edit Bug 26744: (follow up) Preserve order when adding patron attributes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=39334 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #61 from David Gustafsson <glasklas@gmail.com> --- Pretty sure should be handled as a new bug, so created Bug 39334. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 --- Comment #62 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Gustafsson from comment #61)
Pretty sure should be handled as a new bug, so created Bug 39334.
Hi David, sorry for being a little late :( Follow-up patches on bugs not yet in a released version are fine. If I set "additional_work_needed" and don't aks for a new bug it's usually fine. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39334 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39334 [Bug 39334] Preserve order when saving patron attributes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #63 from David Cook <dcook@prosentient.com.au> --- (In reply to David Gustafsson from comment #46)
(In reply to Lucas Gass (lukeg) from comment #43)
Is List::Util's zip6 really necessary for comparison?
It could of course be done in other ways, but I don't see why using zip6 would be a problem as it makes the code compact and concise.
It looks like zip6 became available in List::MoreUtils 0.423 (from August 2017). Older versions of Debian/Ubuntu used version 0.416 so they wouldn't have been able to support this change. Fortunately, all the currently supported versions of Debian/Ubuntu have version 0.430 so it's all good. That said, I'll open a follow-up report to bump up the required version of List::MoreUtils in the cpanfile. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39635 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39635 [Bug 39635] Update List::MoreUtils version in cpanfile -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | --- Comment #64 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Looks like we followed-up on all lose ends here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |fridolin.somers@biblibre.co | |m --- Comment #65 from Fridolin Somers <fridolin.somers@biblibre.com> --- Enhancement not pushed to 24.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41145 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41145 [Bug 41145] Logging patron attributes logs even if there's no changes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41244 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41244 [Bug 41244] Logging patron attributes logs two entries everytime a new patron account (with extended attribute values) is created -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26744 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41262 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41262 [Bug 41262] Duplicate import in Koha::Patron -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org