Ticket #77 (new defect)

Opened 3 months ago

Function "getGroupObject(..)" in MapServer/php/LoadMap.php not quering group information correctly

Reported by: schneiderei Assigned to: madair
Priority: P2 Milestone: 1.1
Component: MapServer Version: 1.0.6
Severity: Critical Keywords:
Cc: External ID:
state: New Browser: All
Operating System: All

Description

Line 262 in the file MapServer/php/LoadMap.php reads:

array_push($mapObj->groups, getGroupObject($oMap->getLayer($aLayerIndexes[0])));

The layer that is passed to getGroupObject(..) may or may not be a group layer. In the function getGroupObject(..), group information is queried from this layer through calls such as "$layer->getMetaData('groupLegendLabel')". It seems to me that group information is not returned if the layer is not a group layer. As a result, all metainformation specified for groups in the map file is ignored.

There are a number of solutions to this. One would be to just add a second parameter to the getGroupObject(..) function where the according group layer is passed. Line 262 then could look like this:

array_push($mapObj->groups, getGroupObject($oMap->getLayer($aLayerIndexes[0]), $oMap->getLayerByName($groupName)));

All metadata queries in getGroupObject(..) would then go to the group layer.