r3958 commitDeleteObject(): don't return constant value
authorDenis Ovsienko <infrastation@yandex.ru>
Wed, 6 Oct 2010 10:39:29 +0000 (10:39 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 6 Oct 2010 10:39:29 +0000 (10:39 +0000)
deleteObject(): dismiss useless checks, which are already covered by exceptions

inc/database.php
inc/ophandlers.php

index a4af0ce..1dabb2a 100644 (file)
@@ -635,7 +635,6 @@ function commitDeleteObject ($object_id = 0)
        usePreparedDeleteBlade ('CachedPVM', array ('object_id' => $object_id));
        usePreparedDeleteBlade ('VLANSwitch', array ('object_id' => $object_id));
        usePreparedDeleteBlade ('RackObject', array ('id' => $object_id));
-       return '';
 }
 
 function commitDeleteRack($rack_id)
index 7fa19d0..35c6a0a 100644 (file)
@@ -922,21 +922,16 @@ function addLotOfObjects()
 }
 
 $msgcode['deleteObject']['OK'] = 76;
-$msgcode['deleteObject']['ERR'] = 100;
 function deleteObject ()
 {
        assertUIntArg ('object_id');
-       if (NULL === ($oinfo = spotEntity ('object', $_REQUEST['object_id'])))
-               return buildRedirectURL (__FUNCTION__, 'ERR', array ('object not found'));
+       $oinfo = spotEntity ('object', $_REQUEST['object_id']);
 
        $racklist = getResidentRacksData ($_REQUEST['object_id'], FALSE);
-       $error = commitDeleteObject ($_REQUEST['object_id']);
+       commitDeleteObject ($_REQUEST['object_id']);
        foreach ($racklist as $rack_id)
                resetThumbCache ($rack_id);
 
-       if ($error != '')
-               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
-
        return buildRedirectURL (__FUNCTION__, 'OK', array ($oinfo['dname']));
 }