diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-20 07:49:10 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-20 07:49:10 +0000 |
commit | 24f64c975d2f17b37de3f84173e12f5eac7ac634 (patch) | |
tree | 2e6922baf33f0410587afc98b6e4a58aaf349338 | |
parent | 541ca24c3903f691130f5dd33e879272b31fcd96 (diff) | |
download | elgg-24f64c975d2f17b37de3f84173e12f5eac7ac634.tar.gz elgg-24f64c975d2f17b37de3f84173e12f5eac7ac634.tar.bz2 |
Fixes warning messages on disable or delete for times when an entity has no sub items.
git-svn-id: https://code.elgg.org/elgg/trunk@2835 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/entities.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 002c91358..a873fa67a 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1750,8 +1750,10 @@ $__RECURSIVE_DELETE_TOKEN = md5(get_loggedin_userid()); // Make it slightly harder to guess
$sub_entities = get_data("SELECT * from {$CONFIG->dbprefix}entities WHERE container_guid=$guid or owner_guid=$guid or site_guid=$guid", 'entity_row_to_elggstar');
- foreach ($sub_entities as $e)
- $e->disable($reason);
+ if ($sub_entities) {
+ foreach ($sub_entities as $e)
+ $e->disable($reason);
+ }
$__RECURSIVE_DELETE_TOKEN = null;
}
@@ -1822,8 +1824,10 @@ $__RECURSIVE_DELETE_TOKEN = md5(get_loggedin_userid()); // Make it slightly harder to guess
$sub_entities = get_data("SELECT * from {$CONFIG->dbprefix}entities WHERE container_guid=$guid or owner_guid=$guid or site_guid=$guid", 'entity_row_to_elggstar');
- foreach ($sub_entities as $e)
- $e->delete();
+ if ($sub_entities) {
+ foreach ($sub_entities as $e)
+ $e->delete();
+ }
$__RECURSIVE_DELETE_TOKEN = null;
}
|