Opened 14 years ago

Closed 14 years ago

#3363 closed defect (fixed)

Listing metadata key fail with srid word

Reported by: cavila Owned by: dmorissette
Priority: low Milestone: 5.6.2 release
Component: MapScript-PHP Version: 5.4
Severity: normal Keywords: metadata srid
Cc: sumariva@…

Description

Component: mapScript PHP or Mapserver C API.

I trying list all metadata keys set in a layer object by sequence scan using getNextKey.

But with the word 'srid'( case insensitive ) that key is lost even if I can get it is value by calling getMetadata. In past versions from mapserver I already noted this kind of failure with other words but did not get note on that. Looks like it has some problems with mapfile token words.

I using version 5.4.1 built from source with the following configure

./configure --with-proj --with-geos --with-ogr --with-gdal --with-php=/usr/lib64/php5/include/php --with-postgis --with-threads --with-wfs --with-wfsclient --with-wcs --with-wmsclient CFLAGS="-O2 -march=k8 -mtune=k8" CXXFLAGS="-O2 -march=k8 -mtune=k8"

Example case in PHP code:

$m = ms_newMapObj( '' );
$l = ms_newLayerObj( $m );
if ( $l->setMetadata( 'srid', '29130' ) != MS_SUCCESS )
  exit( 'FATAL MAP ERROR' );
$key = null;
$output = array();
while ( !is_null( $key = $l->metadata->nextkey( $key ) ) )
 $output[] = $key;
var_dump( __LINE__, $output );
var_dump( __LINE__, $l->getMetadata( 'srid' ) );

Change History (2)

comment:1 by dmorissette, 14 years ago

Milestone: 5.4.3 release5.6.2 release
Owner: changed from mapserverbugs to dmorissette
Status: newassigned

The PHP wrapper for metadata.nextkey() was passing an empty string to the lower level C code instead of NULL as expected.

I have fixed this in SVN trunk r9919 and will backport to the 5.6 branch. I won't backport to 5.4 since we do not expect more releases of that branch.

comment:2 by dmorissette, 14 years ago

Resolution: fixed
Status: assignedclosed

(I forgot to write that the problem with the NULL arg was on the first call only of course)

Backported the fix to branch-5-6 in r9920

Note: See TracTickets for help on using tickets.