Bugzilla – Attachment 92190 Details for
Bug 23309
Can't add new subfields to bibliographic frameworks in strict mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23309: Use Koha::MarcSubfieldStructures to create to subfields
Bug-23309-Use-KohaMarcSubfieldStructures-to-create.patch (text/plain), 4.35 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-08-14 14:41:50 UTC
(
hide
)
Description:
Bug 23309: Use Koha::MarcSubfieldStructures to create to subfields
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-08-14 14:41:50 UTC
Size:
4.35 KB
patch
obsolete
>From f812504816b0e7b300f04d5e126f983789e0c4e2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 7 Aug 2019 20:16:00 -0500 >Subject: [PATCH] Bug 23309: Use Koha::MarcSubfieldStructures to create to > subfields > >It will fix the insert of new subfields with SQL strict modes > >DBD::mysql::st execute failed: Incorrect integer value: '' for column >'hidden' at row 1 [for Statement " > >Test plan: >- Turn the config strict_sql_modes ON >- Add a new subfield to a field > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > admin/marc_subfields_structure.pl | 51 +++++++++++++------------------ > 1 file changed, 22 insertions(+), 29 deletions(-) > >diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl >index 25196491b1..cdefc25884 100755 >--- a/admin/marc_subfields_structure.pl >+++ b/admin/marc_subfields_structure.pl >@@ -233,14 +233,6 @@ if ( $op eq 'add_form' ) { > elsif ( $op eq 'add_validate' ) { > my $dbh = C4::Context->dbh; > $template->param( tagfield => "$input->param('tagfield')" ); >-# my $sth = $dbh->prepare( >-# "replace marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl,frameworkcode, link,defaultvalue) >-# values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" >-# ); >- my $sth_insert = $dbh->prepare(qq{ >- insert into marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl,frameworkcode, link,defaultvalue,maxlength) >- values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) >- }); > my $sth_update = $dbh->prepare(qq{ > update marc_subfield_structure set tagfield=?, tagsubfield=?, liblibrarian=?, libopac=?, repeatable=?, mandatory=?, kohafield=?, tab=?, seealso=?, authorised_value=?, authtypecode=?, value_builder=?, hidden=?, isurl=?, frameworkcode=?, link=?, defaultvalue=?, maxlength=? > where tagfield=? and tagsubfield=? and frameworkcode=? >@@ -312,30 +304,31 @@ elsif ( $op eq 'add_validate' ) { > my $rec = Koha::MarcSubfieldStructures->find( q{}, $tagfield, $tagsubfield ); > $kohafield = $rec->kohafield if $rec; > } >- $sth_insert->execute( >- $tagfield, >- $tagsubfield, >- $liblibrarian, >- $libopac, >- $repeatable, >- $mandatory, >- $kohafield, >- $tab, >- $seealso, >- $authorised_value, >- $authtypecode, >- $value_builder, >- $hidden, >- $isurl, >- $frameworkcode, >- $link, >- $defaultvalue, >- $maxlength, >- ); >+ Koha::MarcSubfieldStructure->new( >+ { >+ tagfield => $tagfield, >+ tagsubfield => $tagsubfield, >+ liblibrarian => $liblibrarian, >+ libopac => $libopac, >+ repeatable => $repeatable, >+ mandatory => $mandatory, >+ kohafield => $kohafield, >+ tab => $tab, >+ seealso => $seealso, >+ authorised_value => $authorised_value, >+ authtypecode => $authtypecode, >+ value_builder => $value_builder, >+ hidden => $hidden, >+ isurl => $isurl, >+ frameworkcode => $frameworkcode, >+ link => $link, >+ defaultvalue => $defaultvalue, >+ maxlength => $maxlength, >+ } >+ )->store; > } > } > } >- $sth_insert->finish; > $sth_update->finish; > $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); > $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); >-- >2.22.1
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 23309
:
92017
|
92054
|
92055
|
92171
|
92189
| 92190