From ef1fc52c718da991867b57c6690f0b3afc70479b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 6 Sep 2012 16:03:42 +0200 Subject: [PATCH 1/3] Bug 8002: FIX Change datatype from varchar 1 to 10 for borrower_attribute_types.category_code Signed-off-by: Chris Cormack Signed-off-by: Paul Poulain --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 1dc17ba764..f274f5dd55 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -288,7 +288,7 @@ CREATE TABLE `borrower_attribute_types` ( -- definitions for custom patron field `staff_searchable` tinyint(1) NOT NULL default 0, -- defines if this field is searchable via the patron search in the staff client (1 for yes, 0 for no) `authorised_value_category` varchar(10) default NULL, -- foreign key from authorised_values that links this custom field to an authorized value category `display_checkout` tinyint(1) NOT NULL default 0,-- defines if this field displays in checkout screens - `category_code` VARCHAR(1) NULL DEFAULT NULL,-- defines a category for an attribute_type + `category_code` VARCHAR(10) NULL DEFAULT NULL,-- defines a category for an attribute_type `class` VARCHAR(255) NOT NULL DEFAULT '',-- defines a class for an attribute_type PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index edc47585af..b503c4142d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5781,6 +5781,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.09.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("ALTER TABLE borrower_attribute_types MODIFY category_code VARCHAR( 10 ) NULL DEFAULT NULL"); + print "Upgrade to $DBversion done. (Bug 8002: Update patron attribute types table from varchar(1) to varchar(10) category_code)\nWarning to Koha System Administrators: If you use borrower attributes defined by borrower categories, you have to check your configuration. A bug may have removed your attribute links to borrower categories.\nPlease check, and fix it if necessary."; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) From ffc6730552b1af5814783b40bd6d5dd9b48ce9c3 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Sun, 9 Sep 2012 08:18:05 -0400 Subject: [PATCH 2/3] Bug 8743: ZOOM error when merging authority change to biblios The merge fails and the following errors appear in the log: [Sun Sep 02 23:38:10 2012] [error] [client 75.149.175.233] ZOOM error 25 "Specified element set name not valid for specified database" (addinfo: "F") from diag-set 'Bib-1', referer: http://****/cgi-bin/koha/authorities/authorities.pl?authid=3010 [Sun Sep 02 23:38:11 2012] [error] [client 75.149.175.233] Premature end of script headers: authorities.pl, referer: http://****/cgi-bin/koha/authorities/authorities.pl?authid=3010 Test plan: 1) Set dontmerge to "Do" 2) Find an authority that is linked to a bib record. 3) Edit the main entry of the authority. 4) Save the authority record. 5) Notice that you got a nasty error and the bib record was not updated. 6) Apply patch. 7) Edit the main entry of the authority again (you can just set it back to what it was to start with). 8) Save authority record. 9) Notice that there was no error, and the bib record was updated. 10) Sign off. Signed-off-by: Paul Poulain --- C4/AuthoritiesMarc.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 8f86ab96d7..79f3956f34 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1363,8 +1363,8 @@ sub merge { } else { #zebra connection my $oConnection=C4::Context->Zconn("biblioserver",0); - my $oldSyntax = $oConnection->option("preferredRecordSyntax"); - $oConnection->option("preferredRecordSyntax"=>"XML"); + # We used to use XML syntax here, but that no longer works. + # Thankfully, we don't need it. my $query; $query= "an=".$mergefrom; my $oResult = $oConnection->search(new ZOOM::Query::CCL2RPN( $query, $oConnection )); @@ -1377,7 +1377,7 @@ sub merge { my $rec; $rec=$oResult->record($z); my $marcdata = $rec->raw(); - my $marcrecordzebra= MARC::Record->new_from_xml($marcdata,"utf8",C4::Context->preference("marcflavour")); + my $marcrecordzebra= MARC::Record->new_from_usmarc($marcdata); my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); my $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield); my $marcrecorddb=GetMarcBiblio($i); @@ -1385,7 +1385,6 @@ sub merge { $z++; } $oResult->destroy(); - $oConnection->option("preferredRecordSyntax"=>$oldSyntax); } #warn scalar(@reccache)." biblios to update"; # Get All candidate Tags for the change From f22d9e1337183dfe6afe2fb014841bf17d657a11 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Fri, 14 Sep 2012 15:59:50 +0200 Subject: [PATCH 3/3] Bug 8743 follow-up, throw a more explanatory error message When testing bug 8743, I discovered a missing index in my authority file. The error message was "CCL parsing error (10014) Unknown qualifier ZOOM" which is not very helpfull because it does not show the query that was made. This patch add the query itself after the zebra error --- C4/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index d9b53ac1ed..91bfbb0dfb 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -248,7 +248,7 @@ sub SimpleSearch { . $@->code() . ") " . $@->addinfo() . " " . $@->diagset(); - warn $error; + warn $error." for query: $query"; return ( $error, undef, undef ); } }