diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php
index cfefeee62..cc7a1778f 100644
--- a/forms/HtmlEditorField.php
+++ b/forms/HtmlEditorField.php
@@ -742,8 +742,10 @@ class HtmlEditorField_Toolbar extends RequestHandler {
$files = File::get()->where(implode(' OR ', $wheres));
// Limit by folder (if required)
- if($parentID) $files->filter('ParentID', $parentID);
-
+ if($parentID) {
+ $files = $files->filter('ParentID', $parentID);
+ }
+
return $files;
}
diff --git a/model/Hierarchy.php b/model/Hierarchy.php
index dbec83d1f..c4e1a2045 100644
--- a/model/Hierarchy.php
+++ b/model/Hierarchy.php
@@ -591,7 +591,7 @@ class Hierarchy extends DataExtension {
$ids = $stageChildren->column("ID");
if($ids) {
- $children->where("\"$baseClass\".\"ID\" NOT IN (" . implode(',',$ids) . ")");
+ $children = $children->where("\"$baseClass\".\"ID\" NOT IN (" . implode(',',$ids) . ")");
}
}