aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/js/sharedfilelist.js5
-rw-r--r--core/js/js.js4
-rw-r--r--lib/private/app.php5
-rw-r--r--lib/private/repair.php1
-rw-r--r--lib/repair/innodb.php51
-rw-r--r--settings/js/log.js1
-rw-r--r--tests/lib/repair/repairinnodb.php65
7 files changed, 127 insertions, 5 deletions
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js
index e643618e774..0e115ae6148 100644
--- a/apps/files_sharing/js/sharedfilelist.js
+++ b/apps/files_sharing/js/sharedfilelist.js
@@ -238,12 +238,11 @@
);
delete data.recipientsCount;
})
- // Sort by expected sort comparator
- .sortBy(this._sortComparator)
// Finish the chain by getting the result
.value();
- return files;
+ // Sort by expected sort comparator
+ return files.sort(this._sortComparator);
}
});
diff --git a/core/js/js.js b/core/js/js.js
index 544b26647a9..72b65f41a16 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1138,7 +1138,9 @@ function initCore() {
if(!$app.is('a')) {
$app = $app.closest('a');
}
- $app.addClass('app-loading');
+ if(!event.ctrlKey) {
+ $app.addClass('app-loading');
+ }
});
}
diff --git a/lib/private/app.php b/lib/private/app.php
index 0ca2ca36bd2..b7d58c72340 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -574,7 +574,7 @@ class OC_App {
* Read all app metadata from the info.xml file
* @param string $appid id of the app or the path of the info.xml file
* @param boolean $path (optional)
- * @return array
+ * @return array|null
* @note all data is read from info.xml, not just pre-defined fields
*/
public static function getAppInfo($appid, $path = false) {
@@ -587,6 +587,9 @@ class OC_App {
$file = self::getAppPath($appid) . '/appinfo/info.xml';
}
$data = array();
+ if (!file_exists($file)) {
+ return null;
+ }
$content = @file_get_contents($file);
if (!$content) {
return null;
diff --git a/lib/private/repair.php b/lib/private/repair.php
index 14a917be32c..89886dd9316 100644
--- a/lib/private/repair.php
+++ b/lib/private/repair.php
@@ -81,6 +81,7 @@ class Repair extends BasicEmitter {
*/
public static function getBeforeUpgradeRepairSteps() {
return array(
+ new \OC\Repair\InnoDB()
);
}
diff --git a/lib/repair/innodb.php b/lib/repair/innodb.php
new file mode 100644
index 00000000000..4d58bf64a9e
--- /dev/null
+++ b/lib/repair/innodb.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Repair;
+
+use Doctrine\DBAL\Platforms\MySqlPlatform;
+use OC\Hooks\BasicEmitter;
+
+class InnoDB extends BasicEmitter implements \OC\RepairStep {
+
+ public function getName() {
+ return 'Repair MySQL database engine';
+ }
+
+ /**
+ * Fix mime types
+ */
+ public function run() {
+ $connection = \OC_DB::getConnection();
+ if (!$connection->getDatabasePlatform() instanceof MySqlPlatform) {
+ $this->emit('\OC\Repair', 'info', array('Not a mysql database -> nothing to no'));
+ return;
+ }
+
+ $tables = $this->getAllMyIsamTables($connection);
+ foreach ($tables as $table) {
+ $connection->exec("ALTER TABLE $table ENGINE=InnoDB;");
+ $this->emit('\OC\Repair', 'info', array("Fixed $table"));
+ }
+ }
+
+ /**
+ * @param \Doctrine\DBAL\Connection $connection
+ * @return string[]
+ */
+ private function getAllMyIsamTables($connection) {
+ $dbName = \OC::$server->getConfig()->getSystemValue("dbname");
+ $result = $connection->fetchArray(
+ "SELECT table_name FROM information_schema.tables WHERE table_schema = ? AND engine = 'MyISAM'",
+ array($dbName)
+ );
+
+ return $result;
+ }
+}
+
diff --git a/settings/js/log.js b/settings/js/log.js
index 5832c698ad5..197fef907a0 100644
--- a/settings/js/log.js
+++ b/settings/js/log.js
@@ -56,6 +56,7 @@ OC.Log={
row.append(messageTd);
var timeTd=$('<td/>');
+ timeTd.addClass('date');
if(isNaN(entry.time)){
timeTd.text(entry.time);
} else {
diff --git a/tests/lib/repair/repairinnodb.php b/tests/lib/repair/repairinnodb.php
new file mode 100644
index 00000000000..e7d2442f127
--- /dev/null
+++ b/tests/lib/repair/repairinnodb.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+/**
+ * Tests for the converting of MySQL tables to InnoDB engine
+ *
+ * @see \OC\Repair\RepairMimeTypes
+ */
+class TestRepairInnoDB extends PHPUnit_Framework_TestCase {
+
+ /** @var \OC\RepairStep */
+ private $repair;
+
+ /** @var \Doctrine\DBAL\Connection */
+ private $connection;
+
+ /** @var string */
+ private $tableName;
+
+ public function setUp() {
+ $this->connection = \OC_DB::getConnection();
+ if (!$this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySqlPlatform) {
+ $this->markTestSkipped("Test only relevant on MySql");
+ }
+
+ $dbPrefix = \OC::$server->getConfig()->getSystemValue("dbtableprefix");
+ $this->tableName = uniqid($dbPrefix . "_innodb_test");
+ $this->connection->exec("CREATE TABLE $this->tableName(id INT) ENGINE MyISAM");
+
+ $this->repair = new \OC\Repair\InnoDB();
+ }
+
+ public function tearDown() {
+ $this->connection->getSchemaManager()->dropTable($this->tableName);
+ }
+
+ public function testInnoDBConvert() {
+ $result = $this->countMyIsamTables();
+ $this->assertEquals(1, $result);
+
+ $this->repair->run();
+
+ $result = $this->countMyIsamTables();
+ $this->assertEquals(0, $result);
+ }
+
+ /**
+ * @param $dbName
+ * @return mixed
+ */
+ private function countMyIsamTables() {
+ $dbName = \OC::$server->getConfig()->getSystemValue("dbname");
+
+ $result = $this->connection->fetchColumn(
+ "SELECT count(*) FROM information_schema.tables WHERE table_schema = ? and table_name = ? AND engine = 'MyISAM'",
+ array($dbName, $this->tableName)
+ );
+ return $result;
+ }
+}