Project

General

Profile

Actions

Bug #81961

closed

EXT:form If values in single select field contains dots (f.e. emails) JS saving and rendering fails.

Added by Andriy Khamuliak almost 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Form Framework
Target version:
Start date:
2017-07-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Remote Sprint

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 '' which brakes all splitting logic.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #80197: EXT:form - label with periods causes PHP warningClosed2017-03-08

Actions
Actions #1

Updated by Riccardo De Contardi almost 7 years ago

Is this related? #80197

Actions #2

Updated by Andriy Khamuliak almost 7 years ago

  • Category changed from FormEngine aka TCEforms to Form Framework
Actions #3

Updated by Andriy Khamuliak almost 7 years ago

Yes, partially. I didn't noticed any errors in FE, but if I create a single select at form and put '' 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.

Actions #4

Updated by Riccardo De Contardi almost 7 years ago

  • Related to Bug #80197: EXT:form - label with periods causes PHP warning added
Actions #5

Updated by Andriy Khamuliak almost 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.

Actions #6

Updated by Björn Jacob almost 7 years ago

  • Sprint Focus set to Remote Sprint
Actions #7

Updated by Gerrit Code Review almost 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

Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Gerrit Code Review almost 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

Actions #10

Updated by Gerrit Code Review almost 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

Actions #11

Updated by Gerrit Code Review almost 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

Actions #12

Updated by Gerrit Code Review almost 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

Actions #13

Updated by Ralf Zimmermann almost 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #14

Updated by Gerrit Code Review almost 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

Actions #15

Updated by Ralf Zimmermann almost 7 years ago

  • Status changed from Under Review to Resolved
Actions #16

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF