From 523c467eed670c59580ede2ab1dbe8b4ad59c800 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 8 Apr 2009 15:11:55 +0000 Subject: Fixes issues with Server Add: 1) Fixes Ticket #208 2) Fixes Ticket #190 3) Fixes an unticketed issue where two items could collide when creating the thumbnail and/or resize. For example, loading a.flv and a.jpg would have generated the same thumbnail image. This change adds a random value to the name to avoid conflicts. 4) Added item::__set() to clear the relative path if the name changes --- core/models/item.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/models') diff --git a/core/models/item.php b/core/models/item.php index b28f71fe..156080c2 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -287,6 +287,17 @@ class Item_Model extends ORM_MPTT { } } + /** + * @see ORM::__set() + */ + public function __set($column, $value) { + if ($column == "name") { + // Clear the relative path as it is no longer valid. + $this->relative_path = null; + } + parent::__set($column, $value); + } + /** * @see ORM::save() */ -- cgit v1.2.3