Bug #80197
closedEXT:form - label with periods causes PHP warning
100%
Description
When using a select field and the label of an option contains a period, the SelectVH throws an exception: 1476107295: PHP Warning: get_class() expects parameter 1 to be object, array given in ...ypo3/sysext/fluid/Classes/ViewHelpers/Form/SelectViewHelper.php line 219.
Updated by Claus Due almost 8 years ago
- Category changed from Fluid to Form Framework
This is by design - if a patch should be made, it should be in EXT:form and should throw errors or use another method to prevent dots from being used in field names.
The same applies when you're making an Extbase plugin: a dotted field name has implicit meaning to Extbase's mapper and means you want to address a sub-property by path. So, `f:form.select` (and others!) cannot be used this way.
Category changed to Form Framework to allow others to evaluate how to prevent this.
Updated by Björn Jacob almost 8 years ago
- Subject changed from EXT:form - label with periods cazses PHP warning to EXT:form - label with periods causes PHP warning
Thx Claus for your feedback. We will think about handling this issue. Maybe just add this to the documentation. We want to be as close as possible to the default behaviour ;)
Updated by Ralf Zimmermann over 7 years ago
- Status changed from New to Needs Feedback
- Assignee set to Björn Jacob
I cannot confirm this for 8.7.2 and 9.0.0-dev.
type: SingleSelect identifier: singleselect-1 label: 'Single select' properties: options: bar.foo: 12.12.2012
The select-option label and value contains dots and the frontend renders this without any PHP warnings or errors.
Could you please provide a form definition to reproduce this issue?
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Needs Feedback to New
I just tried with the latest master, and added a "single select options" field with the following options (label|value):
te,st | te,st te.st | te.st te;st | te;st te,st.st;st | te,st.st;st
Saving the form went without errors, and so the frontend display, but... when I tried to edit again the form with the form module, it is not loading anymore (infinite spinning loading). I checked with chrome console for errors and found:
Uncaught TypeError: Cannot create property 'st;st' on string 'te,st' at Object.set (Core.js?bust=4a2d0c1…:812) at extendModel (Core.js?bust=4a2d0c1…:722) at extendModel (Core.js?bust=4a2d0c1…:720) at extendModel (Core.js?bust=4a2d0c1…:720) at createModel (Core.js?bust=4a2d0c1…:982) at createFormElement (Core.js?bust=4a2d0c1…:1820) at createFormElement (Core.js?bust=4a2d0c1…:1878) at createFormElement (Core.js?bust=4a2d0c1…:1878) at createFormElement (Core.js?bust=4a2d0c1…:1878) at Object.createFormElement (Core.js?bust=4a2d0c1…:1878)
I also peeked at the .yaml file and found:
[...] properties: options: 'te,st': 'te,st' te.st: te.st te;st: te;st 'te,st.st;st': 'te,st.st;st' prependOptionLabel: 'te,st' type: SingleSelect identifier: singleselect-1 label: 'Single select' [...]
Updated by Riccardo De Contardi over 7 years ago
- Related to Bug #81961: EXT:form If values in single select field contains dots (f.e. emails) JS saving and rendering fails. added
Updated by Björn Jacob over 7 years ago
- Assignee deleted (
Björn Jacob) - Sprint Focus set to Remote Sprint
Updated by Björn Jacob over 7 years ago
- Related to Bug #82210: ext:form multi checkbox values containing . or & result in empty frontend labels added
Updated by Daniel Gohlke over 7 years ago
This is only happen when the value contains a dot. Labels with dots seems to work.
test1: test.test
test2: test,test
test3: test;test
test4: test,test.test;test
The option
test1.test2: test3
is interpreted as "test1" for the value, and "[object Object]" for the label.
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53956
Updated by Gerrit Code Review over 7 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53956
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53956
Updated by Gerrit Code Review over 7 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53956
Updated by Gerrit Code Review over 7 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53956
Updated by Gerrit Code Review over 7 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53956
Updated by Oliver Hader over 7 years ago
The PHP warning is the result of the YAML is incorrectly persisted (after saving twice from the wizard).
e.g.
options: what.ever: what.ever
becomes
options: what: ever: what.ever
In this case, the YAML has to be adjusted again.
Updated by Ralf Zimmermann over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c801d388547e96df42baff3f023d6a7b8f733b34.
Updated by Gerrit Code Review over 7 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53984
Updated by Ralf Zimmermann over 7 years ago
- Status changed from Under Review to Resolved
Applied in changeset b4b32de503ef0eb4df520dc0cf41f0fd84376bb3.