[Bug 27069] New: Change holdallowed values from numbers to strings
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Bug ID: 27069 Summary: Change holdallowed values from numbers to strings Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Right now, the values for holdallowed are numeric, 1 = from home library, 2 = from any library, 3 = from local hold group. I think it would help developers if we replaced the numbers with those strings, so 1 => "from_home_library", 2 => "from_any_library", and 3 => "from_local_hold_group". -- 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=27069 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |tomascohen@gmail.com -- 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=27069 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=27069 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Holds rules are complex enough to get lost fairly easily. No need to ALSO remember what each integer means :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 118252 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118252&action=edit Bug 27069: Adjust tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 118253 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118253&action=edit Bug 27069: Adapt uses of holdallowed -- You are receiving this mail because: You are watching all bug changes.
INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', -1); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 1); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 2); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 3); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 0); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 4);
SELECT * FROM circulation_rules WHERE rule_name='holdallowed'; 5: Verify all the tests that dealt with this rule still pass! $ kshell k$ git diff origin/master --name-only | grep -e '\.t$' | \ xargs prove => SUCCESS: Tests pass!
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 118254 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118254&action=edit Bug 27069: Update existing rules This patch adds an atomic update file that takes care of translating existing rules. It constrains the rules to translate to those currently expected by Koha and leaves any other value out. To test: 1. Have some manually added rules: $ koha-mysql kohadev 2. Apply this patch 3. Run: $ updatedatabase => SUCCESS: It doesn't explode 4. Verify the created rules were updated correctly: 6. Verify the UI handles setting things correctly 7. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agustinmoyano@theke.io, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #118252|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 118324 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118324&action=edit Bug 27069: Adjust tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #118253|0 |1 is obsolete| | --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 118325 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118325&action=edit Bug 27069: Adapt uses of holdallowed Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', -1); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 1); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 2); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 3); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 0); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 4);
SELECT * FROM circulation_rules WHERE rule_name='holdallowed'; 5: Verify all the tests that dealt with this rule still pass! $ kshell k$ git diff origin/master --name-only | grep -e '\.t$' | \ xargs prove => SUCCESS: Tests pass!
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #118254|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 118326 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118326&action=edit Bug 27069: Update existing rules This patch adds an atomic update file that takes care of translating existing rules. It constrains the rules to translate to those currently expected by Koha and leaves any other value out. To test: 1. Have some manually added rules: $ koha-mysql kohadev 2. Apply this patch 3. Run: $ updatedatabase => SUCCESS: It doesn't explode 4. Verify the created rules were updated correctly: 6. Verify the UI handles setting things correctly 7. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice improvement, works as expected.. Signing off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Kyle M Hall <kyle@bywatersolutions.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=27069 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #118324|0 |1 is obsolete| | Attachment #118325|0 |1 is obsolete| | Attachment #118326|0 |1 is obsolete| | --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 119223 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119223&action=edit Bug 27069: Adjust tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 119224 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119224&action=edit Bug 27069: Adapt uses of holdallowed Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', -1); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 1); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 2); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 3); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 0); INSERT INTO circulation_rules (rule_name,rule_value) VALUES ('holdallowed', 4);
SELECT * FROM circulation_rules WHERE rule_name='holdallowed'; 5: Verify all the tests that dealt with this rule still pass! $ kshell k$ git diff origin/master --name-only | grep -e '\.t$' | \ xargs prove => SUCCESS: Tests pass!
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 119225 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119225&action=edit Bug 27069: Update existing rules This patch adds an atomic update file that takes care of translating existing rules. It constrains the rules to translate to those currently expected by Koha and leaves any other value out. To test: 1. Have some manually added rules: $ koha-mysql kohadev 2. Apply this patch 3. Run: $ updatedatabase => SUCCESS: It doesn't explode 4. Verify the created rules were updated correctly: 6. Verify the UI handles setting things correctly 7. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.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=27069 --- Comment #13 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 119454 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119454&action=edit Bug 27069: (follow-up) Only display rules if one is set Testing that the rule is != 'hold_allowed' is true for each itemtype where the rule is not set. This means it appears that no holds are allowed for any item type if no rules are set To test: 1 - With a fresh testing DB or no holdallowed rule set, you can use SQl below to clear: DELETE from circuation_rules WHERE rule_name='holdallowed'; 2 - Load smart-rules.pl (Administration->Circulation and fines rules) 3 - Scroll to "Default holds policy by item type" 4 - Note all item types appear as 'No holds allowed' 5 - Apply patch 6 - Reload 7 - All clear 8 - Confirm adding rules displays correctly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Keywords|additional_work_needed | --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Follow-up pushed to master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Andrew Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28169 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28169 [Bug 28169] Text value of holdallowed rendered without quotes in JS -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27069 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- Enhancement not pushed to 20.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org