]> git.koha-community.org Git - koha.git/commit
Bug 28031: Avoid wrong exception on saving updated attribute
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 25 Mar 2021 12:53:13 +0000 (09:53 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 9 Apr 2021 13:43:34 +0000 (15:43 +0200)
commit9489054527badf8713d198cf08521a5b0804902d
treeaf782eb594a1f157f8a0df04e9e2fa5e27672fb5
parentf382fafae0ff29097296c83e0670f94110874331
Bug 28031: Avoid wrong exception on saving updated attribute

In the case a non-repeatable attribute for a patron is being updated
(its value) the routines that check the type is repeatable should
exclude its own id from the search for things to work.

This patch solves that.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Patron/Attribute.t
=> FAIL: Tests explode! An unexpected exception is thrown!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

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>
Koha/Patron/Attribute.pm