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