<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>search_region method &quot;quote&quot; query</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>5.6.2<BR>
standard<BR>
<BR>
Trying to modify standard component results_grid to check variants<BR>
inventory.&nbsp; This was working fine but now complains:<BR>
<BR>
Can't call method &quot;quote&quot; on an undefined value at (tag 'search_region')<BR>
line 66.<BR>
<BR>
I don't understand because all values are defined from what I can see.<BR>
<BR>
$Tag-&gt;perl();<BR>
&nbsp;&nbsp;&nbsp; my $db = $Db{inventory};<BR>
&nbsp;&nbsp;&nbsp; my $qsku = $db-&gt;quote($sku);<BR>
&nbsp;&nbsp;&nbsp; my $ref = $db-&gt;query(&quot;SELECT SUM(i.quantity) FROM inventory i INNER JOIN<BR>
variants v WHERE i.sku = v.code AND v.sku=$qsku&quot;);<BR>
&nbsp;&nbsp;&nbsp; my $quantity = $ref-&gt;[0]-&gt;[0];<BR>
<BR>
&nbsp;&nbsp;&nbsp; if ($quantity &gt; 0) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $record-&gt;{stock} = &lt;&lt;EOF;<BR>
&lt;span style=&quot;color: #008000; font-size:10px; font-family: san-serif;<BR>
font-weight: bold;&quot;&gt;[L]Yes[/L]&lt;/span&gt;<BR>
EOF<BR>
&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp; else {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $url = $Tag-&gt;area('function/stock_alert', $sku);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $record-&gt;{stock} = &lt;&lt;EOF;<BR>
&lt;a href=&quot;$url&quot; title=&quot;[L]Click here to pre-order this item or get notified<BR>
as soon as this item is available again.[/L]&quot; style=&quot;color: #FF0000;<BR>
font-size:10px; font-family: san-serif; font-weight: bold;&quot;&gt;[L]No[/L]&lt;/a&gt;<BR>
EOF<BR>
&nbsp;&nbsp;&nbsp; }<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>