Bug #81961
closedEXT:form If values in single select field contains dots (f.e. emails) JS saving and rendering fails.
100%
Description
If value of single select field contain dots it fails after saving.
Value with dots should be escaped and saved to yaml in some special notations, because key with dots will fail yaml to array convert also.
So if value of single select field need to be used as recipient email it will not work as it work with any other field where email will be saved as a value in yaml and not as a key as it is in case of single select field.
Reason of bad saving is that all options in JS are splitted by dots.
Core.js line 796
while (path.indexOf('.') > 0) {
var firstPartOfPath, nextPartOfPath;
firstPartOfPath = path.slice(0, path.indexOf('.'));
path = path.slice(firstPartOfPath.length + 1);
if ($.isNumeric(firstPartOfPath)) {
firstPartOfPath = parseInt(firstPartOfPath);
}
if ('undefined' === $.type(obj[firstPartOfPath])) {
nextPartOfPath = path.slice(0, path.indexOf('.'));
if ($.isNumeric(nextPartOfPath)) {
obj[firstPartOfPath] = [];
} else {
obj[firstPartOfPath] = {};
}
}
obj = obj[firstPartOfPath];
}EXT:form If values in single select field contains dots (f.e. emails) JS saving and rendering fails.
So if value of single select field need to be used as recipient email it will not work as it work with any other field where email will be saved as a value in yaml and not as a key as it is in case of single select field.
As usual 'path' variable here contains value - 'properties.options.VALUE', but in case if value contain dots there is 'properties.options.my.email@test.com' which brakes all splitting logic.
Updated by Andriy Khamuliak over 7 years ago
- Category changed from FormEngine aka TCEforms to Form Framework
Updated by Andriy Khamuliak over 7 years ago
Yes, partially. I didn't noticed any errors in FE, but if I create a single select at form and put 'test.mail@gmail.com' into value field, after safe I will get there
'[object Object]' as a Label and 'test' as value. but data is written correctly to Yaml first time. After next form saving I will obviously broke my yaml config.
Updated by Riccardo De Contardi over 7 years ago
- Related to Bug #80197: EXT:form - label with periods causes PHP warning added
Updated by Andriy Khamuliak over 7 years ago
Also there is an issue when there is two identical same values in single select. I think it's just how yaml work, so there can't be 2 same keys in configuration, but.. this is a little bit confusing also. If there is 2 same values - only first record is read from yaml and rendered at FE.
Updated by Gerrit Code Review about 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 about 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 about 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 about 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 about 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 about 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 Ralf Zimmermann about 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 about 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 about 7 years ago
- Status changed from Under Review to Resolved
Applied in changeset b4b32de503ef0eb4df520dc0cf41f0fd84376bb3.