Bug #67874
closedscheduler ext_localconf.php overrides pre-populated options/tables array
100%
Description
Judging from the comment "Initialize option array of table garbage collection task if not already done by some other extension or localconf.php" and practical considerations, it should have been possible to add entries to the ['options']['tables']
array from either extensions or localconf. While it may have been working for extensions, it appears like it never actually did for localconf as the parent array is being redefined as a whole since it was introduced in d8bdda72
(not sure if at some point localconf was processed after all ext_localconf.php
files were loaded but I don't think so?). At least it doesn't in neither 6.2 nor 7.4 if entered in AdditionalConfiguration.php
.
To reproduce:
- Add some table entry to your
AdditionalConfiguration.php
, e.g.
for TYPO3 6.2:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']['tx_formhandler_log'] = array( 'dateField' => 'tstamp', 'expirePeriod' => '1' );
for TYPO3 7.4dev:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['tx_formhandler_log'] = array( 'dateField' => 'tstamp', 'expirePeriod' => '1' );
- Clear
typo3temp
and caches, just in case. - Check Configuration in BE: There's no
tx_formhandler_log
defined, only the default tablessys_log
andsys_history
. Creating a scheduler task "Table garbage collection" doesn't list tx_formhandler_log as a table to clear.
Expected:
- Array should retain the table set up in
AdditionalConfiguration.php
, it should be listed in Configuration and be available on scheduler task creation.
Problematic assignment in ext_localconf.php
:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask'] = array( // omitted... );
I noticed this in 6.2 and fixed it by saving the options array and restoring it upon parent array creation. Then I ported & tested my patch on 7.4dev as well. Patches attached, submission to Gerrit for code review follows in a second (only against master for now, as contribution guide says I should wait with backporting to 6.2 until the master patch has been accepted).
Files
Updated by Gerrit Code Review over 9 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 http://review.typo3.org/40830
Updated by Gerrit Code Review over 9 years 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/40830
Updated by Christian Kuhn over 9 years ago
very good analysis. you're perfectly right. additional thanks for pushing a patch for this. i reviewed it now, looks fine to me.
Updated by Anonymous over 9 years ago
- Status changed from Under Review to Resolved
Applied in changeset c575aadc7f880cee76a6e575942ec97c07fcba3e.
Updated by Gerrit Code Review over 9 years ago
- Status changed from Resolved to Under Review
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/40939
Updated by Gerrit Code Review over 9 years ago
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/40940
Updated by Gerrit Code Review over 9 years ago
Patch set 2 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/40939
Updated by Wouter Wolters over 9 years ago
- Status changed from Under Review to Resolved
Applied in changeset af3122d9b7fb42af3527ed1a56a3c8abb2b0e53a.