[Koha-patches] [PATCH] Bug 5727 Warning in log due to XSLT.pm
Frédéric Demians
f.demians at tamil.fr
Wed Feb 9 18:44:29 CET 2011
XSLT.pm add few syspref to MARCXML record send to be transformed by XSLT. If
one of those syspref doesn't exist, it generated a warning.
---
C4/XSLT.pm | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/C4/XSLT.pm b/C4/XSLT.pm
index 7844330..f1c5293 100644
--- a/C4/XSLT.pm
+++ b/C4/XSLT.pm
@@ -129,9 +129,9 @@ sub XSLTParse4Display {
my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
my $sysxml = "<sysprefs>\n";
foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD OPACBaseURL/ ) {
- $sysxml .= "<syspref name=\"$syspref\">" .
- C4::Context->preference( $syspref ) .
- "</syspref>\n";
+ my $sp = C4::Context->preference( $syspref );
+ next unless defined($sp);
+ $sysxml .= "<syspref name=\"$syspref\">$sp</syspref>\n";
}
$sysxml .= "</sysprefs>\n";
$xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
--
1.7.4
More information about the Koha-patches
mailing list