Opened 13 years ago

Closed 13 years ago

#3815 closed defect (fixed)

Properties cannot be set at mapObj level in PHP MapScript

Reported by: dmorissette Owned by: dmorissette
Priority: normal Milestone: 6.0 release
Component: MapScript-PHP Version: unspecified
Severity: normal Keywords:
Cc: aboudreault, francesco.pirotti@…

Description

Reported by Francesco Pirotti on mapserver-users:

I cannot use PHPMapscript to set values either using:
$mapobj->shapepath = "<path>" and
$mapobj->set("shapepath", "<path>") but nothing get set (I echo the
value and it is still the old value).

(this was using 6.0.0-beta4)

Change History (2)

comment:1 by dmorissette, 13 years ago

Status: newassigned

Here is a simple test script that reproduces the issue:

<pre>
<?php

$map = ms_newmapobj("");
echo "shapepath = ".$map->shapepath. "\n\n";

$map->set("shapepath", "ttt");
echo "shapepath = ".$map->shapepath. "\n\n";

$map->shapepath = "ttt2";
echo "shapepath = ".$map->shapepath. "\n\n";

?>
</pre>

It turns out that there is a problem in the mapObj._set() method in mapscript/php/map.c. Ther macro IF_GET_*() is called instead of IF_SET_*() for each class member variable.

comment:2 by dmorissette, 13 years ago

Resolution: fixed
Status: assignedclosed

I have fixed the problem for the top-level mapObj->_set() method in SVN trunk r11483.

I did a quick review of the other class wrappers and those that have member variables to set all seem correct.

Note: See TracTickets for help on using tickets.