Asset filesize


(George Mutale) #1

I am looking into the following error:


File: [SYSTEM_ROOT]_3_16_4_ssv/core/assets/files/file/file.inc Line: 1344

Message: Undefined index: size







function getAssetFileSizeReadableKeywordReplacement()

{

$existing = $this->getExistingFile();

return easy_filesize($existing['size']);



}//end getAssetFileSizeReadableKeywordReplacement()









function getExistingFile()

{

$existing = Array();







It is possible that the function getExistingFile() returns an empty array, but there is no check for this in the function getAssetFileSizeReadableKeywordReplacement(), hence the index 'size' does not exist as a key in some cases.



How do I request that the function getAssetFileSizeReadableKeywordReplacement() be updated to take care of this issue.


(Avi Miller) #2

Report it as a bug on the Bug Tracker. :)

(George Mutale) #3


Thanks.

I think you can replicate the error, by creating an Asset listing page to list files, and then create a file asset without uploading a file.

(Avi Miller) #4

How do you create a File asset without uploading a file? This should not be possible.

(Greg Sherwood) #5

A file asset without file content is going to have bigger issues than just a PHP notice for a keyword.