<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#0060bf;">Hi all,<br><br>I noticed something odd when I do a query with the new 5.6.1 version.<br><br>The getFeature method seems to return a NULL value, when it was working good before the new version update.<br><br>Here's the code:<br><font size="2"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">$n = $map->numlayers;<br><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">for ($i = 0; $i < $n; $i++) {<br><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> $theme =
$map->GetLayer($i);<br> <br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> if ($tema->isVisible()) {</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> if (($regs = $theme->getNumResults()) == 0) {</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> continue;</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> }</span><br style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> }</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> else {</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> continue;</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> }</span><br> <br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><span style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"> $theme->open(); </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> $values = $theme->getitems();</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> unset($atts);</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><span style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"><br> for ($reg = 0; $reg < $regs; $reg++) {</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br> $result = $theme->getResult($reg);</span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br><span style="font-style: italic;"> </span><span style="color: rgb(255, 0, 127); font-style: italic;">// getFeature is returning NULL with the 5.6.1 version</span></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-style: italic;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-style: italic;"> </span><span
style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="color: rgb(255, 0, 127);">$element = $theme->getFeature($result->shapeindex, $result->tileindex);</span></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <br> for ($value = 0; $value < count($values); $value++) {</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> $atts[] = $values[$value] . " " . $element->values[$values[$value]];</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family:
Courier New,courier,monaco,monospace,sans-serif;"> }</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <br><span style="color: rgb(255, 0, 127); font-style: italic;"> // php crash because $element is a non object</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; color: rgb(255, 0, 127); font-style: italic;"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; color: rgb(255, 0, 127); font-style: italic;"> </span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; color: rgb(255, 0, 127);">$element->free();</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; color: rgb(255, 0, 127);"><span
style="font-family: Courier New,courier,monaco,monospace,sans-serif; color: rgb(255, 0, 127);"></span> <br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> }</span><br> <br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> $theme->close();</span><br> <br> ...<br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
New,courier,monaco,monospace,sans-serif;"> </span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br>}</span></font><br><br>Any help or idea will be appreciated.<br><br>Thanks in advance <br><br><div style="font-weight: bold;">IC Carlos Ruiz</div><div></div></div><br>
</body></html>