[TYPO3] userFunc in HMENU not working if the results array is too big (with templavoila)

Dmitry Dulepov [typo3] dmitry at typo3.org
Fri Jun 27 11:21:22 CEST 2008


Hi!

Olivier Schopfer wrote:
> It seems that HMENU has a bug when using a userFunc that returns a too 
> big array. If the number of results is limited, then it works perfectly. 
> If I have  around 350 items, it fails and I get a blank page. Strange 
> enough, it doesn't raise an error condition. Moreover, the admin pannel 
> is still displayed, and seems to show the proper content of the menu.
> 
> Any idea?

Do you have PHP error reporting enabled in Install tool?

> I have the following typoscript code in a TemplaVoilà data structure for 
> a page:

<skip>

>         allWrap = <div class="hb_link">|</div>

I assume you wrapped script with CDATA? Other it will produce invalid DS XML.

> And the code of the userFunc is:

<skip>

>       $local_cObj = t3lib_div::makeInstance('tslib_cObj'); // Local cObj.
>       $menuArr = array();
>       $subArr = array();
>       $lConf = $conf["userFunc."];
>       $value = $local_cObj->stdWrap($lConf["value"],$lConf["value."]);

Please, be consistent, use only single quotes :) This save several milliseconds for each request.

>       $res = 
> $GLOBALS['TYPO3_DB']->exec_SELECTquery($lConf["select."]["selectFields"],'pages',' 
> tx_templavoila_ds IN ( '.$lConf["datastructure"].') ORDER BY title ASC ');

<skip>

>       return $menuArr;

Resource leak: recordset is not freed. You'll get lots of memory leaks in Apache/MySQL if you use persistent MySQL connections.

-- 
Dmitry Dulepov
http://typo3bloke.net/


More information about the TYPO3-english mailing list