diff options
-rw-r--r-- | apps/comments/js/commentstabview.js | 2 | ||||
-rw-r--r-- | apps/files/command/scan.php | 27 | ||||
-rw-r--r-- | apps/files_external/service/dbconfigservice.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/sharedstorage.php | 4 | ||||
-rw-r--r-- | core/js/sharedialogexpirationview.js | 5 |
5 files changed, 34 insertions, 6 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 415ec2a9be5..e05c5eca08b 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -31,7 +31,7 @@ '{{/if}}' + ' </div>' + ' <form class="newCommentForm">' + - ' <textarea class="message" placeholder="{{newMessagePlaceholder}}">{{{message}}}</textarea>' + + ' <textarea class="message" placeholder="{{newMessagePlaceholder}}">{{message}}</textarea>' + ' <input class="submit" type="submit" value="{{submitText}}" />' + '{{#if isEditMode}}' + ' <input class="cancel" type="button" value="{{cancelText}}" />' + diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php index 2b316fac7c0..64b1473cc1c 100644 --- a/apps/files/command/scan.php +++ b/apps/files/command/scan.php @@ -27,9 +27,11 @@ namespace OCA\Files\Command; +use Doctrine\DBAL\Connection; use OC\Core\Command\Base; use OC\ForbiddenException; use OCP\Files\StorageNotAvailableException; +use OCP\IDBConnection; use OCP\IUserManager; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -91,7 +93,8 @@ class Scan extends Base { } protected function scanFiles($user, $path, $verbose, OutputInterface $output) { - $scanner = new \OC\Files\Utils\Scanner($user, \OC::$server->getDatabaseConnection(), \OC::$server->getLogger()); + $connection = $this->reconnectToDatabase($output); + $scanner = new \OC\Files\Utils\Scanner($user, $connection, \OC::$server->getLogger()); # check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception # printout and count if ($verbose) { @@ -291,4 +294,26 @@ class Scan extends Base { return date('H:i:s', $secs); } + /** + * @return \OCP\IDBConnection + */ + protected function reconnectToDatabase(OutputInterface $output) { + /** @var Connection | IDBConnection $connection*/ + $connection = \OC::$server->getDatabaseConnection(); + try { + $connection->close(); + } catch (\Exception $ex) { + $output->writeln("<info>Error while disconnecting from database: {$ex->getMessage()}</info>"); + } + while (!$connection->isConnected()) { + try { + $connection->connect(); + } catch (\Exception $ex) { + $output->writeln("<info>Error while re-connecting to database: {$ex->getMessage()}</info>"); + sleep(60); + } + } + return $connection; + } + } diff --git a/apps/files_external/service/dbconfigservice.php b/apps/files_external/service/dbconfigservice.php index 31333f8cc32..418449a63ff 100644 --- a/apps/files_external/service/dbconfigservice.php +++ b/apps/files_external/service/dbconfigservice.php @@ -196,7 +196,7 @@ class DBConfigService { 'type' => $builder->createNamedParameter($type, IQueryBuilder::PARAM_INT) ]); $query->execute(); - return (int)$this->connection->lastInsertId('external_mounts'); + return (int)$this->connection->lastInsertId('*PREFIX*external_mounts'); } /** diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 0b08f39a60f..64a5cc41bf7 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -322,7 +322,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage { $source = $this->getSourcePath($path); if ($source) { $info = array( - 'target' => $this->getMountPoint() . $path, + 'target' => $this->getMountPoint() . '/' . $path, 'source' => $source, ); \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_get_contents', $info); @@ -461,7 +461,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage { } } $info = array( - 'target' => $this->getMountPoint() . $path, + 'target' => $this->getMountPoint() . '/' . $path, 'source' => $source, 'mode' => $mode, ); diff --git a/core/js/sharedialogexpirationview.js b/core/js/sharedialogexpirationview.js index fa5c0c00986..44856b2219b 100644 --- a/core/js/sharedialogexpirationview.js +++ b/core/js/sharedialogexpirationview.js @@ -93,6 +93,7 @@ this.$el.find('.expirationDateContainer').toggleClass('hidden', !state); if (!state) { // discard expiration date + this.model.get('linkShare').expiration = ''; this.model.saveLinkShare({ expireDate: '' }); @@ -104,8 +105,10 @@ $target.tooltip('hide'); $target.removeClass('error'); + expiration = moment($target.val(), 'DD-MM-YYYY').format('YYYY-MM-DD'); + this.model.get('linkShare').expiration = expiration; this.model.saveLinkShare({ - expiration: moment($target.val(), 'DD-MM-YYYY').format('YYYY-MM-DD') + expiration: expiration }, { error: function(model, message) { if (!message) { |