objectManager: Show a note if a parent entry is missing
This commit is contained in:
@@ -1217,12 +1217,18 @@ class ObjectManager
|
|||||||
if($sLinkText == 'default')
|
if($sLinkText == 'default')
|
||||||
{
|
{
|
||||||
$oParent = $oObject->objectGetParent();
|
$oParent = $oObject->objectGetParent();
|
||||||
$oParentOM = new objectManager(get_class($oParent), '', $oParent->objectGetId());
|
if(!$oParent)
|
||||||
$sClassName = $oParentOM->getOptionalSetting('objectGetClassDisplayName', false);
|
{
|
||||||
if($sClassName)
|
echo html_note('Failed to find parent entry', 'No parent entry could be found, even though it is supposed to exist.');
|
||||||
$sLinkText = "Move to another $sClassName";
|
} else
|
||||||
else
|
{
|
||||||
$sLinkText = 'Move to another parent entry';
|
$oParentOM = new objectManager(get_class($oParent), '', $oParent->objectGetId());
|
||||||
|
$sClassName = $oParentOM->getOptionalSetting('objectGetClassDisplayName', false);
|
||||||
|
if($sClassName)
|
||||||
|
$sLinkText = "Move to another $sClassName";
|
||||||
|
else
|
||||||
|
$sLinkText = 'Move to another parent entry';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo "<a href=\"".$this->makeUrl("showChangeParent", $this->iId,
|
echo "<a href=\"".$this->makeUrl("showChangeParent", $this->iId,
|
||||||
"Move to another parent entry")."\">$sLinkText</a>\n";
|
"Move to another parent entry")."\">$sLinkText</a>\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user