[TYPO3-project-4-3] Improving the language overlay performance

Martin Kutschker masi-no at spam-typo3.org
Wed Sep 17 14:07:51 CEST 2008


Francois Suter schrieb:
> Hi,
> 
>> I didn't look at your code, but you said something about "exact matches
>> because of version" so I thought you did some extra processing for WS.
> 
> Ah true, yes, forgot about that.
> 
> It's just a pid check on the language overlay record to make sure that
> it's gotten from the right page. In t3lib_page::getRecordOverlay, the
> overlay is gotten with the following query:
> 
> $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
>     '*',
>     $table,
>     'pid='.intval($row['pid']).
>         ' AND
> '.$TCA[$table]['ctrl']['languageField'].'='.intval($sys_language_content).
>         ' AND
> '.$TCA[$table]['ctrl']['transOrigPointerField'].'='.intval($row['uid']).
>         $this->enableFields($table),
>     '',
>     '',
>     '1'
> );
> 
> Notice the condition on the pid, where the pid of the overlay must match
> the pid of the original. I asked about that in the dev-list and Dmitry
> answered that this check was necessary because of workspaces. I worked
> on from that. Thinking back on it, I'm not sure I understand 100% why
> this is necessary, because it seems to me that checking the
> transOrigPointerField should be enough...

Records on WS have always a pid set to -1.

> Maybe this test could be
> dropped and simply replaced by a check on the workspace (overlay should
> be in workspace 0 as long as we don't care about preview (support for
> which could be added later and as you said needs not be optimised as
> much))

I don't think that the query would be any faster as you must check the
pid anyway.

Masi


More information about the TYPO3-project-4-3 mailing list