[Bug 34589] New: Update on bug 20256 is not idempotent
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34589 Bug ID: 34589 Summary: Update on bug 20256 is not idempotent Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org The last commit attempted to make the update idempotent, however, it missed a case. If the update is run, then a patron has the permission removed, they will get it again on a subsequent update. We should check if the permission exists in the permissions table, and only perform the first two updates if it does not -- 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=34589 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=34589 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 154702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154702&action=edit Bug 34589: Only update users if permission is added -- 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=34589 AspenCat Team <aspencatteam@clicweb.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aspencatteam@clicweb.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34589 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20256 CC| |kyle@bywatersolutions.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20256 [Bug 20256] Add ability to limit editing of items to home library or library group -- 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=34589 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au Status|Needs Signoff |Failed QA --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Can we get a test plan for this one? -- 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=34589 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- 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=34589 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154702|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 155271 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155271&action=edit Bug 34589: Only update users if permission is added To test: 1 - Assign a user 'edit_items' permission 2 - Manually run the update perl -e 'use C4::Installer; warn Data::Dumper::Dumper(C4::Installer::run_db_rev("installer/data/mysql/db_revs/221200003.pl"));' 3 - Edit patron permissions 4 - Note they now have edit_any_item permission 5 - Remove that permission 6 - Run the update again 7 - Edit patron permissions 8 - They have edit_any_item again - remove it 9 - Apply patch 10 - Run the update 11 - Edit patron permissions 12 - No new permissions added! 13 - sudo koha-mysql kohadev DELETE FROM permissions WHERE code = 'edit_any_item' 14 - Run the update again 15 - Edit patron permissions 16 - They do have edit_any_item -- 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=34589 emily-rose.francoeur@inLibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=34589 emily-rose.francoeur@inLibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155271|0 |1 is obsolete| | --- Comment #4 from emily-rose.francoeur@inLibro.com --- Created attachment 155501 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155501&action=edit Bug 34589: Only update users if permission is added To test: 1 - Assign a user 'edit_items' permission 2 - Manually run the update perl -e 'use C4::Installer; warn Data::Dumper::Dumper(C4::Installer::run_db_rev("installer/data/mysql/db_revs/221200003.pl"));' 3 - Edit patron permissions 4 - Note they now have edit_any_item permission 5 - Remove that permission 6 - Run the update again 7 - Edit patron permissions 8 - They have edit_any_item again - remove it 9 - Apply patch 10 - Run the update 11 - Edit patron permissions 12 - No new permissions added! 13 - sudo koha-mysql kohadev DELETE FROM permissions WHERE code = 'edit_any_item' 14 - Run the update again 15 - Edit patron permissions 16 - They do have edit_any_item Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com> -- 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=34589 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- I wont object to this patch, but I think it is arguable. Insert in permissions, insert in userpermissions. Repeat does it again. Feels quite idempotent imo. -- 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=34589 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- 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=34589 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- And another note: DBI::do does not promise a good return: Returns the number of rows affected or undef on error. A return value of -1 means the number of rows is not known, not applicable, or not available. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34589 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA 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=34589 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155501|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 155634 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155634&action=edit Bug 34589: Only update users if permission is added To test: 1 - Assign a user 'edit_items' permission 2 - Manually run the update perl -e 'use C4::Installer; warn Data::Dumper::Dumper(C4::Installer::run_db_rev("installer/data/mysql/db_revs/221200003.pl"));' 3 - Edit patron permissions 4 - Note they now have edit_any_item permission 5 - Remove that permission 6 - Run the update again 7 - Edit patron permissions 8 - They have edit_any_item again - remove it 9 - Apply patch 10 - Run the update 11 - Edit patron permissions 12 - No new permissions added! 13 - sudo koha-mysql kohadev DELETE FROM permissions WHERE code = 'edit_any_item' 14 - Run the update again 15 - Edit patron permissions 16 - They do have edit_any_item Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34589 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.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=34589 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34589 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|23.11.00 |23.11.00,23.05.04 released in| | --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34589 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |matt.blenkinsop@ptfs-europe | |.com Status|Pushed to stable |RESOLVED --- Comment #10 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Bug 202356 is not in 22.11.x, not backporting -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org