/**
* Removes files and associated meta-data for files which no ticket,
* canned-response, or faq point to any more.
*/
static function deleteOrphans() {
// XXX: Allow plugins to define filetypes which do not represent
// files attached to tickets or other things in the attachment
// table and are not logos
$files = static::objects()
->filter(array(
'attachments__object_id__isnull' => true,
'ft' => 'T',
'created__lt' => SqlFunction::NOW()->minus(SqlInterval::DAY(1)),
));
foreach ($files as $f) {
if (!$f->delete())
break;
}
return true;
}
This appears to be the actual code in class.file.php. It looks like if it at any point it fails to delete the current file, it just breaks out and quits.
I am guessing that either 1) It has a problem with a file early in the list and just quits or 2) the select criteria not being met. I looked at ost_attachments and I do not see a single entry where object_id is NULL out of almost 17,000 records and there are only like 5 entries where type='T' ... unless I am misinterpreting this.