Bug 25861

Summary: [19.11] Cannot copy MARC frameworks
Product: Koha Reporter: Charlie <ctw2100>
Component: MARC Bibliographic record staging/importAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: aleisha, andrewfh, hayleypelham, jonathan.druart, julian.maurice, nick, victor
Version: 19.11   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Bug 17232 updated some SQL queries used when adding new MARC bibliographic frameworks. When backported to 19.11.x, it referenced a column `important` that does not exist in the marc_tag_structure table or marc_subfield_structure table in 19.11.x. This patch removes the references to `important` so that adding new bibliographic frameworks works again.
Version(s) released in:
19.11.08
Bug Depends on: 17232    
Bug Blocks:    
Attachments: Bug 25861: Removing non-existent 'important' field from SQL
Bug 25861: Removing non-existent 'important' field from SQL
Bug 25861: Removing non-existent 'important' field from SQL

Description Charlie 2020-06-24 03:21:44 UTC
Koha Version: 19.11.06.000

I found out it's doesn't work when I add new MARC frameworks, error log said there is an Unknown column 'important', So I checked the database structure, there isn't a column called 'important', I also try to delete 'important' from file marctagstructure.pl, and it works, try to fix this ASAP plz

System Error Log:
[Wed Jun 24 11:01:15.882256 2020] [cgi:error] [pid 22124] [client 172.105.200.142:37851] AH01215: [Wed Jun 24 11:01:15 2020] marctagstructure.pl: DBD::mysql::db do failed: Unknown column 'important' in 'field list' [for Statement "INSERT INTO marc_subfield_structure (frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,important,kohafield,tab,authorised_value,authtypecode,value_builder,isurl,seealso,hidden,link,defaultvalue,maxlength): /usr/share/koha/intranet/cgi-bin/admin/marctagstructure.pl, referer: http://47.113.102.87:8080/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=STT

[Wed Jun 24 11:01:15.882612 2020] [cgi:error] [pid 22124] [client 172.105.200.142:37851] AH01215: [Wed Jun 24 11:01:15 2020] marctagstructure.pl:         SELECT ?,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,important,kohafield,tab,authorised_value,authtypecode,value_builder,isurl,seealso,hidden,link,defaultvalue,maxlength from marc_subfield_structure where frameworkcode=?: /usr/share/koha/intranet/cgi-bin/admin/marctagstructure.pl, referer: http://47.113.102.87:8080/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=STT
Comment 1 Katrin Fischer 2020-06-24 06:39:43 UTC
Hi Charlie,

something got backported which should not have been - the important field only exists in 20.05. I am linking this to the bug causing the issue and adding our new Release Maintainer for the version, so she can have a look.

If it's really urgent, you could try to undo the changes from the other bugs, let me know if I can help there.

Caused by bug 17232.
Comment 2 Aleisha Amohia 2020-06-24 21:13:14 UTC
Created attachment 106264 [details] [review]
Bug 25861: Removing non-existent 'important' field from SQL

Bug 17232 updated some SQL queries used when adding new MARC
bibliographic frameworks. When backported to 19.11.x, it referenced a
column `important` that does not exist in marc_tag_structure or
marc_subfield_structure in 19.11.x. This patch removes the references to
`important` so that adding new bibliographic frameworks works again.

To test:
1) Ensure you have checked out 19.11.x branch
2) Go to Admin -> MARC bibliographic frameworks
3) Add a new framework and save
4) Go to Actions -> MARC structure for your new framework
5) Use the 'create framework using' dropdown to import the structure
from an existing framework
6) Note that the structure does not populate, and there is now an error
in the logs "Unknown column 'important'"
7) Apply this patch and restart services
8) Repeat steps 3-5
9) Confirm the structure is populated correctly and there is no error in
the logs

Sponsored-by: Catalyst IT
Comment 3 Katrin Fischer 2020-06-24 21:26:52 UTC
Created attachment 106265 [details] [review]
Bug 25861: Removing non-existent 'important' field from SQL

Bug 17232 updated some SQL queries used when adding new MARC
bibliographic frameworks. When backported to 19.11.x, it referenced a
column `important` that does not exist in marc_tag_structure or
marc_subfield_structure in 19.11.x. This patch removes the references to
`important` so that adding new bibliographic frameworks works again.

To test:
1) Ensure you have checked out 19.11.x branch
2) Go to Admin -> MARC bibliographic frameworks
3) Add a new framework and save
4) Go to Actions -> MARC structure for your new framework
5) Use the 'create framework using' dropdown to import the structure
from an existing framework
6) Note that the structure does not populate, and there is now an error
in the logs "Unknown column 'important'"
7) Apply this patch and restart services
8) Repeat steps 3-5
9) Confirm the structure is populated correctly and there is no error in
the logs

Sponsored-by: Catalyst IT

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Julian Maurice 2020-06-26 08:19:51 UTC
Created attachment 106316 [details] [review]
Bug 25861: Removing non-existent 'important' field from SQL

Bug 17232 updated some SQL queries used when adding new MARC
bibliographic frameworks. When backported to 19.11.x, it referenced a
column `important` that does not exist in marc_tag_structure or
marc_subfield_structure in 19.11.x. This patch removes the references to
`important` so that adding new bibliographic frameworks works again.

To test:
1) Ensure you have checked out 19.11.x branch
2) Go to Admin -> MARC bibliographic frameworks
3) Add a new framework and save
4) Go to Actions -> MARC structure for your new framework
5) Use the 'create framework using' dropdown to import the structure
from an existing framework
6) Note that the structure does not populate, and there is now an error
in the logs "Unknown column 'important'"
7) Apply this patch and restart services
8) Repeat steps 3-5
9) Confirm the structure is populated correctly and there is no error in
the logs

Sponsored-by: Catalyst IT

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 5 Jonathan Druart 2020-07-02 14:52:07 UTC
Sending to RMaint 19.11 queue.
Comment 6 Victor Grousset/tuxayo 2020-07-08 16:52:24 UTC
Tried the test plan: not needed for 19.05.x, even if it backported and reverted Bug 17232, same as 19.11.x
Comment 7 Aleisha Amohia 2020-07-08 19:43:33 UTC
Backported to 19.11.x for 19.11.08