Permalink
Browse files

BUGFIX Return zero file size for folders (mainly to avoid listing it …

…in AssetAdmin tables, but also because it doesn't make sense for folders)
  • Loading branch information...
1 parent a3d8185 commit 4f49c452ac32d087da716a4257d246b2599e509b @chillu chillu committed Feb 15, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 filesystem/Folder.php
View
@@ -331,6 +331,15 @@ function setFilename($filename) {
$this->setField('Title',pathinfo($filename, PATHINFO_BASENAME));
parent::setFilename($filename);
}
+
+ /**
+ * A folder doesn't have a (meaningful) file size.
+ *
+ * @return Null
+ */
+ function getSize() {
+ return null;
+ }
/**
* Delete the database record (recursively for folders) without touching the filesystem

0 comments on commit 4f49c45

Please sign in to comment.