aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorJerome Bakker <jeabakker@coldtrick.com>2013-05-30 16:48:33 +0200
committerJerome Bakker <jeabakker@coldtrick.com>2013-05-30 16:48:33 +0200
commitd90ddd2f9be750d3bf827679f49943166b486ad4 (patch)
treea0917cdcd199913d556a821f7eba03be8264d8ba /engine
parentbf73ef92f79d4ab245f74ff5f7ed065caa2d5ffe (diff)
downloadelgg-d90ddd2f9be750d3bf827679f49943166b486ad4.tar.gz
elgg-d90ddd2f9be750d3bf827679f49943166b486ad4.tar.bz2
ElggFile->delete() will return a correct state even for non saved
entities
Diffstat (limited to 'engine')
-rw-r--r--engine/classes/ElggFile.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/engine/classes/ElggFile.php b/engine/classes/ElggFile.php
index 3e9c24c17..23080834b 100644
--- a/engine/classes/ElggFile.php
+++ b/engine/classes/ElggFile.php
@@ -275,9 +275,14 @@ class ElggFile extends ElggObject {
*/
public function delete() {
$fs = $this->getFilestore();
- if ($fs->delete($this)) {
- return parent::delete();
+
+ $result = $fs->delete($this);
+
+ if ($this->getGUID() && $result) {
+ $result = parent::delete();
}
+
+ return $result;
}
/**