[Bug 42914] New: Default restriction is sometime hardcoded to MANUAL
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42914 Bug ID: 42914 Summary: Default restriction is sometime hardcoded to MANUAL Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: baptiste.wojtkowski@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- Steps to reproduce : 1 - Set the syspref PatronRestrictionTypes to allow 2 - In Adminitration -> PatronRestrictionType, create a new restriction type, make it default 3 - Delete the 'MANUAL' restriction 4 - Go to Tools -> Batch Patron Modifications and add a cardnumber (on ktd 42) 5 - Add a restriction expiration date 6 - Watch Koha burning -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42914 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |23681 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23681 [Bug 23681] Make patron restrictions user definable -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42914 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42914 --- Comment #1 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Created attachment 201058 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201058&action=edit Bug 42914: Remove hardcoded references to 'MANUAL' restriction code. Since Bug 23681, and in particular commit 3b1c271f78bb339800fac3f4c2b11ce4900f8e6a, 'MANUAL' is not a system restriction_type that can be deleted and therefore should not be mentionned in the code. In the code it is used as a fallback systempreference, which should be the role of the one flagged is_default rather than 'MANUAL' Steps to reproduce : Do NOT apply patch until 8- 1 - Set the syspref PatronRestrictionTypes to allow 2 - In Adminitration -> PatronRestrictionType, create a new restriction type, make it default 3 - Delete the 'MANUAL' restriction 4 - Go to Tools -> Batch Patron Modifications and add a cardnumber (on ktd 42) 5 - Add a restriction expiration date 6 - Watch Koha burning 7 - Run tests t/db_dependent/Circulation.t t/db_dependent/Members.t t/db_dependent/Patron/Borrower_Debarments.t, see they are broken by the suppression of 'MANUAL' 8 - Apply patch 9 - Run the tests again 10 - Repeat 4-6 11 - Go to Henry Acevedo's page and open the edit form, add a restriction through the form -> it works ! -- 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=42914 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Failed QA --- Comment #2 from David Nind <david@davidnind.com> --- Tests fail when changes in steps 2-3 are left in place. If everything is reset back to the default for KTD (reset_all), the test pass (with PatronRestrictionTypes set to both allow and don't allow). Everything else works as per the test plan. prove t/db_dependent/Circulation.t t/db_dependent/Members.t t/db_dependent/Patron/Borrower_Debarments.t t/db_dependent/Circulation.t ................. 30/87 # Transfer limit: Holding -> Return # Transfer limit: Return -> Home # Transfer limit: Return -> Holding t/db_dependent/Circulation.t ................. ok t/db_dependent/Members.t ..................... ok t/db_dependent/Patron/Borrower_Debarments.t .. 35/40 # Failed test '->restrictions returns 1 restriction after paying half of the fee' # at t/db_dependent/Patron/Borrower_Debarments.t line 331. # got: '2' # expected: '1' # Failed test 'Restriction left has type value 'TEST2'' # at t/db_dependent/Patron/Borrower_Debarments.t line 332. # got: 'TEST' # expected: 'TEST2' # Failed test '->restrictions returns 0 restrictions after paying all fees' # at t/db_dependent/Patron/Borrower_Debarments.t line 336. # got: '1' # expected: '0' # Failed test 'no warnings' # at /usr/share/perl/5.40/Test/Builder.pm line 193. # There were 1 warning(s) # Previous test 34 'Koha::Patron->merge_with() transfers well debarredcomment' # Violation of unique constraint in RestrictionType at /kohadevbox/koha/t/lib/TestBuilder.pm line 365. # at /kohadevbox/koha/t/lib/TestBuilder.pm line 365. # t::lib::TestBuilder::_buildColumnValues(t::lib::TestBuilder=HASH(0x5e61c79cb798), HASH(0x5e61d0cf7618)) called at /kohadevbox/koha/t/lib/TestBuilder.pm line 121 # t::lib::TestBuilder::build(t::lib::TestBuilder=HASH(0x5e61c79cb798), HASH(0x5e61d0d1b7b8)) called at t/db_dependent/Patron/Borrower_Debarments.t line 267 # # Looks like you failed 4 tests of 40. t/db_dependent/Patron/Borrower_Debarments.t .. Dubious, test returned 4 (wstat 1024, 0x400) Failed 4/40 subtests Test Summary Report ------------------- t/db_dependent/Patron/Borrower_Debarments.t (Wstat: 1024 (exited 4) Tests: 40 Failed: 4) Failed tests: 36-38, 40 Non-zero exit status: 4 Files=3, Tests=180, 56 wallclock secs ( 0.14 usr 0.01 sys + 39.62 cusr 10.53 csys = 50.30 CPU) Result: FAIL -- 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=42914 --- Comment #3 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- (In reply to David Nind from comment #2)
Tests fail when changes in steps 2-3 are left in place.
To be sure, you mention step 9 there ? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42914 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |baptiste.wojtkowski@biblibr |ity.org |e.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=42914 --- Comment #4 from David Nind <david@davidnind.com> --- (In reply to Baptiste Wojtkowski (bwoj) from comment #3)
(In reply to David Nind from comment #2)
Tests fail when changes in steps 2-3 are left in place.
To be sure, you mention step 9 there ?
I ran through the test plan again. To confirm, the tests fail for me for step 9 of the test plan: prove t/db_dependent/Circulation.t t/db_dependent/Members.t t/db_dependent/Patron/Borrower_Debarments.t t/db_dependent/Circulation.t ................. 31/87 # Transfer limit: Holding -> Return # Transfer limit: Return -> Home # Transfer limit: Return -> Holding t/db_dependent/Circulation.t ................. ok t/db_dependent/Members.t ..................... ok t/db_dependent/Patron/Borrower_Debarments.t .. 1/40 # Failed test '->restrictions returns 1 restriction after paying half of the fee' # at t/db_dependent/Patron/Borrower_Debarments.t line 331. # got: '2' # expected: '1' # Failed test 'Restriction left has type value 'TEST2'' # at t/db_dependent/Patron/Borrower_Debarments.t line 332. # got: 'TEST' # expected: 'TEST2' # Failed test '->restrictions returns 0 restrictions after paying all fees' # at t/db_dependent/Patron/Borrower_Debarments.t line 336. # got: '1' # expected: '0' # Failed test 'no warnings' # at /usr/share/perl/5.40/Test/Builder.pm line 193. # There were 1 warning(s) # Previous test 34 'Koha::Patron->merge_with() transfers well debarredcomment' # Violation of unique constraint in RestrictionType at /kohadevbox/koha/t/lib/TestBuilder.pm line 365. # at /kohadevbox/koha/t/lib/TestBuilder.pm line 365. # t::lib::TestBuilder::_buildColumnValues(t::lib::TestBuilder=HASH(0x56f133bb18d0), HASH(0x56f13fbca188)) called at /kohadevbox/koha/t/lib/TestBuilder.pm line 121 # t::lib::TestBuilder::build(t::lib::TestBuilder=HASH(0x56f133bb18d0), HASH(0x56f13fbc78c8)) called at t/db_dependent/Patron/Borrower_Debarments.t line 267 # # Looks like you failed 4 tests of 40. t/db_dependent/Patron/Borrower_Debarments.t .. Dubious, test returned 4 (wstat 1024, 0x400) Failed 4/40 subtests Test Summary Report ------------------- t/db_dependent/Patron/Borrower_Debarments.t (Wstat: 1024 (exited 4) Tests: 40 Failed: 4) Failed tests: 36-38, 40 Non-zero exit status: 4 Files=3, Tests=180, 59 wallclock secs ( 0.13 usr 0.02 sys + 43.58 cusr 9.92 csys = 53.65 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42914 --- Comment #5 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- I can't reproduce on a fresh ktd =/ Don't you have the issue before removing the MANUAL entry ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42914 --- Comment #6 from David Nind <david@davidnind.com> --- (In reply to Baptiste Wojtkowski (bwoj) from comment #5)
I can't reproduce on a fresh ktd =/ Don't you have the issue before removing the MANUAL entry ?
I ran through all the possible options I could think of when running the tests using KTD: 1. PatronRestrictionTypes system preference value left as "Don't allow" (the default for KTD). 2. Before the patch: - prove t/db_dependent/Circulation.t t/db_dependent/Members.t t/db_dependent/Patron/Borrower_Debarments.t ==> Tests PASS 3. After the patch, no change to restrictions: ==> Tests PASS 4. After the patch, new authorized value added (named TEST), MANUAL authorized value left in place and left as the default: ==> Tests FAIL 5. After the patch, new authorized value (TEST) made the default, MANUAL authorized value left in place: ==> Tests FAIL 6. After the patch, new authorized value (TEST) left as the default, MANUAL authorized value deleted: ==> Tests FAIL 7. Set the PatronRestrictionTypes system preference set to "Allow". 8. Repeat steps 2 to 6: - Step 2: Tests PASS - Step 3: Tests PASS - Step 4: Tests FAIL - Step 5: Tests FAIL - Step 6: Tests FAIL The test failure is the same in call cases where they fail: ... Test Summary Report ------------------- t/db_dependent/Patron/Borrower_Debarments.t (Wstat: 1024 (exited 4) Tests: 40 Failed: 4) Failed tests: 36-38, 40 Non-zero exit status: 4 Files=3, Tests=180, 53 wallclock secs ( 0.13 usr 0.01 sys + 38.04 cusr 10.45 csys = 48.63 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org