Bug #88426
closedExtension Configuration: IDs duplicated and incorrect checkbox handling for same config key in different extensions
100%
Description
When saving an extension config (Settings › Extension Configuration) that consists only of checkboxes and none is checked you get a warning.
Depending on your exception settings that can trigger an exception which prevents the settings form being written.
AJAX:
/typo3/install.php?install[controller]=settings&install[context]=backend
"TYPO3_MODE":"BE","exception":"TYPO3\\CMS\\Core\\Error\\Exception: PHP Warning: Invalid argument supplied for foreach() in \/var\/www\/html\/webroot\/web\/typo3\/sysext\/install\/Classes\/Controller\/SettingsController.php line 387 in \/var\/www\/html\/webroot\/web\/typo3\/sysext\/core\/Classes\/Error\/ErrorHandler.php:116 Stack trace: #0 \/var\/www\/html\/webroot\/web\/typo3\/sysext\/install\/Classes\/Controller\/SettingsController.php(387): TYPO3\\CMS\\Core\\Error\\ErrorHandler->handleError(2, 'Invalid argumen...', '\/var\/www\/html\/w...', 387, Array) #1 \/var\/www\/html\/webroot\/web\/typo3\/sysext\/install\/Classes\/Http\/RequestHandler.php(205): TYPO3\\CMS\\Install\\Controller\\SettingsController->extensionConfigurationWriteAction(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest)) #2 \/var\/www\/html\/webroot\/web\/typo3\/sysext\/install\/Classes\/Http\/Application.php(65): TYPO3\\CMS\\Install\\Http\\RequestHandler->handle(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest)) #3 \/var\/www\/html\/webroot\/web\/typo3\/sysext\/core\/Classes\/Http\/AbstractApplication.php(110): TYPO3\\CMS\\Install\\Http\\Application->handle(Object(TYPO3\\CMS\\Core\\Http\\ServerRequest)) #4 \/var\/www\/html\/webroot\/web\/typo3\/install.php(104): TYPO3\\CMS\\Core\\Http\\AbstractApplication->run() #5 \/var\/www\/html\/webroot\/web\/typo3\/install.php(105): {closure}() #6 {main}"
Updated by Guido Schmechel over 5 years ago
Do you have an example config?
I see "extensionmanager" as example with two checkboxes. Both unchecked gives me this result:
array(2 items)
automaticInstallation => '0' (1 chars)
offlineMode => '0' (1 chars)
# cat=basic/enable; type=boolean; label=LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:config.automaticInstallation
automaticInstallation = 1
# cat=basic/enable; type=boolean; label=LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:config.offlineMode
offlineMode = 0
Updated by Jonas Eberle over 5 years ago
You are right, there is no error with "extensionmanager"...
But with this in ext_conf_template.txt in a custom extenstion I get the error:
# cat=basic/enable; type=boolean; label=Enable debug logging isDebug = 0
I'll debug what's going on there.
Updated by Jonas Eberle over 5 years ago
It is triggered if (another extension) uses the same setting key.
In that case only the first occurence of the checkbox gets the value=0 hidden-field prepended.
Also the id is duplicated.
This is the output:
<form ... data-extensionkey="...extension1..."> ... <input type="hidden" name="isDebug" value="0"> <input type="checkbox" name="isDebug" value="1" id="em-isDebug" checked="checked"> ... </form> ... <form ... data-extensionkey="...extension2..."> ... <input type="checkbox" name="isDebug" value="1" id="em-isDebug" checked="checked"> ... </form>
I'll try to provide a patch.
Updated by Jonas Eberle over 5 years ago
- Subject changed from Extension Configuration: Warning on save when all checkboxes unchecked to Extension Configuration: IDs duplicated and incorrect checkbox handling for same config key in different extensions
Updated by Gerrit Code Review over 5 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/+/60831
Updated by Gerrit Code Review over 5 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/+/60831
Updated by Gerrit Code Review over 5 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/c/Packages/TYPO3.CMS/+/60831
Updated by Jonas Eberle over 5 years ago
This can be reproduced by duplicating any ext_conf_template.txt that contains a checkbox from one extension to another.
Updated by Gerrit Code Review over 5 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/c/Packages/TYPO3.CMS/+/60831
Updated by Gerrit Code Review over 5 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/c/Packages/TYPO3.CMS/+/60831
Updated by Anonymous over 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7fdb0f0b8de2e97c4073a97d3af269d9eeeca274.
Updated by Benni Mack almost 5 years ago
- Status changed from Resolved to Closed