Bug 25567 - borrower_attribute_types.category_code must be set to undef if not set
Summary: borrower_attribute_types.category_code must be set to undef if not set
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 20443
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-21 13:29 UTC by Jonathan Druart
Modified: 2020-06-12 20:45 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.07


Attachments
Bug 25567: Prevent patron category type's categorycode to be created with "" (1.52 KB, patch)
2020-05-21 13:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25567: Fix typo categorycode vs category_code (997 bytes, patch)
2020-05-21 13:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25567: Fix typo categorycode vs category_code (1.66 KB, patch)
2020-05-21 13:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25567: Prevent patron category type's categorycode to be created with "" (1.58 KB, patch)
2020-05-21 14:31 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 25567: Fix typo categorycode vs category_code (1.72 KB, patch)
2020-05-21 14:31 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 25567: Prevent patron category type's categorycode to be created with "" (1.63 KB, patch)
2020-05-21 16:26 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25567: Fix typo categorycode vs category_code (1.77 KB, patch)
2020-05-21 16:26 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2020-05-21 13:29:50 UTC
Certainly caused by bug 20443.


The method Koha::Patron::Attribute::Type->categorycode is not covered by tests!

To recreate:
Create a new patron attribute type, don't select a patron's category (and not repeatable or unique)
Go to the batch patron modification tool, enter a cardnumber, next.
=> boom!
Comment 1 Jonathan Druart 2020-05-21 13:32:01 UTC
Created attachment 105194 [details] [review]
Bug 25567: Prevent patron category type's categorycode to be created with ""

It must be NULL/undef, the default from the DB.

The method Koha::Patron::Attribute::Type->categorycode is not covered by tests!

To recreate:
Create a new patron attribute type, don't select a patron's category (and not repeatable or unique)
Go to the batch patron modification tool, enter a cardnumber, next.
=> boom!
Apply the patch, edit the patron attribute, save
Go to the batch patron modification tool, enter a cardnumber, next.
=> success!
Comment 2 Jonathan Druart 2020-05-21 13:34:36 UTC
Wait, I overlooked something.
Comment 3 Jonathan Druart 2020-05-21 13:36:20 UTC
Created attachment 105195 [details] [review]
Bug 25567: Fix typo categorycode vs category_code

Well, this is actually the real root of the error!
Comment 4 Jonathan Druart 2020-05-21 13:38:47 UTC
Created attachment 105197 [details] [review]
Bug 25567: Fix typo categorycode vs category_code

Well, this is actually the real root of the error!
Comment 5 Victor Grousset/tuxayo 2020-05-21 14:31:19 UTC
Created attachment 105208 [details] [review]
Bug 25567: Prevent patron category type's categorycode to be created with ""

It must be NULL/undef, the default from the DB.

The method Koha::Patron::Attribute::Type->categorycode is not covered by tests!

To recreate:
Create a new patron attribute type, don't select a patron's category (and not repeatable or unique)
Go to the batch patron modification tool, enter a cardnumber, next.
=> boom!
Apply the patch, edit the patron attribute, save
Go to the batch patron modification tool, enter a cardnumber, next.
=> success!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 6 Victor Grousset/tuxayo 2020-05-21 14:31:22 UTC
Created attachment 105209 [details] [review]
Bug 25567: Fix typo categorycode vs category_code

Well, this is actually the real root of the error!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 7 Victor Grousset/tuxayo 2020-05-21 14:31:45 UTC
It works! :D
Comment 8 Nick Clemens 2020-05-21 16:26:19 UTC
Created attachment 105221 [details] [review]
Bug 25567: Prevent patron category type's categorycode to be created with ""

It must be NULL/undef, the default from the DB.

The method Koha::Patron::Attribute::Type->categorycode is not covered by tests!

To recreate:
Create a new patron attribute type, don't select a patron's category (and not repeatable or unique)
Go to the batch patron modification tool, enter a cardnumber, next.
=> boom!
Apply the patch, edit the patron attribute, save
Go to the batch patron modification tool, enter a cardnumber, next.
=> success!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Nick Clemens 2020-05-21 16:26:22 UTC
Created attachment 105222 [details] [review]
Bug 25567: Fix typo categorycode vs category_code

Well, this is actually the real root of the error!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Martin Renvoize 2020-05-22 08:34:17 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Aleisha Amohia 2020-06-11 23:46:53 UTC
backported to 19.11.x for 19.11.07
Comment 12 Victor Grousset/tuxayo 2020-06-12 20:45:33 UTC
(In reply to Jonathan Druart from comment #0)
> Certainly caused by bug 20443.

It shouldn't be necessary (missing dependency) in 19.11.x and 19.05.x then.

(In reply to Jonathan Druart from comment #3)
> Created attachment 105195 [details] [review] [review]
> Bug 25567: Fix typo categorycode vs category_code
> 
> Well, this is actually the real root of the error!

Okay maybe it impacts them also.

---

After a quick try of the test plan on 19.05.x: can't reproduce the issue

Won't backport to 19.05.x

As for 19.11.x
- v19.11.06 : can't reproduce the issue
- 19.11.x(78d930d438): no issue so the patch shouldn't be a problem.