From 0d3186e993136bacc99a307f79b08b5dd0b567f5 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Fri, 1 Mar 2013 16:24:27 +0100 Subject: [PATCH] Bug 9740: using XSLT modifies record authorized values When using XSLT display, in detail.pl, the record (MARC::Record) is get from database. This record is given to XSLTParse4Display() to transform into HTML using XSLT. This method uses transformMARCXML4XSLT() to replace in record authorized values code by there description. The bug is that this change is made on original record and remains in the rest of the script detail.pl. This patch adds a clonning operation into transformMARCXML4XSLT. Test plan : - Activate XSLT display in intranet details XSLTDetailsDisplay syspref - Create a new authorized value categorie : ie "AUTHVAL" - Add a new authorized value and description : ie "VAL" and "Description for VAL" - Edit default framework - Edit a note subfield : 3xx for UNIMARC, 5xx for others) : ie 326$a - Set authorized value "AUTHVAL" for this subfield - Edit a biblio with default framework - Choose authorized value for speficied subfield : ie "Description for VAL" for 326$a - Go to detail page and click on "Descriptions" tab => Whitout this patch you see authorized value description : ie "Description for VAL" => Whith this patch you see authorized value code : ie "VAL" "Descriptions" tab is set in detail.pl with C4::GetMarcNotes($record,$marcflavour) after the call to XSLTParse4Display($record), so test plan confirms that XSLTParse4Display() modifies or not $record. --- C4/XSLT.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 19ec162..5f542d7 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -177,7 +177,8 @@ sub XSLTParse4Display { } # grab the XML, run it through our stylesheet, push it out to the browser - my $record = transformMARCXML4XSLT($biblionumber, $orig_record); + my $record = $orig_record->clone(); # work on a copy + $record = transformMARCXML4XSLT($biblionumber, $record); #return $record->as_formatted(); my $itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items); my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); -- 1.7.10.4