This patch adds the onlyactives parameter to force_borrower_messaging_defaults script to allow to update just actives (not expired) user records if changes in the user categories are made. Sponsored by CCSR
To test: 1) Apply the patch 2) Active the preference system “EnhancedMessagingPreferences” 3) In “Administration › Patron categories” modify the default messaging preferences for a category. Ex. Student 4) Run the script 5) Validate: expired Students don't have their patron messaging preferences changed 6) Validate: active Students do have their patron messaging preferences changed
Created attachment 35164 [details] [review] Bug 13572 - Add onlyactives parameter to force_borrower_messaging_defaults script
I followed the test plan but I can't verify the patch fixes it.
Created attachment 41235 [details] [review] Bug13572 - Changed "borrowers-force-messaging-defaults" --help parameter's result to better explain the new functionality New test plan (well, a clearer version): 1) Apply both patches 2) Create a new patron with random values, except for it expiration date, make it expired (Patrons > New Patron > Student) 3) Enable the system preference called “EnhancedMessagingPreferences” 4) In “Administration" > "Patron categories" > Student, modify the "days in advance", then click "Save" 5) run the script "./misc/maintenance/borrowers-force-messaging-defaults --doit --onlyactives" 6) Validate that the student created in step 2 hasn't changed (Patrons > search) 7) Validate that any other student that isn't expired has changed.
Created attachment 46179 [details] [review] Bug 13572 - Add onlyactives parameter to force_borrower_messaging_defaults script 1) Apply both patches 2) Create a new patron with random values, except for it expiration date, make it expired (Patrons > New Patron > Student) 3) Enable the system preference called “EnhancedMessagingPreferences” 4) In “Administration" > "Patron categories" > Student, modify the "days in advance", then click "Save" 5) run the script "./misc/maintenance/borrowers-force-messaging-defaults --doit --onlyactives" 6) Validate that the student created in step 2 hasn't changed (Patrons > search) 7) Validate that any other student that isn't expired has changed. Signed-off-by: Chris <chris@bigballofwax.co.nz>
Created attachment 46180 [details] [review] Bug13572 - Changed "borrowers-force-messaging-defaults" --help parameter's result to better explain the new functionality New test plan (well, a clearer version): 1) Apply both patches 2) Create a new patron with random values, except for it expiration date, make it expired (Patrons > New Patron > Student) 3) Enable the system preference called “EnhancedMessagingPreferences” 4) In “Administration" > "Patron categories" > Student, modify the "days in advance", then click "Save" 5) run the script "./misc/maintenance/borrowers-force-messaging-defaults --doit --onlyactives" 6) Validate that the student created in step 2 hasn't changed (Patrons > search) 7) Validate that any other student that isn't expired has changed. Signed-off-by: Chris <chris@bigballofwax.co.nz>
It would make more sense to have a --active[s] instead of --onlyactives, it will allow to add another flag later.
Created attachment 58206 [details] [review] Bug 13572 - Add --actives parameter to force_borrower_messaging_defaults script 1) Apply the patch 2) Create a new patron with random values, except for it expiration date, make it expired (Patrons > New Patron > Student) 3) Enable the system preference called “EnhancedMessagingPreferences” 4) In “Administration" > "Patron categories" > Student, modify the "days in advance", then click "Save" 5) run the script "./misc/maintenance/borrowers-force-messaging-defaults --doit --actives" 6) Validate that the student created in step 2 hasn't changed (Patrons > search) 7) Validate that any other student that isn't expired has changed. --- This patch is a squashed version of the two previous ones, rebased on the current master, plus the changes asked in comment #7
Created attachment 67959 [details] [review] Bug 13572 - Add --actives parameter to force_borrower_messaging_defaults script 1) Apply the patch 2) Create a new patron with random values, except for it expiration date, make it expired (Patrons > New Patron > Student) 3) Enable the system preference called “EnhancedMessagingPreferences” 4) In “Administration" > "Patron categories" > Student, modify the "days in advance", then click "Save" 5) run the script "./misc/maintenance/borrowers-force-messaging-defaults --doit --actives" 6) Validate that the student created in step 2 hasn't changed (Patrons > search) 7) Validate that any other student that isn't expired has changed. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 67960 [details] [review] Bug 13572: (Follow-up) Add perl extension to script There is no reason to keep this perl script without the regular extension. Please see other scripts in the same folder too. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 67961 [details] [review] Bug 13572: (Follow-up) Print since on a separate line Very trivial change. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 68059 [details] [review] Bug 13572 - Add --actives parameter to force_borrower_messaging_defaults script 1) Apply the patch 2) Create a new patron with random values, except for it expiration date, make it expired (Patrons > New Patron > Student) 3) Enable the system preference called “EnhancedMessagingPreferences” 4) In “Administration" > "Patron categories" > Student, modify the "days in advance", then click "Save" 5) run the script "./misc/maintenance/borrowers-force-messaging-defaults --doit --actives" 6) Validate that the student created in step 2 hasn't changed (Patrons > search) 7) Validate that any other student that isn't expired has changed. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 68060 [details] [review] Bug 13572: (Follow-up) Add perl extension to script There is no reason to keep this perl script without the regular extension. Please see other scripts in the same folder too. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 68061 [details] [review] Bug 13572: (Follow-up) Print since on a separate line Very trivial change. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment on attachment 68060 [details] [review] Bug 13572: (Follow-up) Add perl extension to script Please do that on its own bug report (can break scripts if not highlight in the release notes).
Just asking: maybe --not-expired is more meaningful here? I do not think we already use "active" on the interface or scripts.
(In reply to Jonathan Druart from comment #16) > Just asking: maybe --not-expired is more meaningful here? > I do not think we already use "active" on the interface or scripts. No objection
No objection
Created attachment 68183 [details] [review] Bug 13572: Patrons are still active if their expiry date is today
Pushed to master for 17.11, thanks to everybody involved!