Bug 35973

Summary: System preference RedirectGuaranteeEmail has incorrect values
Product: Koha Reporter: Kelly McElligott <kelly>
Component: System AdministrationAssignee: Katrin Fischer <katrin.fischer>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06
Circulation function:
Bug Depends on: 12532    
Bug Blocks:    
Attachments: Bug 35973: Correct wrong values for RedirectGuaranteeEmail system preference
Bug 35973: Correct wrong values for RedirectGuaranteeEmail system preference
Bug 35973: Correct wrong values for RedirectGuaranteeEmail system preference
Bug 35973: (QA follow-up) Ad exec flag to update

Description Kelly McElligott 2024-02-01 13:35:42 UTC
With the introduction to bug 12532, Copy guarantee email to the guarantor (or redirect if guarantee has no email set), a new system preference has been included in Koha, EnableRedirectGuaranteeEmail.  Unfortunately, although the system preference choices on the interface say Enable/Don't Enable, the code has a Yes/No value. 


koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref

This will need to be fixed to align with Koha is looking for to turn on this sys pref.
Comment 1 Katrin Fischer 2024-03-17 16:50:47 UTC
Created attachment 163289 [details] [review]
Bug 35973: Correct wrong values for RedirectGuaranteeEmail system preference

The system preferences was added with 0/1 in sysprefs.sql is checked
as boolean. But the .pref file was added with yes/no which both
evaluate as strings to true.

This fixes the .pref file and includes a database update that sets
0 and 1 correctly for the value currently chosen in the pref.

To test:
* Make sure to update RedirectGuaranteeEmail to Enable/Don't enable
  before applying the patch
* Verify in the database, that the values was set to yes or no
  You can use a report like:
    SELECT * from systempreferences WHERE variable = "RedirectGuaranteeEmail";
* Apply patch and run database update
* Verify the value in the database was corrected:
  Yes = 1, No = 0
* Change the setting, verify the new value is stored correctly
Comment 2 David Nind 2024-03-22 17:28:13 UTC
Created attachment 163725 [details] [review]
Bug 35973: Correct wrong values for RedirectGuaranteeEmail system preference

The system preferences was added with 0/1 in sysprefs.sql is checked
as boolean. But the .pref file was added with yes/no which both
evaluate as strings to true.

This fixes the .pref file and includes a database update that sets
0 and 1 correctly for the value currently chosen in the pref.

To test:
* Make sure to update RedirectGuaranteeEmail to Enable/Don't enable
  before applying the patch
* Verify in the database, that the values was set to yes or no
  You can use a report like:
    SELECT * from systempreferences WHERE variable = "RedirectGuaranteeEmail";
* Apply patch and run database update
* Verify the value in the database was corrected:
  Yes = 1, No = 0
* Change the setting, verify the new value is stored correctly

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Nick Clemens (kidclamp) 2024-04-19 13:31:06 UTC
Created attachment 165173 [details] [review]
Bug 35973: Correct wrong values for RedirectGuaranteeEmail system preference

The system preferences was added with 0/1 in sysprefs.sql is checked
as boolean. But the .pref file was added with yes/no which both
evaluate as strings to true.

This fixes the .pref file and includes a database update that sets
0 and 1 correctly for the value currently chosen in the pref.

To test:
* Make sure to update RedirectGuaranteeEmail to Enable/Don't enable
  before applying the patch
* Verify in the database, that the values was set to yes or no
  You can use a report like:
    SELECT * from systempreferences WHERE variable = "RedirectGuaranteeEmail";
* Apply patch and run database update
* Verify the value in the database was corrected:
  Yes = 1, No = 0
* Change the setting, verify the new value is stored correctly

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Nick Clemens (kidclamp) 2024-04-19 13:31:08 UTC
Created attachment 165174 [details] [review]
Bug 35973: (QA follow-up) Ad exec flag to update
Comment 5 Katrin Fischer 2024-04-19 16:07:33 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 6 Fridolin Somers 2024-05-23 13:46:42 UTC
Pushed to 23.11.x for 23.11.06
Comment 7 Lucas Gass (lukeg) 2024-05-28 19:43:55 UTC
Missing 23.05.x dependencies, no backport.