Skip to content

Commit

Permalink
Fix show for a service and config provider record when linked from a …
Browse files Browse the repository at this point in the history
…different page

(transferred from ManageIQ/manageiq@9281a96)
  • Loading branch information
lgalis committed Jul 22, 2016
1 parent b0d5468 commit 57ae873
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions app/controllers/provider_foreman_controller.rb
Expand Up @@ -448,18 +448,20 @@ def explorer
if params[:button]
@miq_after_onload = "miqAjax('/#{controller_name}/x_button?pressed=#{params[:button]}');"
end

build_accordions_and_trees

params.instance_variable_get(:@parameters).merge!(session[:exp_parms]) if session[:exp_parms] # Grab any explorer parm overrides
session.delete(:exp_parms)
@in_a_form = false

if params[:id] # If a tree node id came in, show in one of the trees
nodetype, id = params[:id].split("-")
# treebuilder initializes x_node to root first time in locals_for_render,
# need to set this here to force & activate node when link is clicked outside of explorer.
@reselect_node = self.x_node = "#{nodetype}-#{to_cid(id)}"
get_node_info(x_node)
end

build_accordions_and_trees

render :layout => "application"
end

Expand Down
5 changes: 3 additions & 2 deletions app/controllers/service_controller.rb
Expand Up @@ -74,13 +74,14 @@ def explorer
return
end

build_accordions_and_trees

if params[:id] # If a tree node id came in, show in one of the trees
nodetype, id = params[:id].split("-")
self.x_node = "#{nodetype}-#{to_cid(id)}"
get_node_info(x_node)
end

build_accordions_and_trees

params.instance_variable_get(:@parameters).merge!(session[:exp_parms]) if session[:exp_parms] # Grab any explorer parm overrides
session.delete(:exp_parms)
@in_a_form = false
Expand Down

0 comments on commit 57ae873

Please sign in to comment.