Project

General

Profile

Actions

Bug #84997

closed

Localized records with rendertype selectCheckBox + defaultAsReadonly generate PHP warnings

Added by Michael Stopp over 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2018-05-14
Due date:
% Done:

100%

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

Description

If you open a localized records, which contains a field of type select and rendertype selectCheckBox, it will produce the following warning, if l10n_display is defaultAsReadonly:

Core: Error handler (BE): PHP Warning: array_flip() expects parameter 1 to be array, string given in [...]\typo3\sysext\backend\Classes\Form\Element\SelectCheckBoxElement.php line 71

Files


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #77257: The selection of a selectbox with the l10n_display type of defaultAsReadonly in TCA is wrong for a localized recordClosed2016-07-26

Actions
Related to TYPO3 Core - Bug #87472: PHP warning with checkboxes and l10n_display=defaultAsReadonlyClosed2019-01-17

Actions
Actions #1

Updated by Michael Stopp over 6 years ago

  • Related to Bug #77257: The selection of a selectbox with the l10n_display type of defaultAsReadonly in TCA is wrong for a localized record added
Actions #2

Updated by Michael Stopp almost 6 years ago

  • Related to Bug #87472: PHP warning with checkboxes and l10n_display=defaultAsReadonly added

Updated by Michael Stopp almost 6 years ago

The cause of the warning is described in #87472. The fix proposed by Dmitry will remove the PHP warning, but the element will still not be rendered correctly with the current implementations (8 LTS, 9 LTS).

The $disabled flag (set by $config['readOnly']) will always leave the $groups checkbox array empty and thus the field will never be rendered properly. The disabled property in the items array is hardcoded to false, which makes this ternary operator further below a bit nonsensical:

($item['disabled'] ? 'disabled=disabled ' : '')

I suggest the enclosed patches for a readonly rendering of the SelectCheckBox element (as the defaultAsReadonly option in TCA would suggest...).

Actions #4

Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/63722

Actions #5

Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/63722

Actions #6

Updated by Benni Mack over 4 years ago

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

Updated by Gerrit Code Review over 4 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63977

Actions #8

Updated by Benni Mack over 4 years ago

  • Status changed from Under Review to Resolved
Actions #9

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF