<div dir="ltr">Strangely, I sometime do this:<div><br></div><div>$mySel = $sel->ToXml();</div><div>$this->originalSel = $mySel;<br></div><div><br></div><div>and I find that works better..</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 17, 2023 at 2:17 PM David Bowen <<a href="mailto:dbowenrci@gmail.com">dbowenrci@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Our application has functionality where a user can search for an address and then click on a button to return data, when available, from a selection of layers. We're encountering an issue where there is data present, however when the user clicks the button, MapGuide returns an error saying no valid objects are selected. If the user clicks the button a second time, results are returned. This seems like a MapGuide error and I've been attempting to troubleshoot it without success.<br>This issue is intermittent and only seems to exist in our Development environment, however I can recreate it if I export the Development package from Maestro and import it into another environment.<br><br>The relevant section of code that seems to be failing is:<br><br> $myMap = $this->MapGuideObject->getMap();<br>$session = $this->mgSessionId;<br>$mapName = $this->mgMapID;<br>$objkeys = '';<br>$errorMsg = null;<br>$siteConnection = $this->MapGuideObject->getSiteConnection();<br>// Get an instance of the Resource and Mapping Services and use them to open<br>// the map and initialize a selection object.<br>$resourceSrvc = $this->MapGuideObject->getResourceService();<br>$featureSrvc = $this->MapGuideObject->getFeatureService();<br>//Get selected map layers.<br>$sel = new MgSelection( $myMap );<br><br>$sel->Open( $resourceSrvc, $mapName );<br><br>$this->originalSel = $sel->ToXml();<br>$selLayers = $sel->GetLayers();<br>//Check to see if no objects are selected.<br> <br>It appears that the line $this->originalSel = $sel->ToXml(); is the issue as there are times where it returns data but other times it's an empty string. Has anyone encountered an issue like this, or would anyone have an idea of how to resolve it?<br>Alternatively, what would be the best way to try to catch a potential MapGuide error that is being generated? I believe that we have all error logging turned on but nothing has appeared in the log files.<br><br>Thanks,<br>David</div>
_______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapguide-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
</blockquote></div>