[mapguide-users] Fusion Error: Unterminated string constant -MySQL Database on hover or select

Paul Spencer pagameba at gmail.com
Fri Sep 25 08:41:08 EDT 2009


It looks like there is a problem with the single quotes in the WODate  
field, the value is TIMESTAMP 'xxx' - these should have been escaped  
to \'xxx\'.  If you are willing to make a small change to your fusion  
code, you might be able to fix this by modifying fusion/common/php/ 
Utilities.php.  There is a var2json($var) function in there, try  
adding this at the beginning of that function:

function var2json($var) {
     return json_encode($var); // add this line
     $result = "";
     if (is_object($var)) {

PHP now sports a built-in method for encoding variables as json data  
which may do a better job than my home-grown one.  I am actually  
making this change for the next version of fusion.

Alternately, if you don't need the timestamp then you can try  
eliminating it from your returned values (not sure how you do that but  
I am pretty sure its possible)

Cheers

Paul

On 2009-09-24, at 11:29 AM, Fraser Burgess wrote:

> Selecting from sdf works no problem.  Everything in the map appears to
> be working properly.  The SQL layers appear to display properly and  
> turn
> on and off as expected.
>
> I transcribed the error message wrong - i.e. there is an opening
> "@noNameSpaceSchemaLocation.  Attached is a screen grab of the error  
> to
> be sure.
>
> Fraser
>
>
>
> -----Original Message-----
> From: mapguide-users-bounces at lists.osgeo.org
> [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Paul
> Spencer
> Sent: Thursday, September 24, 2009 11:25 AM
> To: MapGuide Users Mail List
> Subject: Re: [mapguide-users] Fusion Error: Unterminated string  
> constant
> -MySQL Database on hover or select
>
> looks like the first @noNameSpaceSchemaLocation has no opening " but
> has a closing ", hence the whole string has mismatched quotes and
> fails to be parsed as a json string and is reported as a unterminated
> string constant - unless it didn't paste into your email correctly?
>
> It does not appear to be a problem with your data.  Does selecting
> anything work (i.e. from shp or sdf files as opposed to SQL)?
>
> Cheers
>
> Paul
>
> On 2009-09-24, at 10:47 AM, Fraser Burgess wrote:
>
>> Hi All,
>>
>> I'm using the demo SQL database from redding utilitymap database
>> connection.  When I connect to the generated layers from this
>> dataset In AJAX everything functions as expected.
>>
>> In Fusion however, when I hover over or try to select a feature
>> displayed on the map I get the following error in a pop up:
>>
>> Fusion Error:
>> WARNING: Exception occurred in AJAX callback
>> Message: Unterminated string constant
>> Location: undefined(undefined)
>> Response:
>> {"FeatureInformation":{FeatureSet":[{@noNamespaceSchemaLocation":
>> ["FeatureSet-1/0/0xsd"],"Layer";[{"@id:
>> ["e64a6900-8b44-102c-8000-005056c0008"],"Class";[{"@id":
>> ["Deafulat:worlder"] ........................................... Etc,
> etc,
>>
>> Not sure what is up but I noticed part of this error message looks
>> like an AJAX session parameter.  Not sure if that provides any hints
>>
>> Any ideas what this might be caused by?
>>
>> Thanks,
>>
>> Fraser
>>
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> <fusionerror.png>_______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users



More information about the mapguide-users mailing list