Bug #37948

additionalTreelistUpdateFields are not working

Added by Bart Dubelaar about 1 year ago. Updated 7 months ago.

Status:Under Review Start date:2012-06-12
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:Caching
Target version:-
TYPO3 Version:4.5 Complexity:
PHP Version:
Votes: 0

Description

The list of additionalTreelistUpdateFields is not correctly appended to the updateRequiringFields array in tx_cms_treelistCacheUpdate.
The += operator only appends array elements with non-matching keys.

Holds for 4.5 - 6.0.

History

Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11978

Updated by Georg Ringer about 1 year ago

can you give some more info:
- what was not correctly applied
- how can this be tested

Updated by Bart Dubelaar about 1 year ago

In typo3/sysext/cms/tslib/hooks there is a file tx_cms_treelistCacheUpdate.php. This file hooks into TCEmain processes to clear the cache_treelist cache when necessary.
There is a setting TYPO3_CONF_VARS['BE']['additionalTreelistUpdateFields'] where fields can be added that should be evaluated in order to see if the cache_treelist cache should be cleared. See the comments in the file itself:

// extension can add fields to the pages table that require an
// update of the treelist cache, too; so we also add those
// example: $TYPO3_CONF_VARS['BE']['additionalTreelistUpdateFields'] .= ',my_field';

On line 70 an array with these additional fields was added to the updateRequiringFields array with a += operator. However, this doesn't work as elements with matching keys are not appended when using this operator. As the original array already has 8 elements, with keys 0 to 7, any elements in the additionalTreelistUpdateFields array with keys 0 to 7 are not added.

This can be tested by adding a field to the pages table that controls frontend access to the page and adding it to TYPO3_CONF_VARS['BE']['additionalTreelistUpdateFields'].

Updated by Gerrit Code Review 7 months ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11978

Also available in: Atom PDF