Bug #67082
closedTMENU Userfunc ( (itemArrayProcFunc, IProcFunc) not cached
0%
Description
Userfunc in TMENU (itemArrayProcFunc, IProcFunc)
Typoscript: http://pastebin.com/kAHTJA4V
All caches disabled (config.no_cache = 1)
Use-Case:
Menu of an projects extension - every menu item = category of the extension. 2 menu levels (see file 1 for correct output, file 2 for missing categories from userfunc)
problem:
- the menu worked in TYPO3 4.5, with and without cache
- in TYPO3 6.2 the menu works only when the user is logged in the backend
- or after deleting the system cache in the backend for exactly one hit. There is no difference if the cache is disabled or not).
- in contrary to the menu the projects extension output works all the time
- the extension itself works correct when the cache is activated (the cHash is appended correctly)
Conclusion:
It seems that the menu is cached in the system cache (or menu cache) but without the result of the user funcs.
Files
Updated by Markus Klein over 9 years ago
- Category set to Caching
- Target version set to 6.2.13
- Sprint Focus set to Stabilization Sprint
Updated by Frank Nägler over 9 years ago
- Status changed from New to Needs Feedback
can you please show us the userFunc, imo the cache looks good.
If it is not possible to show us the code, maybe anonymize the code? I think this could help us.
Updated by Peter Linzenkirchner over 9 years ago
Sorry for the delay!
Of course i can give you the code, no secrets in it: http://pastebin.com/BwVcn8tv
Updated by Frank Nägler over 9 years ago
ok, you extend from tslib_pibase
, which is an alias for TYPO3\CMS\Frontend\Plugin\AbstractPlugin
Within this class, we have a lot cache logic. You also overwrite the __construct()
method, which original contains cache logic/init stuff.
Did you need the t3lib_pibase
class? can you try not extending the class? Or maybe call parent::__construct()
in your constructor?
Also check the caching settings of t3lib_pibase
.
Updated by Peter Linzenkirchner over 9 years ago
OK, i tried first parent::__construct() within my constructor, but it changed nothing. Then i deleted the constructor und the extending of tslib_pibase. I had disable a few line because $this->pi_linkTP_keepPIvars_url is used to build the links. But in the end nothing changes, the menu is displayed only one time after deleting the system cache.
Updated by Frank Nägler over 9 years ago
I have testet it now with a simple test class, which create entries in the menu, this works well without any cache problems.
The rendered menu is cached. I think the problem must be part of your class. it is difficult to fix a problem, if it is not possible to reproduce.
Can you reduce your class to a minimum of logic, e.g. without DB queries and so on. for example like this:
class tx_mpreferencedb_itemsProcFunc { public function unitsItemArrayProcFunc($menuArr,$conf){ $count = 0; foreach ($menuArr as &$item) { $item['title'] = 'Foo ' . (time() + $count++); } return $menuArr; } }
If this works, maybe you can add your old code step by step until the problem occurs again.
Updated by Alexander Opitz about 9 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.