[Bug 23309] New: Can't add new subfields to bibliographic frameworks
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Bug ID: 23309 Summary: Can't add new subfields to bibliographic frameworks Change sponsored?: --- Product: Koha Version: 18.11 Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com When I try to add a new a new subfield to a tag in the bibliographic MARC frameworks, it doesn't save. Tested on a sandbox, found this in the logs: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'hidden' at row 1 [for Statement " 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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) " with ParamValues: 0="922", 1="n", 2="k", 3="k", 4=0, 5=0, 6="", 7="-1", 8=undef, 9="", 10="", 11="", 12="", 13=0, 14="", 15="", 16="", 17="9999"] at /kohadevbox/koha/admin/marc_subfields_structure.pl line 316. DBD::mysql::st execute failed: Incorrect integer value: '' for column 'hidden' at row 1 [for Statement " 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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) " with ParamValues: 0="941", 1="k", 2="k", 3="k", 4=0, 5=0, 6="", 7="-1", 8=undef, 9="", 10="", 11="", 12="", 13=0, 14="", 15="", 16="", 17="9999"] at /kohadevbox/koha/admin/marc_subfields_structure.pl line 316. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |17258 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17258 [Bug 17258] [OMNIBUS] MySQL 5.7 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|18.11 |master -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Can't add new subfields to |Can't add new subfields to |bibliographic frameworks |bibliographic frameworks in | |strict mode -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Chris Slone <cslone@camdencountylibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cslone@camdencountylibrary. | |org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 92017 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92017&action=edit Bug 23309: Fix 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 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org CC| |jonathan.druart@bugs.koha-c | |ommunity.org Blocks| |17258 Depends on|17258 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17258 [Bug 17258] [OMNIBUS] MySQL 5.7 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #1)
Created attachment 92017 [details] [review] Bug 23309: Fix 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
Should it be 8 and not 0? All unchecked is '8' if you save with this patch you get Opac Intranet and Editor checked which is equivalent to 0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Indeed Nick, good catch! So maybe we should have this default value at DB value? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #92017|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 92054 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92054&action=edit Bug 23309: Update DB -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 92055 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92055&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Should we make the same changes to auth_subfield_structure? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #92055|0 |1 is obsolete| | --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 92171 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92171&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #6)
Should we make the same changes to auth_subfield_structure?
The bug doesn't appear to exist for authorities. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Why the change to assigned? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #9)
Why the change to assigned?
Because it needs a followup I'm writing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #10)
(In reply to Katrin Fischer from comment #9)
Why the change to assigned?
Because it needs a followup I'm writing.
It doesn't need the follow-up. The test plan says nothing about updating the DBIC schema (and I forgot!). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #92171|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #92054|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 92189 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92189&action=edit Bug 23309: Update DB Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 92190 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92190&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |19.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|19.11.00 |19.11.00,19.05.04 released in| | Status|Pushed to master |Pushed to stable --- Comment #15 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 19.05.x for 19.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 18.11.x for 18.11.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable --- Comment #17 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 18.11.x for 18.11.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Corinne Hayet <corinne.hayet@progilone.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |corinne.hayet@progilone.fr --- Comment #18 from Corinne Hayet <corinne.hayet@progilone.fr> --- Hello everybody, We apply the last commit on Koha 18.11 including this patch and it doesn't work. We've got two errors 1. A foreign key constraint on authorised_value that fires because the value "" is passed instead of NULL: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha`.`marc_subfield_structure`, CONSTRAINT `marc_subfield_structure_ibfk_1` FOREIGN KEY (`authorised_value`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE SET NULL ON ) [for Statement " 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=? " with ParamValues: 0="225", 1="a", 2="titre de la collection", 3="", 4=0, 5=0, 6="biblioitems.collectiontitle", 7="0", 8=undef, 9="", 10="", 11="unimarc_field_225a.pl", 12="0", 13=0, 14="FA", 15="", 16="", 17="9999", 18="225", 19="a", 20="FA"] at /usr/share/koha/intranet/cgi-bin/admin/marc_subfields_structure.pl line 276. 2. The hidden field is explicitly set to null, so it does not change to its default value: DBD::mysql::st execute failed: Column 'hidden' cannot be null [for Statement "INSERT INTO `marc_subfield_structure` ( `authorised_value`, `authtypecode`, `defaultvalue`, `frameworkcode`, `hidden`, `isurl`, `kohafield`, `liblibrarian`, `libopac`, `link`, `mandatory`, `maxlength`, `repeatable`, `seealso`, `tab`, `tagfield`, `tagsubfield`, `value_builder`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0="", 1="", 2="", 3="FA", 4=undef, 5=0, 6='', 7="test", 8="test", 9="", 10=0, 11="9999", 12=0, 13=undef, 14="-1", 15="225", 16="z", 17=""] at /usr/local/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. Best regards, Corinne -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #19 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Oh indeed. @Lucas : I think its a backport error of "Bug 23309: DBRev 18.11.09.002" : You impact only installer/data/mysql/updatedatabase.pl : http://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=105e3c9ce04d... Compare with master : http://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=347dc9589aa7... And 19.05.x : http://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=f14d94e565c8... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #20 from Lucas Gass <lucas@bywatersolutions.com> --- Sorry about this error, I have fixed it with this commit: 9c1720d7d7b299812bc7faa6a2ae9d23075d2a0d -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #21 from Corinne Hayet <corinne.hayet@progilone.fr> --- Sorry but it still does not work. It only works if the subfield is connected to an Authorized values list. I created a subfield 099$m with a link with COUNTRY authorized values list and it's OK But, if I try to create a simple subfield 012$z and I've got the following error in logs : DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha`.`marc_subfield_structure`, CONSTRAINT `marc_subfield_structure_ibfk_1` FOREIGN KEY (`authorised_value`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE SET NULL ON ) [for Statement "INSERT INTO `marc_subfield_structure` ( `authorised_value`, `authtypecode`, `defaultvalue`, `frameworkcode`, `hidden`, `isurl`, `kohafield`, `liblibrarian`, `libopac`, `link`, `mandatory`, `maxlength`, `repeatable`, `seealso`, `tab`, `tagfield`, `tagsubfield`, `value_builder`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0="", 1="", 2="", 3="", 4="0", 5=0, 6="", 7="test", 8="test", 9="", 10=0, 11="9999", 12=0, 13=undef, 14="0", 15="013", 16="x", 17=""] at /usr/local/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. Best regards, Corinne -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Corinne Hayet from comment #21)
Sorry but it still does not work. It only works if the subfield is connected to an Authorized values list.
I created a subfield 099$m with a link with COUNTRY authorized values list and it's OK
But, if I try to create a simple subfield 012$z and I've got the following error in logs :
DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha`.`marc_subfield_structure`, CONSTRAINT `marc_subfield_structure_ibfk_1` FOREIGN KEY (`authorised_value`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE SET NULL ON ) [for Statement "INSERT INTO `marc_subfield_structure` ( `authorised_value`, `authtypecode`, `defaultvalue`, `frameworkcode`, `hidden`, `isurl`, `kohafield`, `liblibrarian`, `libopac`, `link`, `mandatory`, `maxlength`, `repeatable`, `seealso`, `tab`, `tagfield`, `tagsubfield`, `value_builder`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0="", 1="", 2="", 3="", 4="0", 5=0, 6="", 7="test", 8="test", 9="", 10=0, 11="9999", 12=0, 13=undef, 14="0", 15="013", 16="x", 17=""] at /usr/local/share/perl5/DBIx/Class/Storage/DBI.pm line 1836.
Best regards, Corinne
Hi Corinne, thx for being persistent! As this is already in stable, would you mind filing a new bug and linking to this one? (Depends on). We will have to treat it as a new bug and take a look into fixing it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Corinne Hayet <corinne.hayet@progilone.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23709 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23709 [Bug 23709] Can't add new subfields to bibliographic frameworks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24137 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23309 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25686 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25686 [Bug 25686] Title in the catalogue search result doesn't open the full (normal) record display -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org