Retrieve storage numeric id earlier when still available

The numeric id is only available before the storage entry is deleted, so
get it at that time.
This commit is contained in:
Vincent Petry 2014-10-13 15:52:48 +02:00
parent 4b9465b937
commit d485c0098d

View file

@ -105,10 +105,10 @@ class Storage {
*/
public static function remove($storageId) {
$storageId = self::adjustStorageId($storageId);
$numericId = self::getNumericStorageId($storageId);
$sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
\OC_DB::executeAudited($sql, array($storageId));
$numericId = self::getNumericStorageId($storageId);
if (!is_null($numericId)) {
$sql = 'DELETE FROM `*PREFIX*filecache` WHERE `storage` = ?';
\OC_DB::executeAudited($sql, array($numericId));