[Bug 35263] New: Cannot update patron categories
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Bug ID: 35263 Summary: Cannot update patron categories Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: blocker Priority: P5 - low Component: System Administration Assignee: pedro.amorim@ptfs-europe.com Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Depends on: 18203 Updating patron categories in the administration module is broken. The error in the logs is: ==> /var/log/koha/kohadev/plack-intranet-error.log <== [2023/11/05 12:21:09] [WARN] DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'can_place_ill_in_opac' cannot be null at /kohadevbox/koha/Koha/Object.pm line 170 ILL is not configured. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18203 [Bug 18203] Add per borrower category restrictions on placing ILL requests in OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 --- Comment #1 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 158495 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158495&action=edit Bug 35263: Add selenium tests Test plan, on k-t-d selenium (ktd --selenium up): 1) Apply just this tests patch 2) Run: prove t/db_dependent/selenium/administration_tasks.t 3) Notice it fails. Apply the other patch. Restart plack 4) Repeat step 2. Notice it passes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 --- Comment #2 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 158496 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158496&action=edit Bug 35263: Default 'can_place_ill_in_opac' to 1 If ILLModule sys pref is 'off', this input param is undef. The database does not allow it to be nullable causing an error. Check if its defined (i.e. the option was submitted) and use that, if not default to 1 Test plan, k-t-d: 1) Edit an existing patron category, visit: /cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=B 2) Click 'Save' at the bottom of the form 3) Notice a yellow box is shown with an error message 4) Apply patch. Repeat steps 1-3. Notice it now updates successfully. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158495|0 |1 is obsolete| | --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 158543 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158543&action=edit Bug 35263: Add selenium tests Test plan, on k-t-d selenium (ktd --selenium up): 1) Apply just this tests patch 2) Run: prove t/db_dependent/selenium/administration_tasks.t 3) Notice it fails. Apply the other patch. Restart plack 4) Repeat step 2. Notice it passes. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158496|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 158544 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158544&action=edit Bug 35263: Default 'can_place_ill_in_opac' to 1 If ILLModule sys pref is 'off', this input param is undef. The database does not allow it to be nullable causing an error. Check if its defined (i.e. the option was submitted) and use that, if not default to 1 Test plan, k-t-d: 1) Edit an existing patron category, visit: /cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=B 2) Click 'Save' at the bottom of the form 3) Notice a yellow box is shown with an error message 4) Apply patch. Repeat steps 1-3. Notice it now updates successfully. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #5 from David Nind <david@davidnind.com> --- I was going to add my sign-off, so Katrin's could count as QA. However, the tests fail for me after the patch is applied - are there other system preferences that need enabling/disabling (tested using KTD)?: kohadev-koha@kohadevbox:koha(bz35263)$ prove t/db_dependent/selenium/administration_tasks.t t/db_dependent/selenium/administration_tasks.t .. Selenium server did not return proper status at /usr/share/perl5/Selenium/Remote/Driver.pm line 552. # Looks like your test exited with 22 before it could output anything. t/db_dependent/selenium/administration_tasks.t .. Dubious, test returned 22 (wstat 5632, 0x1600) Failed 3/3 subtests Test Summary Report ------------------- t/db_dependent/selenium/administration_tasks.t (Wstat: 5632 Tests: 0 Failed: 0) Non-zero exit status: 22 Parse errors: Bad plan. You planned 3 tests but ran 0. Files=1, Tests=0, 1 wallclock secs ( 0.00 usr 0.01 sys + 0.82 cusr 0.14 csys = 0.97 CPU) Result: FAIL I get the same result whether ILLModule is enabled or not. The patches do fix the error when editing a patron category though... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, I just double checked, tests are passing nicely on a new database for me: OK admin/categories.pl OK t/db_dependent/selenium/administration_tasks.t Processing additional checks OK! Running tests (1) * Proving /kohadevbox/koha/t/db_dependent/selenium/administration_tasks.t OK! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- kohadev-koha@kohadevbox:koha(71-35263-update-atron-category)$ prove t/db_dependent/selenium/administration_tasks.t t/db_dependent/selenium/administration_tasks.t .. ok All tests successful. Files=1, Tests=3, 18 wallclock secs ( 0.01 usr 0.01 sys + 1.03 cusr 0.15 csys = 1.20 CPU) Result: PASS -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 --- Comment #8 from David Nind <david@davidnind.com> --- (In reply to David Nind from comment #5)
I was going to add my sign-off, so Katrin's could count as QA.
However, the tests fail for me after the patch is applied - are there other system preferences that need enabling/disabling (tested using KTD)?:
I didn't read the test plan properly - needed to start KTD with --selenium (ktd --selenium up). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158543|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 158566 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158566&action=edit Bug 35263: Add selenium tests Test plan, on k-t-d selenium (ktd --selenium up): 1) Apply just this tests patch 2) Run: prove t/db_dependent/selenium/administration_tasks.t 3) Notice it fails. Apply the other patch. Restart plack 4) Repeat step 2. Notice it passes. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158544|0 |1 is obsolete| | --- Comment #10 from David Nind <david@davidnind.com> --- Created attachment 158567 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158567&action=edit Bug 35263: Default 'can_place_ill_in_opac' to 1 If ILLModule sys pref is 'off', this input param is undef. The database does not allow it to be nullable causing an error. Check if its defined (i.e. the option was submitted) and use that, if not default to 1 Test plan, k-t-d: 1) Edit an existing patron category, visit: /cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=B 2) Click 'Save' at the bottom of the form 3) Notice a yellow box is shown with an error message 4) Apply patch. Repeat steps 1-3. Notice it now updates successfully. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=35263 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Will be better written this way IMO: my $can_place_ill_in_opac = defined $input->param('can_place_ill_in_opac') ? $input->param('can_place_ill_in_opac') : 1; => my $can_place_ill_in_opac = $input->param('can_place_ill_in_opac') // 1; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 --- Comment #12 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 158588 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158588&action=edit Bug 35263: QA follow-up: Update code Thank you Jonathan. I first tried with '||' but it would fallback to 1 for either undef or 0 (we want the first case, but not the second). But using '//' instead, it only falls back to 1 if undef, and not when 0. Today I learned between '||' and '//'! Thanks!
From perldoc.perl.org (relating to '//'): 'In fact, it's exactly the same as ||, except that it tests the left hand side's definedness instead of its truth.'
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Processing additional checks * Commit title does not contain 'follow-up' correctly spelt - a0b13696d3 * Commit title does not contain '(QA follow-up)' correctly spelt - a0b13696d3 Fixing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158566|0 |1 is obsolete| | Attachment #158588|0 |1 is obsolete| | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 158633 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158633&action=edit Bug 35263: Add selenium tests Test plan, on k-t-d selenium (ktd --selenium up): 1) Apply just this tests patch 2) Run: prove t/db_dependent/selenium/administration_tasks.t 3) Notice it fails. Apply the other patch. Restart plack 4) Repeat step 2. Notice it passes. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158567|0 |1 is obsolete| | --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 158634 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158634&action=edit Bug 35263: Default 'can_place_ill_in_opac' to 1 If ILLModule sys pref is 'off', this input param is undef. The database does not allow it to be nullable causing an error. Check if its defined (i.e. the option was submitted) and use that, if not default to 1 Test plan, k-t-d: 1) Edit an existing patron category, visit: /cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=B 2) Click 'Save' at the bottom of the form 3) Notice a yellow box is shown with an error message 4) Apply patch. Repeat steps 1-3. Notice it now updates successfully. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 158635 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158635&action=edit Bug 35263: (QA follow-up) Update code Thank you Jonathan. I first tried with '||' but it would fallback to 1 for either undef or 0 (we want the first case, but not the second). But using '//' instead, it only falls back to 1 if undef, and not when 0. Today I learned between '||' and '//'! Thanks!
From perldoc.perl.org (relating to '//'): 'In fact, it's exactly the same as ||, except that it tests the left hand side's definedness instead of its truth.'
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thanks a lot for the commit message, I also learned the difference today :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |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=35263 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Resolution|--- |FIXED Status|Pushed to master |RESOLVED --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 18203 not in 23.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35556 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35556 [Bug 35556] selenium/administration_tasks.t failing if too many patron categories -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35263 Bug 35263 depends on bug 18203, which changed state. Bug 18203 Summary: Add per borrower category restrictions on placing ILL requests in OPAC https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18203 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org