Opened 17 years ago

Closed 16 years ago

#354 closed defect (invalid)

Problem in the GenerateFilter() method of the MgSelection class

Reported by: pchevalier Owned by:
Priority: medium Milestone:
Component: Feature Service Version: 2.0.0
Severity: major Keywords: bug GenerateFilter MgSelection FeatId
Cc: External ID:

Description

I built a little web application that demonstrates the bug in the GenerateFilter() method of the MgSelection class.

The bug seems to happen on a precise pattern inside the Feature Sources and only on the Identity field. The program demonstrate that no matter which SDF or SHP used (I only tested these two), the GenerateFilter() method returns a random ID instead of returning the correct FeatId (Identity). You can use your SDF to test it too.

Always the same FeatIds are wrong : It starts with the ID 248 for 4 polygons, and step by 256 after that.
248, 249, 250, 251
504, 505, 506, 507
760, 761, 762, 763
... and so on.

You can download the application at this address : http://www.geomapgis.ca/webdownloads/MAPGUIDE_ERROR.zip

Start by reading the ReadMe.txt file.

Be sure to give access to user ASPNET to your web folder application.

Thanks to anyone that may have a solution to this problem!

Sorry I posted on the Mapguide User forum with this bug too.

Change History (4)

comment:1 by pchevalier, 17 years ago

Version: 2.0.01.2.0

in reply to:  description comment:2 by pchevalier, 17 years ago

Mapguide : Autodesk Mapguide Enterprise 2008 & Mapguide OpenSource 1.2 OS : Windows XP SP2

Replying to pchevalier:

I built a little web application that demonstrates the bug in the GenerateFilter() method of the MgSelection class.

The bug seems to happen on a precise pattern inside the Feature Sources and only on the Identity field. The program demonstrate that no matter which SDF or SHP used (I only tested these two), the GenerateFilter() method returns a random ID instead of returning the correct FeatId (Identity). You can use your SDF to test it too.

Always the same FeatIds are wrong : It starts with the ID 248 for 4 polygons, and step by 256 after that.
248, 249, 250, 251
504, 505, 506, 507
760, 761, 762, 763
... and so on.

You can download the application at this address : http://www.geomapgis.ca/webdownloads/MAPGUIDE_ERROR.zip

Start by reading the ReadMe.txt file.

Be sure to give access to user ASPNET to your web folder application.

Thanks to anyone that may have a solution to this problem!

Sorry I posted on the Mapguide User forum with this bug too.

comment:3 by jbirch, 17 years ago

Version: 1.2.02.0.0

I just downloaded the test application and ran it against 2.0.0 release. This problem is still evident.

comment:4 by bscott, 16 years ago

Resolution: invalid
Status: newclosed

I found the problem. There is no error in the GenerateFilter command. The error come while posting xml data from the client js to the server aspx command.

Here and example of what's going on with FeatID = 250.

1) we get the XmlSelection from the Client API <FeatureSet>

<Layer id="2c8890dc-0000-1000-8000-000c29aacf8c">

<Class id="Schema1:uf_poly">

<ID>+gAAAA==</ID>

</Class>

</Layer>

</FeatureSet>

2) we post this xml string to the server aspx, on the server we now have this string <FeatureSet>

<Layer id="2c8890dc-0000-1000-8000-000c29aacf8c">

<Class id="Schema1:uf_poly">

<ID> gAAAA==</ID>

</Class>

</Layer>

</FeatureSet>

3) as we are creating a new MgSelection with this wrong value, the GenerateFilter command can't process it properly.

Here is base64 representation of some FeatId 247 : 9wAAAA== 248 : +AAAAA== 249 : +QAAAA== 250 : +gAAAA== 251 : +wAAAA== 252 : /AAAAA==

The little program failed with featIds 248,249,250,251, they all starts with +

I'm pretty sure many of you who has experiences Selection/generateFilter problem have this same behavior.

In the sample application, if you replace your URLEncode function ( witch is using the escape function) by encodeURIComponent your program runs properly without any errors :)

Bruno Scott

Bruno Scott

Note: See TracTickets for help on using tickets.