From d485c0098d58454b8dbd25e574a363a500244942 Mon Sep 17 00:00:00 2001
From: Vincent Petry <pvince81@owncloud.com>
Date: Mon, 13 Oct 2014 15:52:48 +0200
Subject: 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.
---
 lib/private/files/cache/storage.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'lib/private/files')

diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php
index a38656d8499..d7d57811a7d 100644
--- a/lib/private/files/cache/storage.php
+++ b/lib/private/files/cache/storage.php
@@ -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));
-- 
cgit v1.2.3