Project

General

Profile

Actions

Bug #67874

closed

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

Added by Daniel Neugebauer over 9 years ago. Updated about 6 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 #1

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

Actions #2

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

Actions #3

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.

Actions #4

Updated by Anonymous over 9 years ago

  • Status changed from Under Review to Resolved
Actions #5

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

Actions #6

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

Actions #7

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

Actions #8

Updated by Wouter Wolters over 9 years ago

  • Status changed from Under Review to Resolved
Actions #9

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF