diff --git a/include/objectManager.php b/include/objectManager.php index be0b458..e7df527 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -923,9 +923,18 @@ class ObjectManager "color4"); $oParent = $oObject->objectGetParent(); - $oGrandFather = $oParent->objectGetParent(); - if($oGrandFather) + if(method_exists($oParent, 'objectGetParent')) + { + $oGrandFather = $oParent->objectGetParent(); + $oParentOM = new objectManager(get_class($oParent), '', $oParent->objectGetId()); + } else + { + $oGrandFather = null; + $oParentOM = null; + } + + if($oGrandFather && $oParentOM->GetOptionalSetting('objectRestrictMoveObjectListsToParents', false)) { $aParentSiblings = $oGrandFather->objectGetChildrenClassSpecific(get_class($oParent)); @@ -997,7 +1006,7 @@ class ObjectManager "Move here"), "color4"); - if(method_exists($oObject, 'objectGetParent')) + if($this->GetOptionalSetting('objectRestrictMoveObjectListsToParents', false)) { $oParent = $oObject->objectGetParent(); diff --git a/include/testData.php b/include/testData.php index 6789ec0..7a28d54 100644 --- a/include/testData.php +++ b/include/testData.php @@ -1429,6 +1429,12 @@ class testData{ return new version($this->iVersionId); } + /* Only show children of (grand)parents in the Move Child Objects and Change Parent lists */ + public static function objectRestrictMoveObjectListsToParents() + { + return true; + } + function objectGetChildren($bIncludeDeleted = false) { /* We have none */ diff --git a/include/version.php b/include/version.php index 52b0bae..9f81501 100644 --- a/include/version.php +++ b/include/version.php @@ -789,6 +789,12 @@ class version { return new application($this->iAppId); } + /* Only show children of (grand)parents in the Move Child Objects and Change Parent lists */ + public static function objectRestrictMoveObjectListsToParents() + { + return true; + } + public function getRatingInfo() { return testData::getRatingInfoForVersionId($this->iVersionId);