User tests: Successful: Unsuccessful:
Currently JFormAbstractlist (which means all list type formfields) ignores an option text set to 0. It will use the option value instead.
Changing the boolean check to a check against an empty string
Create or adjust an existing list formfield definition and add an option with any value but 0 as text to it. For example adjust the state field in the article.xml (https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/forms/article.xml#L31-L43) and add
<option value="text-0">0</option>
<option value="text-empty"></option>
to the options list. It should look like this then:
<field name="state" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1"
>
<option value="1">
JPUBLISHED</option>
<option value="0">
JUNPUBLISHED</option>
<option value="2">
JARCHIVED</option>
<option value="-2">
JTRASHED</option>
<option value="text-0">0</option>
<option value="text-empty"></option>
</field>
Check the field in the item form (in our example the article state).
Before PR you get two additional entries text-0
and text-empty
.
After PR you get two additional entries 0
and text-empty
.
None
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Milestone |
Added: |
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-11-08 09:01:52 |
Closed_By | ⇒ | rdeutz |
I have tested this item✅ successfully on 93c8fd2
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12814.