[open-ils-commits] r13065 - trunk/Open-ILS/src/perlmods/OpenILS/Application (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon May 4 19:42:00 EDT 2009


Author: miker
Date: 2009-05-04 19:42:00 -0400 (Mon, 04 May 2009)
New Revision: 13065

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
Log:
quiet warnings about undef string escaping; add more fields to the top level copy element

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm	2009-05-04 21:32:39 UTC (rev 13064)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm	2009-05-04 23:42:00 UTC (rev 13065)
@@ -1060,6 +1060,7 @@
 sub escape {
 	my $self = shift;
 	my $text = shift;
+    return '' unless $text;
 	$text =~ s/&/&/gsom;
 	$text =~ s/</&lt;/gsom;
 	$text =~ s/>/&gt;/gsom;
@@ -1785,11 +1786,16 @@
     my $self = shift;
     my $args = shift;
 
-    my $xml = '<copy xmlns="http://open-ils.org/spec/holdings/v1" ';
+    my $xml = '<copy xmlns="http://open-ils.org/spec/holdings/v1" '.
+        'id="tag:open-ils.org:asset-copy/' . $self->obj->id . '" ';
 
-    $xml .= 'id="tag:open-ils.org:asset-copy/' . $self->obj->id . '" ';
-    $xml .= 'barcode="' . $self->escape( $self->obj->barcode  ) . '">';
+    $xml .= $_ . '="' . $self->escape( $self->obj->$_  ) . '" ' for (qw/
+        create_date edit_date copy_number circulate deposit ref holdable deleted
+        deposit_amount price barcode circ_modifier circ_as_type opac_visible
+    /);
 
+    $xml .= '>';
+
     $xml .= '<status ident="' . $self->obj->status->id . '">' . $self->escape( $self->obj->status->name  ) . '</status>';
     $xml .= '<location ident="' . $self->obj->location->id . '">' . $self->escape( $self->obj->location->name  ) . '</location>';
     $xml .= '<circlib ident="' . $self->obj->circ_lib->id . '">' . $self->escape( $self->obj->circ_lib->name  ) . '</circlib>';



More information about the open-ils-commits mailing list