Opened 21 years ago

Closed 20 years ago

#410 closed defect (fixed)

mapObj->processtemplate() is broken

Reported by: stevem@… Owned by: dmorissette
Priority: high Milestone:
Component: MapScript-PHP Version: 4.0
Severity: major Keywords:
Cc: jmckenna@…

Description

Starting with version 4.0, the mapObj->processtemplate() method no longer 
works. On Windows 2000 (running Apache 2.0.45 and PHP 4.3.2), a very 
simple .map file and .html template work fine when run through the MapServer 
CGI. However, the following PHP script, which should return exactly the same 
web page as the CGI invokation, does nothing:

<?php
  $mapfile = "C:\Programs\ApacheGroup\Apache2\htdocs\simple\simple.map";
  $mo = ms_newMapObj($mapfile);
//  echo $mo->getProjection();
  $tmparray["mode"] = "browse";
  echo $mo->processtemplate($tmparray, MS_TRUE);
?>

I can verify that there is no typo in the map filename, since when I uncomment 
the call to getProjection(), I get a string representation of my map's 
projection, as expected.

Under Linux (Slackware 9.0, PHP 4.3.1, Apache 1.3.x), the behaviour is similar. 
The above script crashes PHP (Segmentation fault), whether it is run through 
the web server, or run at the command-line (using the CLI php executable).

Change History (2)

comment:1 by dmorissette, 20 years ago

Cc: mckenna@… assefa@… added
Status: newassigned
Um... after a quick browse of the code I think I see the problem... and after
checking the CVS logs it appears that *I* introduced that problem in MapServer
4.0 (maptemplate.c r1.54) while fixing memory leaks found in bug 171... what a
shame!

Looking into this now.

comment:2 by dmorissette, 20 years ago

Resolution: fixed
Status: assignedclosed
Fixed in V4.3 (CVS) and in 4.2 branch (will be in 4.2.1).

The problem was a broken test on the return value of msReturnPage() in
msProcessTemplate() in maptemplate.c
Note: See TracTickets for help on using tickets.