Bug #31920
closed
Form element with attribute value "0"
Added by Arjen Hoekema about 13 years ago.
Updated about 6 years ago.
Description
It should be possible to create form fields/elements with attributes containing "0".
Currently all attributes are checked with "empty()" which returns false upon 0 and "0".
Functions which contain "empty()" check:
tx_form_View_Form_Element_Abstract->setAttribute
tx_form_View_Form_Element_Abstract->setAttributes
tx_form_View_Form_Element_Abstract->setAttributeWithValueofOtherAttribute
- Status changed from New to Accepted
- Target version set to 4.6.1
- Target version changed from 4.6.1 to 4.6.2
- Target version deleted (
4.6.2)
- Status changed from Accepted to Under Review
Unfortunately this bug is still present in 6.2.4. Was one of the patches applied back then?
Current workaround (which breaks each time you use the visual editor):
10 = TEXTLINE
10 {
name = fieldname
value (
0
)
label {
value = Field title
}
}
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/9021
The issue is still present in TYPO3 7 and 6.2, but the patches before patch set 5 did not help..
It isn't possible in the form wizard to set default values for inputs.
To test/replicate: create a new form with the following content:
prefix = tx_form
10 = TEXTLINE
10 {
name = test1
value = 10
label {
value = test1
}
}
20 = TEXTLINE
20 {
name = test2
value = 0
label {
value = test2
}
}
Expected: input test2 has a default value of "0", but is empty ("") instead. patch set 5 solves this.
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35443
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Category changed from Form Framework to 1602
- Is Regression set to No
- Category changed from 1602 to Form Framework
- Status changed from Resolved to Closed
Also available in: Atom
PDF