Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

Jackie Ng
Hi All,

I've attached a patch for ticket 2526

http://trac.osgeo.org/mapguide/ticket/2526

If you try to do a QUERYMAPFEATURES with PERSIST=0, it will throw a MgUnclassifiedException. This is because when the persist flag is false, a null MgSelection pointer is passed down to MgHtmlController::CollectQueryMapFeaturesResult() because the MgSelection pointer is not properly assigned from the MgFeatureInformation when persist = false

This patch ensures CollectQueryMapFeaturesResult receives a non-null MgSelection pointer whether persist is true or false.

Please review. Thanks.

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

weltonw
Hi Jackie,

In your patch the call to newSelection->SetMap() is now always being made, regardless of whether the selection set was saved.  Is that necessary?  Or does SetMap() only need to be called in the case of persist = true?

I'm not knowledgeable with the actual behavior of these APIs, but the change in the logic caught my attention.

Walt

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jackie Ng
Sent: Tuesday, March 10, 2015 12:28 PM
To: [hidden email]
Subject: [mapguide-internals] Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

Hi All,

I've attached a patch for ticket 2526

http://trac.osgeo.org/mapguide/ticket/2526

If you try to do a QUERYMAPFEATURES with PERSIST=0, it will throw a MgUnclassifiedException. This is because when the persist flag is false, a null MgSelection pointer is passed down to
MgHtmlController::CollectQueryMapFeaturesResult() because the MgSelection pointer is not properly assigned from the MgFeatureInformation when persist = false

This patch ensures CollectQueryMapFeaturesResult receives a non-null MgSelection pointer whether persist is true or false.

Please review. Thanks.

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Patch-for-ticket-2526-MgUnclassifiedException-thrown-when-QUERYMAPFEATURES-request-made-with-PERSIST-tp5192598.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
Reply | Threaded
Open this post in threaded view
|

Re: Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

Jackie Ng
Hi Walt,

The newSelection may be assigned from the MgFeatureInformation's selection, which doesn't have an attached MgMap instance. We need an attached MgMap for MgSelection::GetLayers() to be able to return MgLayer instances from the internally encoded selection information.

We could refine the logic to only call SetMap() if it wasn't assigned via "new MgSelection(map)"

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

weltonw
> We could refine the logic to only call SetMap() if it wasn't assigned via "new MgSelection(map)"
I think that makes sense.


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jackie Ng
Sent: Tuesday, March 10, 2015 8:24 PM
To: [hidden email]
Subject: Re: [mapguide-internals] Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

Hi Walt,

The newSelection may be assigned from the MgFeatureInformation's selection, which doesn't have an attached MgMap instance. We need an attached MgMap for
MgSelection::GetLayers() to be able to return MgLayer instances from the internally encoded selection information.

We could refine the logic to only call SetMap() if it wasn't assigned via "new MgSelection(map)"

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Patch-for-ticket-2526-MgUnclassifiedException-thrown-when-QUERYMAPFEATURES-request-made-with-PERSIST-tp5192598p5192694.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
Reply | Threaded
Open this post in threaded view
|

Re: Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

Jackie Ng
2nd version of the patch attached.

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

weltonw
+1 from me

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jackie Ng
Sent: Wednesday, March 11, 2015 6:46 AM
To: [hidden email]
Subject: Re: [mapguide-internals] Patch for ticket 2526 (MgUnclassifiedException thrown when QUERYMAPFEATURES request made with PERSIST=0)

2nd version of the patch attached.

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Patch-for-ticket-2526-MgUnclassifiedException-thrown-when-QUERYMAPFEATURES-request-made-with-PERSIST-tp5192598p5192764.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals