On the interface, if "Hold policy" is "Not set", the rule does not exist
in the table. We should reflect that during the update DB process.
Test plan:
1. Set "Hold policy" to "Not set"
2. Confirm that you can place holds
3. Confirm that the rule does not exist in the DB table
4. Set the value to an empty string (manually)
5. Confirm that you cannot longer place holds
6. Go to the circulation rules page and confirm that the value of "Hold
policy" is "Not set"
7. Execute the update DB entry
8. Confirm that you can place holds
9. Confirm that the rule does not exist in the DB table
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
--- /dev/null
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+ $dbh->do("
+ DELETE FROM circulation_rules WHERE rule_name='holdallowed' AND rule_value='';
+ ");
+ NewVersion( $DBversion, 25851, "Remove holdallowed rule if value is an empty string");
+}
FROM issuingrules
");
}
+ $dbh->do("
+ DELETE FROM circulation_rules WHERE rule_name='holdallowed' AND rule_value='';
+ ");
$dbh->do("DROP TABLE issuingrules");
}