diff options
Diffstat (limited to 'modules/gallery/models')
-rw-r--r-- | modules/gallery/models/item.php | 7 | ||||
-rw-r--r-- | modules/gallery/models/task.php | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index fd121a5a..dbd56fa2 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -70,7 +70,7 @@ class Item_Model extends ORM_MPTT { return $this->type == 'movie'; } - public function delete() { + public function delete($ignored_id=null) { if ($this->id == 1) { $v = new Validation(array("id")); $v->add_error("id", "cant_delete_root_album"); @@ -929,6 +929,11 @@ class Item_Model extends ORM_MPTT { $data["album_cover"] = rest::url("item", $tmp); } unset($data["album_cover_item_id"]); + + // Elide some internal-only data that is going to cause confusion in the client. + foreach (array("relative_path_cache", "relative_url_cache", "left_ptr", "right_ptr") as $key) { + unset($data[$key]); + } return $data; } } diff --git a/modules/gallery/models/task.php b/modules/gallery/models/task.php index f40be492..24d909cb 100644 --- a/modules/gallery/models/task.php +++ b/modules/gallery/models/task.php @@ -27,7 +27,7 @@ class Task_Model extends ORM { } } - public function set($key, $value) { + public function set($key, $value=null) { $context = unserialize($this->context); $context[$key] = $value; $this->context = serialize($context); @@ -40,7 +40,7 @@ class Task_Model extends ORM { return parent::save(); } - public function delete() { + public function delete($ignored_id=null) { Cache::instance()->delete($this->_cache_key()); return parent::delete(); } |