diff --git a/core/models/base/ItemModelBase.php b/core/models/base/ItemModelBase.php index 8dd85adde..f7ed4ab98 100644 --- a/core/models/base/ItemModelBase.php +++ b/core/models/base/ItemModelBase.php @@ -21,9 +21,9 @@ public function __construct() $this->_key = 'item_id'; $this->_mainData = array( - 'item_id' => array('type' => MIDAS_DATA), - 'name' => array('type' => MIDAS_DATA), - 'description' => array('type' => MIDAS_DATA), + 'item_id' => array('type' => MIDAS_DATA), + 'name' => array('type' => MIDAS_DATA), + 'description' => array('type' => MIDAS_DATA), 'type' => array('type' => MIDAS_DATA), 'sizebytes' => array('type' => MIDAS_DATA), 'date_creation' => array('type' => MIDAS_DATA), @@ -33,10 +33,10 @@ public function __construct() 'download' => array('type' => MIDAS_DATA), 'privacy_status' => array('type' => MIDAS_DATA), 'uuid' => array('type' => MIDAS_DATA), - 'folders' => array('type' => MIDAS_MANY_TO_MANY, 'model' => 'Folder', 'table' => 'item2folder', 'parent_column' => 'item_id', 'child_column' => 'folder_id'), - 'revisions' => array('type' => MIDAS_ONE_TO_MANY, 'model' => 'ItemRevision', 'parent_column' => 'item_id', 'child_column' => 'item_id'), - 'itempolicygroup' => array('type' => MIDAS_ONE_TO_MANY, 'model' => 'Itempolicygroup', 'parent_column' => 'item_id', 'child_column' => 'item_id'), - 'itempolicyuser' => array('type' => MIDAS_ONE_TO_MANY, 'model' => 'Itempolicyuser', 'parent_column' => 'item_id', 'child_column' => 'item_id'), + 'folders' => array('type' => MIDAS_MANY_TO_MANY, 'model' => 'Folder', 'table' => 'item2folder', 'parent_column' => 'item_id', 'child_column' => 'folder_id'), + 'revisions' => array('type' => MIDAS_ONE_TO_MANY, 'model' => 'ItemRevision', 'parent_column' => 'item_id', 'child_column' => 'item_id'), + 'itempolicygroup' => array('type' => MIDAS_ONE_TO_MANY, 'model' => 'Itempolicygroup', 'parent_column' => 'item_id', 'child_column' => 'item_id'), + 'itempolicyuser' => array('type' => MIDAS_ONE_TO_MANY, 'model' => 'Itempolicyuser', 'parent_column' => 'item_id', 'child_column' => 'item_id'), ); $this->initialize(); // required } // end __construct() diff --git a/core/models/pdo/ItemModel.php b/core/models/pdo/ItemModel.php index 65591f460..4936b5d7b 100644 --- a/core/models/pdo/ItemModel.php +++ b/core/models/pdo/ItemModel.php @@ -329,7 +329,7 @@ function delete($itemdao) $folders = $itemdao->getFolders(); foreach($folders as $folder) { - $folder_model->removeItem($folder, $itemdao); + $this->database->removeLink('folders', $itemdao, $folder); } $revisions = $itemdao->getRevisions();