Three small bugfixes
* Remove files from the database even if they couldn't be removed from disk. (log a warning) * Return a better error message if the user attempts to delete a scheduled file * Attempt to squash headers already sent warning during buffer flushing in FileIO.php
This commit is contained in:
parent
7fd58ac51b
commit
69b03cdefa
|
@ -61,6 +61,9 @@ class Application_Common_FileIO
|
||||||
}
|
}
|
||||||
header("Content-Transfer-Encoding: binary");
|
header("Content-Transfer-Encoding: binary");
|
||||||
|
|
||||||
|
//Squashes headers() warning on PHP 5.3/ubuntu 12.04:
|
||||||
|
flush();
|
||||||
|
|
||||||
//We can have multiple levels of output buffering. Need to
|
//We can have multiple levels of output buffering. Need to
|
||||||
//keep looping until all have been disabled!!!
|
//keep looping until all have been disabled!!!
|
||||||
//http://www.php.net/manual/en/function.ob-end-flush.php
|
//http://www.php.net/manual/en/function.ob-end-flush.php
|
||||||
|
|
|
@ -356,6 +356,8 @@ class LibraryController extends Zend_Controller_Action
|
||||||
$res = $file->delete();
|
$res = $file->delete();
|
||||||
} catch (FileNoPermissionException $e) {
|
} catch (FileNoPermissionException $e) {
|
||||||
$message = $noPermissionMsg;
|
$message = $noPermissionMsg;
|
||||||
|
} catch (DeleteScheduledFileException $e) {
|
||||||
|
$message = _("Could not delete file because it is scheduled in the future.");
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
//could throw a scheduled in future exception.
|
//could throw a scheduled in future exception.
|
||||||
$message = _("Could not delete file(s).");
|
$message = _("Could not delete file(s).");
|
||||||
|
|
|
@ -400,7 +400,14 @@ SQL;
|
||||||
//Delete the physical file from either the local stor directory
|
//Delete the physical file from either the local stor directory
|
||||||
//or from the cloud
|
//or from the cloud
|
||||||
if ($this->_file->getDbImportStatus() == CcFiles::IMPORT_STATUS_SUCCESS) {
|
if ($this->_file->getDbImportStatus() == CcFiles::IMPORT_STATUS_SUCCESS) {
|
||||||
$this->_file->deletePhysicalFile();
|
try {
|
||||||
|
$this->_file->deletePhysicalFile();
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
//Just log the exception and continue.
|
||||||
|
Logging::error($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update the user's disk usage
|
//Update the user's disk usage
|
||||||
|
|
Loading…
Reference in New Issue