Project

General

Profile

Actions

Bug #67874

closed

scheduler ext_localconf.php overrides pre-populated options/tables array

Added by Daniel Neugebauer almost 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
-
Start date:
2015-07-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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:

  1. 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'
    );
  2. Clear typo3temp and caches, just in case.
  3. Check Configuration in BE: There's no tx_formhandler_log defined, only the default tables sys_log and sys_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

t62_scheduler_options.patch (2.57 KB) t62_scheduler_options.patch patch for TYPO3 6.2 Daniel Neugebauer, 2015-07-01 19:38
t74dev_scheduler_options.patch (2.7 KB) t74dev_scheduler_options.patch patch for TYPO3 7.4dev from Git Daniel Neugebauer, 2015-07-01 19:38
Actions

Also available in: Atom PDF