[Bug 19451] New: Let borrowers-force-messaging-defaults.pl optionally add preferences only when not already present
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Bug ID: 19451 Summary: Let borrowers-force-messaging-defaults.pl optionally add preferences only when not already present Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz A welcome addition to borrowers-force-messaging-defaults.pl would be to allow adding the messaging defaults only to patrons without such preferences. This will be made possible with the empty_only option. It copies the prefs only when the borrower prefs are empty (read: are not present). -- 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=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13572 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13572 [Bug 13572] Add actives parameter to force_borrower_messaging_defaults script -- 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=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18197 -- 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=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.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=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Renaming empty_only to no_overwrite which might be better understood. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 67989 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67989&action=edit Bug 19451: Add no_overwrite option to borrowers-force-messaging-defaults.pl This option allows you to add preferences only when they are not yet present. In other words: skip patrons that already set their prefs. Test plan: [1] Delete all borrower messaging prefs for a patron. [2] Run borrowers-force-messaging-defaults.pl -no_overwrite -doit Verify that the patron now has default msg preferences. [3] Change his settings and make them non-default. For instance, increase days in advance. [4] Run borrowers-force-messaging-defaults.pl -no_overwrite -doit Verify that the patron still has the non-default settings. [5] Run borrowers-force-messaging-defaults.pl -doit Verify that the patron msg prefs have been overwritten. 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=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |19452 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19452 [Bug 19452] working title -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |19472 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19472 [Bug 19472] Add perl extension to borrowers-force-messaging-defaults -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|13572 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13572 [Bug 13572] Add actives parameter to force_borrower_messaging_defaults script -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67989|0 |1 is obsolete| | --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 68200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68200&action=edit Bug 19451: Add no_overwrite option to borrowers-force-messaging-defaults.pl This option allows you to add preferences only when they are not yet present. In other words: skip patrons that already set their prefs. Test plan: [1] Delete all borrower messaging prefs for a patron. [2] Run borrowers-force-messaging-defaults.pl -no_overwrite -doit Verify that the patron now has default msg preferences. [3] Change his settings and make them non-default. For instance, increase days in advance. [4] Run borrowers-force-messaging-defaults.pl -no_overwrite -doit Verify that the patron still has the non-default settings. [5] Run borrowers-force-messaging-defaults.pl -doit Verify that the patron msg prefs have been overwritten. 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=19451 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Rebased -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Owen Leonard <oleonard@myacpl.org> 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=19451 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68200|0 |1 is obsolete| | --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 68844 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68844&action=edit Bug 19451: Add no_overwrite option to borrowers-force-messaging-defaults.pl This option allows you to add preferences only when they are not yet present. In other words: skip patrons that already set their prefs. Test plan: [1] Delete all borrower messaging prefs for a patron. [2] Run borrowers-force-messaging-defaults.pl -no_overwrite -doit Verify that the patron now has default msg preferences. [3] Change his settings and make them non-default. For instance, increase days in advance. [4] Run borrowers-force-messaging-defaults.pl -no_overwrite -doit Verify that the patron still has the non-default settings. [5] Run borrowers-force-messaging-defaults.pl -doit Verify that the patron msg prefs have been overwritten. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Josef Moravec <josef.moravec@gmail.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=19451 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68844|0 |1 is obsolete| | --- Comment #6 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 71327 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71327&action=edit Bug 19451: Add no_overwrite option to borrowers-force-messaging-defaults.pl This option allows you to add preferences only when they are not yet present. In other words: skip patrons that already set their prefs. Test plan: [1] Delete all borrower messaging prefs for a patron. [2] Run borrowers-force-messaging-defaults.pl -no-overwrite -doit Verify that the patron now has default msg preferences. [3] Change his settings and make them non-default. For instance, increase days in advance. [4] Run borrowers-force-messaging-defaults.pl -no-overwrite -doit Verify that the patron still has the non-default settings. [5] Run borrowers-force-messaging-defaults.pl -doit Verify that the patron msg prefs have been overwritten. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 --- Comment #7 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 71328 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71328&action=edit Bug 19451: (QA follow-up) Change parameter name no_overwrite to no-overwrite for consistency Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com QA Contact|testopia@bugs.koha-communit |josef.moravec@gmail.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=19451 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- + if( $no_overwrite ) { + $sql .= " AND (SELECT COUNT(*) FROM borrower_message_preferences mp WHERE mp.borrowernumber=bo.borrowernumber) = 0" + } This is weird, I think you want to add a join here instead. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 71367 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71367&action=edit Bug 19451: (QA follow-up) Replace weird subquery As requested, we add a JOIN and make the SELECT distinct. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested that no-overwrite still works as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED CC| |nick@bywatersolutions.com --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Enhancement, not backported to stable. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This report adds the release notes| |command-line option | |'no-overwrite' so that you | |can add preferences only | |when they are not yet | |present (in other words: | |skip patrons that already | |set their prefs). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19451 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org