Project

General

Profile

Actions

Bug #67082

closed

TMENU Userfunc ( (itemArrayProcFunc, IProcFunc) not cached

Added by Peter Linzenkirchner almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2015-05-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

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

Bildschirmfoto 2015-05-21 um 13.27.41.png (12.5 KB) Bildschirmfoto 2015-05-21 um 13.27.41.png correct output (only first hit after deleting system cache) Peter Linzenkirchner, 2015-05-21 13:40
Bildschirmfoto 2015-05-21 um 13.28.20.png (7.26 KB) Bildschirmfoto 2015-05-21 um 13.28.20.png incorrect output (after first hit) Peter Linzenkirchner, 2015-05-21 13:40
Actions #1

Updated by Markus Klein almost 9 years ago

  • Category set to Caching
  • Target version set to 6.2.13
  • Sprint Focus set to Stabilization Sprint
Actions #2

Updated by Frank Nägler almost 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.

Actions #3

Updated by Peter Linzenkirchner almost 9 years ago

Sorry for the delay!
Of course i can give you the code, no secrets in it: http://pastebin.com/BwVcn8tv

Actions #4

Updated by Frank Nägler almost 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.

Actions #5

Updated by Peter Linzenkirchner almost 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.

Actions #6

Updated by Frank Nägler almost 9 years ago

well, thank you for the tests :(

Actions #7

Updated by Frank Nägler almost 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.

Actions #8

Updated by Mathias Schreiber almost 9 years ago

  • Target version deleted (6.2.13)
Actions #9

Updated by Alexander Opitz over 8 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.

Actions

Also available in: Atom PDF