From 998c9bdeb7ff4f488fdad8e2cbe80df19e8d58bb Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 24 Jan 2019 10:05:59 -0800 Subject: [PATCH] clone: Do not send disabled ports fixes cloudron/box#611 --- src/views/apps.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/apps.js b/src/views/apps.js index 651c60364..a059837e1 100644 --- a/src/views/apps.js +++ b/src/views/apps.js @@ -281,10 +281,18 @@ angular.module('Application').controller('AppsController', ['$scope', '$location clone: function () { $scope.appRestore.busy = true; + // only use enabled ports from portBindings + var finalPortBindings = {}; + for (var env in $scope.appRestore.portBindings) { + if ($scope.appRestore.portBindingsEnabled[env]) { + finalPortBindings[env] = $scope.appRestore.portBindings[env]; + } + } + var data = { location: $scope.appRestore.location, domain: $scope.appRestore.domain.domain, - portBindings: $scope.appRestore.portBindings, + portBindings: finalPortBindings, backupId: $scope.appRestore.selectedBackup.id };