No subject


Wed Apr 28 00:58:20 CEST 2010


itemcallnumber is undefined.  The value of $itemcallnumber prints as a null
string, and thus fails gracefully.  Will check the staff client tomorrow.
 Am I missing a logged warning somewhere?

This test was performed on the latest code, synced today.


-Ian

On Tue, May 4, 2010 at 4:45 PM, Galen Charlton <gmcharlt at gmail.com> wrote:

> Hi,
>
> Why take out the test on whether $item->{itemcallnumber} was defined?
> Doing so will cause a warning if the call number is null.
>
> Regards,
>
> Galen
>
> On Tue, May 4, 2010 at 4:36 PM, Ian Walls
> <ian.walls at bywatersolutions.com> wrote:
> > From: Brendan A. Gallagher <brendan at bywatersolutions.com>
> >
> > Signed-off-by: Ian Walls <ian.walls at bywatersolutions.com>
> > ---
> >  C4/XSLT.pm |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/C4/XSLT.pm b/C4/XSLT.pm
> > index f1fc9db..ccf6fc2 100644
> > --- a/C4/XSLT.pm
> > +++ b/C4/XSLT.pm
> > @@ -206,10 +206,11 @@ sub buildKohaItemsNamespace {
> >             $status = "available";
> >         }
> >         my $homebranch =
> $branches->{$item->{homebranch}}->{'branchname'};
> > +        my $itemcallnumber = $item->{itemcallnumber};
> > +        $itemcallnumber =~ s/\&/\&amp\;/g;
> >         $xml.= "<item><homebranch>$homebranch</homebranch>".
> >                "<status>$status</status>".
> > -               (defined $item->{'itemcallnumber'} ?
> "<itemcallnumber>".$item->{'itemcallnumber'}."</itemcallnumber>"
> > -                                           : "<itemcallnumber />")
> > +               "<itemcallnumber>".$itemcallnumber."</itemcallnumber>"
> >         . "</item>";
> >
> >     }
> > --
> > 1.5.6.5
> >
> > _______________________________________________
> > Koha-patches mailing list
> > Koha-patches at lists.koha.org
> > http://lists.koha.org/mailman/listinfo/koha-patches
> >
>
>
>
> --
> Galen Charlton
> gmcharlt at gmail.com
>



-- 
Ian Walls
Lead Development Specialist
ByWater Solutions
ALA Booth # 817
Phone # (888) 900-8944
http://bywatersolutions.com
ian.walls at bywatersolutions.com
Twitter: @sekjal

--0016e6d77e3207e54f0485cb9f66
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Galen,<div><br></div><div><br>From my testing, no warning is visible in the=
 OPAC for items where itemcallnumber is undefined. =C2=A0The value of $item=
callnumber prints as a null string, and thus fails gracefully. =C2=A0Will c=
heck the staff client tomorrow. =C2=A0Am I missing a logged warning somewhe=
re?</div>
<div><br></div><div>This test was performed on the latest code, synced toda=
y.</div><div><br></div><div><br></div><div>-Ian</div><div><br><div class=3D=
"gmail_quote">On Tue, May 4, 2010 at 4:45 PM, Galen Charlton <span dir=3D"l=
tr">&lt;<a href=3D"mailto:gmcharlt at gmail.com">gmcharlt at gmail.com</a>&gt;</s=
pan> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">Hi,<br>
<br>
Why take out the test on whether $item-&gt;{itemcallnumber} was defined?<br=
>
Doing so will cause a warning if the call number is null.<br>
<br>
Regards,<br>
<br>
Galen<br>
<div><div></div><div class=3D"h5"><br>
On Tue, May 4, 2010 at 4:36 PM, Ian Walls<br>
&lt;<a href=3D"mailto:ian.walls at bywatersolutions.com">ian.walls at bywatersolu=
tions.com</a>&gt; wrote:<br>
&gt; From: Brendan A. Gallagher &lt;<a href=3D"mailto:brendan at bywatersoluti=
ons.com">brendan at bywatersolutions.com</a>&gt;<br>
&gt;<br>
&gt; Signed-off-by: Ian Walls &lt;<a href=3D"mailto:ian.walls at bywatersoluti=
ons.com">ian.walls at bywatersolutions.com</a>&gt;<br>
&gt; ---<br>
&gt; =C2=A0C4/XSLT.pm | =C2=A0 =C2=A05 +++--<br>
&gt; =C2=A01 files changed, 3 insertions(+), 2 deletions(-)<br>
&gt;<br>
&gt; diff --git a/C4/XSLT.pm b/C4/XSLT.pm<br>
&gt; index f1fc9db..ccf6fc2 100644<br>
&gt; --- a/C4/XSLT.pm<br>
&gt; +++ b/C4/XSLT.pm<br>
&gt; @@ -206,10 +206,11 @@ sub buildKohaItemsNamespace {<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $status =3D &quot;available&=
quot;;<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 my $homebranch =3D $branches-&gt;{$item-&g=
t;{homebranch}}-&gt;{&#39;branchname&#39;};<br>
&gt; + =C2=A0 =C2=A0 =C2=A0 =C2=A0my $itemcallnumber =3D $item-&gt;{itemcal=
lnumber};<br>
&gt; + =C2=A0 =C2=A0 =C2=A0 =C2=A0$itemcallnumber =3D~ s/\&amp;/\&amp;amp\;=
/g;<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 $xml.=3D &quot;&lt;item&gt;&lt;homebranch&=
gt;$homebranch&lt;/homebranch&gt;&quot;.<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;&lt;statu=
s&gt;$status&lt;/status&gt;&quot;.<br>
&gt; - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (defined $item-&gt;=
{&#39;itemcallnumber&#39;} ? &quot;&lt;itemcallnumber&gt;&quot;.$item-&gt;{=
&#39;itemcallnumber&#39;}.&quot;&lt;/itemcallnumber&gt;&quot;<br>
&gt; - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 : &quot;&lt;itemcallnumber /&gt;&quot;)<br>
&gt; + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;&lt;itemcalln=
umber&gt;&quot;.$itemcallnumber.&quot;&lt;/itemcallnumber&gt;&quot;<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 . &quot;&lt;/item&gt;&quot;;<br>
&gt;<br>
&gt; =C2=A0 =C2=A0 }<br>
&gt; --<br>
&gt; 1.5.6.5<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Koha-patches mailing list<br>
&gt; <a href=3D"mailto:Koha-patches at lists.koha.org">Koha-patches at lists.koha=
.org</a><br>
&gt; <a href=3D"http://lists.koha.org/mailman/listinfo/koha-patches" target=
=3D"_blank">http://lists.koha.org/mailman/listinfo/koha-patches</a><br>
&gt;<br>
<font color=3D"#888888"><br>
<br>
<br>
--<br>
Galen Charlton<br>
<a href=3D"mailto:gmcharlt at gmail.com">gmcharlt at gmail.com</a><br>
</font></blockquote></div><br><br clear=3D"all"><br>-- <br>Ian Walls<br>Lea=
d Development Specialist<br>ByWater Solutions<br>ALA Booth # 817<br>Phone #=
 (888) 900-8944<br><a href=3D"http://bywatersolutions.com">http://bywaterso=
lutions.com</a><br>
<a href=3D"mailto:ian.walls at bywatersolutions.com">ian.walls at bywatersolution=
s.com</a><br>Twitter: @sekjal<br>
</div>

--0016e6d77e3207e54f0485cb9f66--


More information about the Koha-patches mailing list