From 02b5772d510a0e93c01d20f27913b698a5bb0114 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Sun, 9 Sep 2012 08:18:05 -0400 Subject: [PATCH] Bug 8743: ZOOM error when merging authority change to biblios Content-Type: text/plain; charset="UTF-8" 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. --- C4/AuthoritiesMarc.pm | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 6a85493..438e048 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1406,8 +1406,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 )); @@ -1420,7 +1420,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 $bibnum; if ($biblionumbertagfield < 10) { @@ -1434,7 +1434,6 @@ sub merge { $z++; } $oResult->destroy(); - $oConnection->option("preferredRecordSyntax"=>$oldSyntax); } #warn scalar(@reccache)." biblios to update"; -- 1.7.2.5