#710 closed defect (fixed)
PATCH: selection containing Datetime values causes exception
Reported by: | poulet1212 | Owned by: | trevorwekel |
---|---|---|---|
Priority: | high | Milestone: | 2.2 |
Component: | Fusion | Version: | 2.0.2 |
Severity: | major | Keywords: | mgdatetime selection exception |
Cc: | External ID: | 1127807 |
Description
File: www\fusion\mapguide\php\Utilities.php
Function function BuildSelectionArray, around line 865
The code here:
$value = GetPropertyValueFromFeatReader(...); $value = htmlentities($value);
Should be changed like this (to avoid exeption of htmlentities on an MGDateTime object)
$value = GetPropertyValueFromFeatReader(...); if($value instanceof MgDateTime) $value = printDateTime($value); $value = htmlentities($value);
where printDateTime is a String representation of MGDateTime Object:
function printDateTime($mgDateTime) { $dayToday = $mgDateTime->GetDay(); $month = $mgDateTime->GetMonth(); $year = $mgDateTime->GetYear(); return $dayToday.".".$month.".".$year; }
cheers, Rémy
Change History (4)
comment:1 by , 16 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 16 years ago
External ID: | → 1127807 |
---|
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 by , 16 years ago
Yes, good idea to use ToString() in place of this printDateTime() function, didn't knew it :-)
Note:
See TracTickets
for help on using tickets.
A simpler fix is to call ToString() method on the MgDateTime object to return a human-readable string.
Fix has been put into 2.0.x stream with http://trac.osgeo.org/mapguide/changeset/3349