Bugzilla – Attachment 85769 Details for
Bug 22395
Data in 245 field (subfield a or b) will be deleted if it has Quotation Marks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22395: (bug 15836 follow-up) Fix class_sources.class_split_rule FK creation
Bug-22395-bug-15836-follow-up-Fix-classsourcesclas.patch (text/plain), 2.45 KB, created by
Jonathan Druart
on 2019-02-27 12:56:05 UTC
(
hide
)
Description:
Bug 22395: (bug 15836 follow-up) Fix class_sources.class_split_rule FK creation
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-02-27 12:56:05 UTC
Size:
2.45 KB
patch
obsolete
>From b569aab03ccf0630cda7998790456db60f10a1b4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 27 Feb 2019 09:38:57 -0300 >Subject: [PATCH] Bug 22395: (bug 15836 follow-up) Fix > class_sources.class_split_rule FK creation >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >18.06.00.060 will fail if custom Classification sources were created. > >In that case we should use the 'generic' split rule. > >Test plan: >% git checkout -b bug_22395_pre 3a0cba67f1387595f570ab9d9efdeabc856345b4 >Reset the DB >Go to Home ⺠Administration ⺠Classification sources >Create a custom "Classification filing rules" >Create a custom "Classification sources" using this filing rules >% git checkout master >% perl installer/data/mysql/updatedatabase.pl >=> Without this patch you will get: >DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`#sql-33a_67`, CONSTRAINT `class_source_ibfk_2` FOREIGN KEY (`class_split_rule`) REFERENCES `class_split >_rules` (`class_split_rule`)) [for Statement " > ALTER TABLE class_sources > ADD CONSTRAINT class_source_ibfk_2 FOREIGN KEY (class_split_rule) > REFERENCES class_split_rules (class_split_rule) > "] at installer/data/mysql/updatedatabase.pl line 17104. > >=> With this patch applied the FK will be created successfully >class_sources.class_split_rule will be set to "generic" for these custom values. >--- > installer/data/mysql/updatedatabase.pl | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index b50980ef02..ddda8d8715 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -17081,12 +17081,19 @@ if( CheckVersion( $DBversion ) ) { > ADD COLUMN class_split_rule varchar(10) NOT NULL default '' > AFTER class_sort_rule > |); >+ > $dbh->do(q| > UPDATE class_sources > SET class_split_rule = class_sort_rule > |); > > $dbh->do(q| >+ UPDATE class_sources >+ SET class_split_rule = 'generic' >+ WHERE class_split_rule NOT IN('dewey', 'generic', 'lcc') >+ |); >+ >+ $dbh->do(q| > INSERT INTO class_split_rules(class_split_rule, description, split_routine) > VALUES > ('dewey', 'Default sorting rules for DDC', 'Dewey'), >-- >2.11.0
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 22395
:
85769