]> git.koha-community.org Git - koha.git/commit
Bug 28217: Prevent several non-repeatable attributes to be merged
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 23 Apr 2021 13:37:46 +0000 (15:37 +0200)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Tue, 25 May 2021 11:47:34 +0000 (11:47 +0000)
commitf55f5803da84a34315b6e3b89494bc18f7c1d6b1
tree39ff3ad180d6419ce560b1519b114540c7819004
parent0c58835ed6f9fc7354aaad121a7f20ca03c5bd01
Bug 28217: Prevent several non-repeatable attributes to be merged

When using the patron merge feature it's possible to generate a patron
with several non-repeatable attributes.

This patch prevents that.

Test plan:
Create 2 patron attribute types, one repeatable and one non-repeatable
Create 2 patrons and add them repeatable attributes
Add a non-repeatable attribute to one of them
Merge the 2 patrons
=> It succeeds, the resulting patron has all the repeatable attribute
and the non-repeatable one.

Do it again but this time add non-repeatable to both patrons
Merge them
=> It fails, you should see an error on the UI
  Merge failed! The following error was reported: Tried to add more than one non-repeatable attributes. type=TYPE value=VALUE.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 92db5e22474bec148cf4346300bc246bedbc6a7c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0216a66aca3eb2a9a47a4c5b4a6ea0c2cb98c322)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Koha/Patron.pm
t/db_dependent/Koha/Patrons.t