From 89a0c62da407e5981f7bc30b12691f0a1546905d Mon Sep 17 00:00:00 2001 From: Emily Lamancusa Date: Thu, 27 Jun 2024 16:27:37 -0400 Subject: [PATCH] Bug 37216: Fix SQL for EmailFieldSelection Test plan: Part A: New installation 1. Start a fresh test instance 2. Set EmailFieldPrimary to "selected addresses", and do not touch EmailFieldSelection 3. Edit a patron to ensure the following fields are set: - Primary email - Secondary email - Alternate email - Enable email notices for item checkout 4. Attempt to check an item out to that patron --> Koha explodes! 5. Apply patch 6. reset_all 7. Repeat steps 2-4 --> Checkout succeeds! 8. Ensure test plan for bug 12802 still passes Part B: Upgraded installation 1. Start a fresh test instance at version 23.11 2. Switch to main 3. Install database update 4. Set EmailFieldPrimary to "selected addresses", and do not touch EmailFieldSelection 5. Edit a patron to ensure the following fields are set: - Primary email - Secondary email - Alternate email - Enable email notices for item checkout 6. Attempt to check an item out to that patron --> Koha explodes! 7. Go back to 23.11 and reset_all 8. Switch to main and apply patch 9. Repeat steps 4-6 --> Checkout succeeds! 10. Ensure test plan for bug 12802 still passes Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- installer/data/mysql/db_revs/231200034.pl | 2 +- installer/data/mysql/mandatory/sysprefs.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/db_revs/231200034.pl b/installer/data/mysql/db_revs/231200034.pl index 3be7681170..a0fd2eb5ae 100755 --- a/installer/data/mysql/db_revs/231200034.pl +++ b/installer/data/mysql/db_revs/231200034.pl @@ -13,7 +13,7 @@ return { say $out "Updated system preference 'EmailFieldPrimary' to include 'selected addresses' option"; $dbh->do( - "INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('EmailFieldSelection','email|emailpro|B_email','','Selection list of patron email fields to use whern AutoEmailPrimaryAddress is set to selected addresses','multiple')" + "INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('EmailFieldSelection','','email|emailpro|B_email','Selection list of patron email fields to use whern AutoEmailPrimaryAddress is set to selected addresses','multiple')" ); say $out "Added new system preference 'EmailFieldSelection'"; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 0496d3fd48..2d76cd072e 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -234,7 +234,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'), ('EmailFieldPrecedence','email|emailpro|B_email','','Ordered list of patron email fields to use when AutoEmailPrimaryAddress is set to first valid','multiple'), ('EmailFieldPrimary','OFF','email|emailpro|B_email|cardnumber|OFF|MULTI','Defines the default email address field where patron email notices are sent.','Choice'), -('EmailFieldSelection','email|emailpro|B_email','','Selection list of patron email fields to use whern AutoEmailPrimaryAddress is set to selected addresses','multiple'), +('EmailFieldSelection','','email|emailpro|B_email','Selection list of patron email fields to use whern AutoEmailPrimaryAddress is set to selected addresses','multiple'), ('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'), ('EmailOverduesNoEmail','1',NULL,'Send send overdues of patrons without email address to staff','YesNo'), ('EmailPatronRegistrations', '0', '0|EmailAddressForPatronRegistrations|BranchEmailAddress|KohaAdminEmailAddress', 'Choose email address that new patron registrations will be sent to: ', 'Choice'), -- 2.39.5