Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made change to set record to nil for relationship screen.
Browse files Browse the repository at this point in the history
having value in `record` was causing not sending miq_grid_checks along in params when custom button was pressed from a list thru relationships

(cherry picked from commit d8c3cb2)
h-kataria committed Nov 7, 2018
1 parent b34c0d0 commit 7c94f3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/helpers/application_helper/toolbar_builder.rb
Original file line number Diff line number Diff line change
@@ -271,7 +271,7 @@ def create_custom_button(input, model, record)
:enabled => enabled,
:klass => ApplicationHelper::Button::ButtonWithoutRbacCheck,
:url => "button",
:url_parms => "?id=#{record_id}&button_id=#{button_id}&cls=#{model}&pressed=custom_button&desc=#{button_name}"
:url_parms => "?id=LIST&button_id=#{button_id}&cls=#{model}&pressed=custom_button&desc=#{button_name}"
}
button[:text] = button_name if input[:text_display]
button[:onwhen] = '1+' if cb_enabled_for_nested
@@ -330,6 +330,7 @@ def custom_toolbar_class(toolbar_result)
model = GenericObjectDefinition
record = GenericObject.find_by(:id => @sb[:rec_id])
elsif relationship_table_screen?
record = nil
model = custom_button_class_model(@display.camelize.singularize)
else
model = @record ? @record.class : model_for_custom_toolbar

0 comments on commit 7c94f3b

Please sign in to comment.