Bug 33578: Fix controller when editing a restriction type
Do not display a warning when we are editing a restriction type and no other types with this description exists. Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commitb5de15c4b8
) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> (cherry picked from commit61b9002848
) Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
This commit is contained in:
parent
8a69164c5b
commit
efe0faccdc
1 changed files with 7 additions and 4 deletions
|
@ -58,10 +58,13 @@ if ( $op eq 'add_form') {
|
|||
|
||||
if ($is_a_modif) {
|
||||
# Check whether another restriction already has this display text
|
||||
my $dupe = Koha::Patron::Restriction::Types->find({
|
||||
display_text => $display_text
|
||||
});
|
||||
if ($dupe) {
|
||||
my $dupe = Koha::Patron::Restriction::Types->search(
|
||||
{
|
||||
code => { '!=' => $code },
|
||||
display_text => $display_text,
|
||||
}
|
||||
);
|
||||
if ($dupe->count) {
|
||||
push @messages, {
|
||||
type => 'error', code => 'duplicate_display_text'
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue