[TYPO3-mvc] [FYI] Autopopulation of PID - or: Where should my records be placed?

Bastian Waidelich bastian at typo3.org
Fri Jul 31 17:00:13 CEST 2009


Christian Zenker wrote:

Hi Christian,

> $GLOBALS['TSFE']->getStorageSiterootPids() returns an array, not a string [...]
> Fix at: http://forge.typo3.org/issues/show/4087

Great, thanks for that.
Two little corrections for the patch:
Instead of

if (is_string($cObj->data['pages']) && !empty($cObj->data['pages']))

you should write

if (is_string($cObj->data['pages']) && strlen($cObj->data['pages']) > 0)

And $GLOBALS['TSFE']->getStorageSiterootPids() might return an empty 
array. So instead of:

if (TYPO3_MODE === 'FE') {
	$storageSiterootPids = $GLOBALS['TSFE']->getStorageSiterootPids();
	return $storageSiterootPids['_STORAGE_PID'];
} else {
	return self::DEFAULT_BACKEND_STORAGE_PID;
}

we should have:

if (TYPO3_MODE === 'FE') {
	$storageSiterootPids = $GLOBALS['TSFE']->getStorageSiterootPids();
	if (isset($storageSiterootPids['_STORAGE_PID'])) {
		return $storageSiterootPids['_STORAGE_PID'];
	}
}
return self::DEFAULT_BACKEND_STORAGE_PID;

or something similar.

Bastian


More information about the TYPO3-project-typo3v4mvc mailing list