objectManager: Show a note when the parent entry as an id of 0

This commit is contained in:
Alexander Nicolaysen Sørnes
2009-07-21 17:14:19 +02:00
parent 8f6927f603
commit 561682cd23

View File

@@ -1217,10 +1217,11 @@ class ObjectManager
if($sLinkText == 'default') if($sLinkText == 'default')
{ {
$oParent = $oObject->objectGetParent(); $oParent = $oObject->objectGetParent();
if(!$oParent) if(!$oParent || !$oParent->objectGetId())
{ {
echo html_note('Failed to find parent entry', 'No parent entry could be found, even though it is supposed to exist.'); echo html_note('Failed to find parent entry', 'No parent entry could be found, even though it is supposed to exist.');
} else }
if($oParent)
{ {
$oParentOM = new objectManager(get_class($oParent), '', $oParent->objectGetId()); $oParentOM = new objectManager(get_class($oParent), '', $oParent->objectGetId());
$sClassName = $oParentOM->getOptionalSetting('objectGetClassDisplayName', false); $sClassName = $oParentOM->getOptionalSetting('objectGetClassDisplayName', false);