[TYPO3-core] RFC #14052: cache_treelist is out of date after setting hidden=0
Steffen Gebert
steffen at steffen-gebert.de
Sat Apr 10 16:38:31 CEST 2010
Hi,
This is an SVN patch request.
Type: Bugfix
Bugtracker references:
http://bugs.typo3.org/view.php?id=14052
Branches: trunk, 4.3
Problem:
In a FE plugin, $this->cObj->getTreelist($pid, $depth) gives you all pages
below $pid and uses the treeline cache (saved in cache_treeline) to
accellerate it.
When a page was set to hidden and then changed to be visible, the cache
entry isn't removed. Only cache entries containing the changed uid are
removed. As a hidden can't be inside a treelist, no entries are cleared,
but the outdated ones of all parent pages stay.
Solution:
Don't use "uidInTreelist" as action for the cache clearing (as uid is
contained nowhere, see above), but use "allParents" instead, see
tx_cms_treelistCacheUpdate::determineClearCacheActions [1]. This will
remove all the cache entries of all parent pages (which is the only
correct behavior IMHO)
Note:
As mentioned in the BT entry, there might be other fields, which should
cause "allParents" clearing after changes.
How to reproduce:
For the reviewer's convenience I've attached a small extension, which
calls getTreeList() and prints the results for you.
Just place this plugin (Demo für bug #14052) on a page containing
subpages, e.g.:
> Page with the demo plugin
> + Subpage A
> + Subpage B
- Modify A and set it to hidden -> getTreeList() returns only B.
- Modify A and make it visible -> getTreeList() still returns only B.
As you can see in cache_treelist, the entry still exists and wasn't
removed by unhiding A. It will vanish only after clearing the complete
cache.
Apply the patch, try again :)
Thanks for your review, guys!
Steffen
[1]
http://www.t3node.com/typo3api/trunk/df/d78/class_8tx__cms__treelistcacheupdate_8php-source.html#l00385
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 14052.diff
Type: text/x-diff
Size: 1153 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100410/d4c92203/attachment-0001.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: T3X_bug_14052-0_0_0-z-201004101621.t3x
Type: application/octet-stream
Size: 6176 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100410/d4c92203/attachment-0001.obj>
More information about the TYPO3-team-core
mailing list