Skip to content

Admin-UI: Using the label 'True' or 'False' in a select (dropdown) displays incorrect labels.  #5093

Closed
@CaMer0n

Description

@CaMer0n

Bug Description

A clear and concise description of what the bug is.

How to Reproduce

$fields['example'] =  array(
    'title'=> 'My title', 
    'type'=>'dropdown', 
    'data' => 'str', ' 
    'writeParms' => ['optArray'=>['true'=>'True', 'false'=>'False', 'other'=>'Other']]
);

Actual Behavior

<option value='true'>1</option>
<option value='false'></option>
<option value='other'>Other</option>

Expected Behavior

<option value='true'>True</option>
<option value='false'>False</option>
<option value='other'>Other</option>

Cause

True and False are constants in PHP, and the option() method checks for constants using defset() on labels before rendering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA problem that should not be happening

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions