Bug #61276

TCA property "exclusiveKeys" prevents from selecting an item

Added by Roland Waldner 11 months ago. Updated 11 months ago.

Status:Resolved Start date:2014-08-29
Priority:Must have Due date:
Assigned To:- % Done:

100%

Category:FormEngine aka TCEforms Spent time: -
Target version:next-patchlevel
TYPO3 Version:6.2 Is Regression:Yes
PHP Version:5.3 Sprint Focus:
Complexity:no-brainer

Description

In the TYPO3 backend the TCA property "exclusiveKeys" of column type "select" prevents a backend user from selecting an item if only one key is set.

It expects a string (list of) but only works if it is set to at least two keys seperated by a comma.

  • works: 'exclusiveKeys' => '-1,-999'
  • does not work: 'exclusiveKeys' => '-1'

"Does not work" means that no item can be selected at all - a JavaScript error is thrown instead.

Enclosed please find a screenshot of the error message the Chrome developer tools show.

Screenshot at Aug. 29 17-11-49.png (109.6 kB) Roland Waldner, 2014-08-29 17:28


Related issues

related to Core - Task #46357: Move TCEForms JS Code to external file - part 1 Resolved 2013-03-16

Associated revisions

Revision a869cd3a
Added by Roland Waldner 11 months ago

[BUGFIX] Make TCA property "exclusiveKeys" work with single key

It is necessary that "exclusiveValues" is a string in the JavaScript
method FormEngine.setSelectOptionFromExternalSource() because
in JavaScript strings (but not numbers) have a method match() which
is used in FormEngine.setSelectOptionFromExternalSource().

"exclusiveValues" representing a single key (e.g. -1) are of type
"Number" - in this case an JavaScript error is thrown when the
script calls match() on it.

This commit ensures that "exclusiveValues" is always casted to
String.

Resolves: #61276
Releases: 6.3, 6.2
Change-Id: I049a5e6d11b3b27be901baa1e00429ab200b9a04
Reviewed-on: http://review.typo3.org/32591
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision a4d88d1f
Added by Roland Waldner 11 months ago

[BUGFIX] Make TCA property "exclusiveKeys" work with single key

It is necessary that "exclusiveValues" is a string in the JavaScript
method FormEngine.setSelectOptionFromExternalSource() because
in JavaScript strings (but not numbers) have a method match() which
is used in FormEngine.setSelectOptionFromExternalSource().

"exclusiveValues" representing a single key (e.g. -1) are of type
"Number" - in this case an JavaScript error is thrown when the
script calls match() on it.

This commit ensures that "exclusiveValues" is always casted to
String.

Resolves: #61276
Releases: 6.3, 6.2
Change-Id: I049a5e6d11b3b27be901baa1e00429ab200b9a04
Reviewed-on: http://review.typo3.org/32600
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Roland Waldner 11 months ago

This Bug seems to be introduced with TYPO3 6.2 - worked with TYPO3 6.1.? before.

#2 Updated by Markus Klein 11 months ago

Which variable is undefined in the screenshot?

The related change is https://review.typo3.org/18971
But the code seems to be a 1:1 copy of the previous code, except that the configuration (incl. excludedKeys) are now handed over to JS via data-* attributes.

#3 Updated by Roland Waldner 11 months ago

Markus Klein wrote:

Which variable is undefined in the screenshot?

Sorry, I am not able to check this before the upcomming weekend.

#4 Updated by Markus Klein 11 months ago

  • Status changed from New to Needs Feedback

#5 Updated by Gerrit Code Review 11 months ago

  • Status changed from Needs Feedback 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 http://review.typo3.org/32591

#6 Updated by Gerrit Code Review 11 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32591

#7 Updated by Markus Klein 11 months ago

  • Complexity set to no-brainer
  • Is Regression changed from No to Yes

#8 Updated by Gerrit Code Review 11 months ago

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/32600

#9 Updated by Roland Waldner 11 months ago

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

Also available in: Atom PDF