[TYPO3-core] RFC #9803: getTreeList causes duplicate entry sql error in cache_treelist
Christian Kuhn
lolli at schwarzbu.ch
Wed Oct 21 00:27:22 CEST 2009
Hey Rupert,
Rupert Germann wrote:
> took me a while to get empty cache entries in the table.
> The main point is that this happens only if getTreelist is called with a
> positive ID (which does not happen in the core)
>
> your patch works, but I think you fix the problem at the wrong end. If
> empty results are not returned they should of course not be cached at all.
>
> see attached patch where I moved the check for the empty result to the
> insert query.
The method returns an empty string if no subpages are found (and if $id
is a positive int). So, why not cache the empty result, this will save
some executed code and queries (at minimum a sys_page->getRawRecord
query and the $res query. More for special situations like mountpoints).
What do you think?
Thanks
Christian
More information about the TYPO3-team-core
mailing list