Quantcast

[Bug 2096] New: [Chameleon-widget]"MapServer Template" string have to be in query template for the MapTips widget

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

[Bug 2096] New: [Chameleon-widget]"MapServer Template" string have to be in query template for the MapTips widget

bugzilla-daemon (Bugzilla)-13
http://bugzilla.maptools.org/show_bug.cgi?id=2096

           Summary: [Chameleon-widget]"MapServer Template" string have to
                    be in query template for the MapTips widget
           Product: Chameleon
           Version: 2.6
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Widget
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]


"MapServer Template" string have to be in query template for the MapTips widget
in the MapServer version greaer than 5.x.x.

Julien provided a dirty fix which is:

fwrite( $hTemplate, "MapServer Template\n".$szTemplate );
ligne 437 de MapTips.widget.php

A better fix will be to add a test to detect the MapServer version and add this
string to the query template if the version is greater than 5.x.x (have to ask
which version to developer).

--
Configure bugmail: http://bugzilla.maptools.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Chameleon-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/chameleon-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 2096] [Chameleon-widget]"MapServer Template" string have to be in query template for the MapTips widget

bugzilla-daemon (Bugzilla)-13
http://bugzilla.maptools.org/show_bug.cgi?id=2096


Normand Savard <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #1 from Normand Savard <[hidden email]>  2009-09-18 14:40:59 ---
I added the following code to detect MS version before adding the template
string.  Need to commit.

           //Check MS version before adding 'MapServer Template' string
            //Modified by Normand Savard 20090916
            $aszMapServerInformation = explode(" ", ms_GetVersion());
            $aszDigits = array();
            $szMSVersion = $aszMapServerInformation[2];
            $aszDigits = explode('.', $szMSVersion);
            $numDigits = count($aszDigits);

            if ($numDigits == 0 || $numDigits < 2 || $numDigits > 3)
            {
                echo "Invalid version ($szMSVersion). Version must be in the ".
                    "format 'x.y' or 'x.y.z'";
            }

            $nVersion = intval($aszDigits[0], 8)*0x010000;
            $nVersion += intval($aszDigits[1],8)*0x0100;
            if ($numDigits > 2)
            {
                $nVersion += intval($aszDigits[2],8);
            }

            if(($nVersion == 041004) || ($nVersion >= 050202))
            {
                fwrite( $hTemplate, "MapServer Template\n".$szTemplate );
            }
            //End of code modified by Normand Savard

--
Configure bugmail: http://bugzilla.maptools.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Chameleon-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/chameleon-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 2096] [Chameleon-widget]"MapServer Template" string have to be in query template for the MapTips widget

bugzilla-daemon (Bugzilla)-13
In reply to this post by bugzilla-daemon (Bugzilla)-13
http://bugzilla.maptools.org/show_bug.cgi?id=2096


Daniel Morissette <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]




--- Comment #2 from Daniel Morissette <[hidden email]>  2009-09-18 19:55:47 ---
Why not use ms_GetVersionInt() instead of parsing the version string? Is it
because the function was added in MS 5.0.0 and Chameleon still needs to support
MapServer 4.10.x?

Another option might be to use a HTML comment for the line that we add, and
then we may not need to worry about the version check?


  fwrite( $hTemplate, "<!-- MapServer Template -->\n".$szTemplate );

--
Configure bugmail: http://bugzilla.maptools.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Chameleon-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/chameleon-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 2096] [Chameleon-widget]"MapServer Template" string have to be in query template for the MapTips widget

bugzilla-daemon (Bugzilla)-13
In reply to this post by bugzilla-daemon (Bugzilla)-13
http://bugzilla.maptools.org/show_bug.cgi?id=2096


Daniel Morissette <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




--- Comment #3 from Daniel Morissette <[hidden email]>  2009-09-18 20:01:33 ---
Another note: this fix will be broken if we ever release a 4.10.5+... and I
believe the tests in the 'if' should use hex values instead of the current
notation which is actually octal since the numbers start with zeros?

See also: http://us.php.net/manual/en/language.types.integer.php

--
Configure bugmail: http://bugzilla.maptools.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Chameleon-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/chameleon-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 2096] [Chameleon-widget]"MapServer Template" string have to be in query template for the MapTips widget

bugzilla-daemon (Bugzilla)-13
In reply to this post by bugzilla-daemon (Bugzilla)-13
http://bugzilla.maptools.org/show_bug.cgi?id=2096





--- Comment #4 from Normand Savard <[hidden email]>  2009-09-21 14:02:52 ---
Why not use ms_GetVersionInt() instead of parsing the version string?

I used the doc found here and didn't know this function:
http://www.maptools.org/php_mapscript/index.phtml?page=phpmapscript-class-guide.html


Daniel you're right, the "if" should be:
            if(($nVersion >= 0x41004) || ($nVersion >= 0x50202))

and:

             $nVersion = intval($aszDigits[0], 8)*0x010000;
            $nVersion += intval($aszDigits[1],8)*0x0100;

need to be:

            $nVersion = intval($aszDigits[0], 16)*0x010000;
            $nVersion += intval($aszDigits[1],16)*0x0100;


but I chose the simpler:

  fwrite( $hTemplate, "<!-- MapServer Template -->\n".$szTemplate );

--
Configure bugmail: http://bugzilla.maptools.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Chameleon-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/chameleon-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 2096] [Chameleon-widget]"MapServer Template" string have to be in query template for the MapTips widget

bugzilla-daemon (Bugzilla)-13
In reply to this post by bugzilla-daemon (Bugzilla)-13
http://bugzilla.maptools.org/show_bug.cgi?id=2096





--- Comment #5 from Normand Savard <[hidden email]>  2009-09-28 20:15:11 ---
Just for the record, after chatting with Daniel, if I was going to use an algo
to solve this issue it should look something similar to:


//Check MS version before adding 'MapServer Template' string
//Modified by Normand Savard 20090916
$nVersion = ms_GetVersionInt());

if(($nVersion >= 41004 && $nVersion < 50000) || ($nVersion >= 50202))
{
    fwrite( $hTemplate, "MapServer Template\n".$szTemplate );
}
//End of code modified by Normand Savard

--
Configure bugmail: http://bugzilla.maptools.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Chameleon-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/chameleon-dev
Loading...