objectManager: Prevent possible problems when moving child objects
This commit is contained in:
committed by
Chris Morgan
parent
0a9665b24f
commit
3ad7c45890
@@ -30,6 +30,13 @@ class ObjectManager
|
|||||||
// queued entries
|
// queued entries
|
||||||
private $aCommonResponses;
|
private $aCommonResponses;
|
||||||
|
|
||||||
|
/* Remove the cached object of the class we are working with, useful in cases where we
|
||||||
|
modify the object in such a way that it needs to be reloaded */
|
||||||
|
private function flushCachedObject()
|
||||||
|
{
|
||||||
|
$this->oObject = null;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get an instance of the object of the class we are working with */
|
/* Get an instance of the object of the class we are working with */
|
||||||
private function getObject()
|
private function getObject()
|
||||||
{
|
{
|
||||||
@@ -836,6 +843,9 @@ class ObjectManager
|
|||||||
|
|
||||||
$iAffected = $oObject->objectMoveChildren($iNewId);
|
$iAffected = $oObject->objectMoveChildren($iNewId);
|
||||||
|
|
||||||
|
/* Some classes record the id of their child objects, so we shouldn't keep an old instance around */
|
||||||
|
$this->flushCachedObject();
|
||||||
|
|
||||||
if($iAffected)
|
if($iAffected)
|
||||||
{
|
{
|
||||||
$sPlural = ($iAffected == 1) ? "": "s";
|
$sPlural = ($iAffected == 1) ? "": "s";
|
||||||
|
|||||||
Reference in New Issue
Block a user