summaryrefslogtreecommitdiffstats
path: root/apps/files_external/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-11-03 12:14:44 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-09-04 11:54:08 +0200
commit5df5b9c8b13770142eab82e889eed5e50da5fab3 (patch)
tree09891fdb160a0f21048b201e450b1b17f556ce22 /apps/files_external/js
parentd21713d52627a267881b8a426aa613d3ac2d14d9 (diff)
downloadnextcloud-server-5df5b9c8b13770142eab82e889eed5e50da5fab3.tar.gz
nextcloud-server-5df5b9c8b13770142eab82e889eed5e50da5fab3.zip
Handle invalid ext storage backend to keep mount point visible
Keep mount point visible and also ext storage config visible when dealing with configs relating to storage backends or auth mechanisms that were provided by an app that is currently disabled. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_external/js')
-rw-r--r--apps/files_external/js/settings.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 112676b8c27..30074ab179a 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -805,6 +805,13 @@ MountConfigListView.prototype = _.extend({
var mountPoint = storageConfig.mountPoint;
var backend = this._allBackends[storageConfig.backend];
+ if (!backend) {
+ backend = {
+ name: 'Unknown: ' + storageConfig.backend,
+ invalid: true
+ };
+ }
+
// FIXME: Replace with a proper Handlebar template
var $tr = this.$el.find('tr#addMountPoint');
this.$el.find('tbody').append($tr.clone());
@@ -829,6 +836,13 @@ MountConfigListView.prototype = _.extend({
$tr.addClass(backend.identifier);
$tr.find('.backend').data('identifier', backend.identifier);
+ if (backend.invalid) {
+ $tr.find('[name=mountPoint]').prop('disabled', true);
+ $tr.find('.applicable,.mountOptionsToggle').empty();
+ this.updateStatus($tr, false, 'Unknown backend: ' + backend.name);
+ return $tr;
+ }
+
var selectAuthMechanism = $('<select class="selectAuthMechanism"></select>');
var neededVisibility = (this._isPersonal) ? StorageConfig.Visibility.PERSONAL : StorageConfig.Visibility.ADMIN;
$.each(this._allAuthMechanisms, function(authIdentifier, authMechanism) {