Bugzilla – Attachment 170150 Details for
Bug 34346
Adding duplicate tag to a framework should give user readable message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34346: Tidy
Bug-34346-Tidy.patch (text/plain), 2.83 KB, created by
David Cook
on 2024-08-08 01:32:25 UTC
(
hide
)
Description:
Bug 34346: Tidy
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-08-08 01:32:25 UTC
Size:
2.83 KB
patch
obsolete
>From b3ae62f8a2408d79cbb48cd477346ca70b855c40 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 8 Aug 2024 01:25:27 +0000 >Subject: [PATCH] Bug 34346: Tidy > >--- > admin/marctagstructure.pl | 36 ++++++++++++++++++------------------ > 1 file changed, 18 insertions(+), 18 deletions(-) > >diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl >index 45b55e9589..1e89615e0d 100755 >--- a/admin/marctagstructure.pl >+++ b/admin/marctagstructure.pl >@@ -139,36 +139,36 @@ if ($op eq 'add_form') { > ); > } else { > my $schema = Koha::Database->new()->schema(); >- my $rs = $schema->resultset('MarcTagStructure'); >- my $field = $rs->find({ tagfield => $tagfield, frameworkcode => $frameworkcode }); >- if (!$field){ >+ my $rs = $schema->resultset('MarcTagStructure'); >+ my $field = $rs->find( { tagfield => $tagfield, frameworkcode => $frameworkcode } ); >+ if ( !$field ) { > $sth = $dbh->prepare( >- "INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,important,authorised_value,ind1_defaultvalue,ind2_defaultvalue,frameworkcode) values (?,?,?,?,?,?,?,?,?,?)" >+ "INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,important,authorised_value,ind1_defaultvalue,ind2_defaultvalue,frameworkcode) values (?,?,?,?,?,?,?,?,?,?)" > ); >- $sth->execute($tagfield, >- $liblibrarian, >- $libopac, >- $repeatable, >- $mandatory, >- $important, >- $authorised_value, >- $ind1_defaultvalue, >- $ind2_defaultvalue, >- $frameworkcode >+ $sth->execute( >+ $tagfield, >+ $liblibrarian, >+ $libopac, >+ $repeatable, >+ $mandatory, >+ $important, >+ $authorised_value, >+ $ind1_defaultvalue, >+ $ind2_defaultvalue, >+ $frameworkcode > ); >- } >- else { >+ } else { > $error = 'duplicate_tagfield'; > } > } >- if (!$error){ >+ if ( !$error ) { > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); > $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); > $cache->clear_from_cache("MarcCodedFields-$frameworkcode"); > } > my $redirect_url = "/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode"; >- if ($error){ >+ if ($error) { > $redirect_url .= "&error=$error"; > } > print $input->redirect($redirect_url); >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34346
:
170149
|
170150
|
170181
|
170182
|
170429