diff --git a/awx/ui/client/src/adhoc/adhoc.controller.js b/awx/ui/client/src/adhoc/adhoc.controller.js index 28a692a0df..14827600f9 100644 --- a/awx/ui/client/src/adhoc/adhoc.controller.js +++ b/awx/ui/client/src/adhoc/adhoc.controller.js @@ -9,7 +9,7 @@ * @name controllers.function:Adhoc * @description This controller controls the adhoc form creation, command launching and navigating to standard out after command has been succesfully ran. */ -function adhocController($q, $scope, $rootScope, $location, $routeParams, +function adhocController($q, $scope, $rootScope, $location, $stateParams, CheckPasswords, PromptForPasswords, CreateLaunchDialog, adhocForm, GenerateForm, Rest, ProcessErrors, ClearScope, GetBasePath, GetChoices, KindChange, LookUpInit, CredentialList, Empty, Wait) { @@ -31,7 +31,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams, }; }; - var id = $routeParams.inventory_id, + var id = $stateParams.inventory_id, urls = privateFn.setAvailableUrls(), hostPattern = $rootScope.hostPatterns || "all"; @@ -199,7 +199,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams, // launch the job with the provided form data $scope.launchJob = function () { - var adhocUrl = GetBasePath('inventory') + $routeParams.inventory_id + + var adhocUrl = GetBasePath('inventory') + $stateParams.inventory_id + '/ad_hoc_commands/', fld, data={}, html; html = '