From ffc6730552b1af5814783b40bd6d5dd9b48ce9c3 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 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 -- 2.39.5