Opened 3 years ago

Closed 3 years ago

#629 closed defect (fixed)

Doubles with value 0.0 are shown as empty strings

Reported by: morkl Owned by: madair
Priority: P2 Milestone: Future
Component: MapGuide Version: SVN
Severity: Major Keywords:
Cc: Browser: All
External ID: Operating System: All
state: New

Description

When selecting a feature with attributes of type double and value 0.0, the attributes values are displayed as empty strings.

In GetPropertyValueFromFeatReader? in layers/MapGuide/php/Utilities.php, the value is set to "" if equal to null:

    if ( null == $val ) {
      $val = "";
    }

However, the following is true/truthy in PHP:

    ( null == 0.0 )

The check should probably be done with the identity/type equality operator:

    if ( null === $val ) {
      $val = "";
    }

Attachments (1)

629.patch (368 bytes) - added by morkl 3 years ago.
Patch

Download all attachments as: .zip

Change History (2)

Changed 3 years ago by morkl

Attachment: 629.patch added

Patch

comment:1 Changed 3 years ago by jng

Resolution: fixed
Status: newclosed

Fixed trunk (r2882) and 2.6 (r2883). Thanks for the patch.

Note: See TracTickets for help on using tickets.