[TYPO3-english] HMENU/TMENU mixes userfunction and a ghost sitemap

Daniel Neugebauer mailinglists at energiequant.de
Mon Mar 5 17:41:10 CET 2012


Hi!

We are currently working on some patches to elemente_fenews [1] (version 
from SVN), which is an extension for FE tt_news creation and editing.

Users are supposed to be able to select one or multiple tt_news 
categories their news should being associated with. This is done by 
rendering a HMENU object using cObjGetSingle [2] with 
special.userfunction getSelectionMenu [3]. TypoScript is defined in [4]. 
We had to disable the user function's skipFirst option when using just 
one category level but that should not matter for this issue.

If we use just one category level we get what seems to be a correct 
output from the user function:

------>
Array
(
     [0] => Array
         (
             [uid] => 1
             [title] => GB-Cat 1
             [title_lang_ol] =>
             [shortcut] => 0
             [_SUB_MENU] => Array
                 (
                 )

         )

     [1] => Array
         (
             [uid] => 2
             [title] => GB-Cat 2
             [title_lang_ol] =>
             [shortcut] => 0
             [_SUB_MENU] => Array
                 (
                 )

         )

)
<------

As you can see, it has no "sub menus". But: If we let it render this 
way, it lists parts of the site's page structure on a second category 
level (like a sitemap).

As soon as we add sub-categories in tt_news (being located below 
_SUB_MENU), those ghost entries vanish. If we unset them before the call 
to cObjGetSingle, we get a ghostly sitemap again.

How is this even possible? There is no cross-access to the pages table, 
the recursed function getSubSelectionMenu [5] does not get any results 
from the database. Is Typo3 seeing some left-over garbage from some 
previously used HMENU/TMENU data that appears as an overlay to the data 
from the user function? If so, how can we clear it?

I don't think there's a problem with the extension's code, but maybe 
something may has been forgotten to set in TypoScript? I consider this 
behaviour highly unusual - could it be a bug in Typo3 core?

We are using Typo3 4.5.11.

Thanks,
Daniel


[1] http://forge.typo3.org/projects/extension-elemente_fenews/

[2] 
http://forge.typo3.org/projects/extension-elemente_fenews/repository/entry/trunk/pi1/class.tx_elementefenews_pi1.php#L936

[3] 
http://forge.typo3.org/projects/extension-elemente_fenews/repository/entry/trunk/lib/class.user_selectionMenu.php#L46

[4] 
http://forge.typo3.org/projects/extension-elemente_fenews/repository/entry/trunk/static/ts/setup.txt#L57

[5] 
http://forge.typo3.org/projects/extension-elemente_fenews/repository/entry/trunk/lib/class.user_selectionMenu.php#L129


More information about the TYPO3-english mailing list