Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed code that sets values of button_image, display & open_url fields #13001

Merged

Conversation

h-kataria
Copy link
Contributor

https://bugzilla.redhat.com/show_bug.cgi?id=1401617

@martinpovolny please review, This issue was introduced in commit: 5f31dcf in PR #10118
lines causing the issue are:
https://github.com/ManageIQ/manageiq/blob/master/app/controllers/application_controller/buttons.rb#L846-L848

custom button summary:
button_summary

Edit screen -
before
before1

after
after1

@martinpovolny martinpovolny added this to the Sprint 51 Ending Dec 26, 2016 milestone Dec 6, 2016
@martinpovolny martinpovolny merged commit c34468f into ManageIQ:master Dec 6, 2016
@simaishi
Copy link
Contributor

simaishi commented Jan 9, 2017

Euwe backport conflict:

$ git cherry-pick -e -x -m 1 c34468f
error: could not apply c34468f... Merge pull request #13001 from h-kataria/custom_buttons_options_fix
$ git diff
diff --cc app/controllers/application_controller/buttons.rb
index 0a5a548,0578549..0000000
--- a/app/controllers/application_controller/buttons.rb
+++ b/app/controllers/application_controller/buttons.rb
@@@ -820,14 -836,18 +820,27 @@@ module ApplicationController::Button
      # AE_MAX_RESOLUTION_FIELDS.times{@edit[:new][:attrs].push(Array.new)} if @edit[:new][:attrs].empty?
      # num = AE_MAX_RESOLUTION_FIELDS - @edit[:new][:attrs].length
      (AE_MAX_RESOLUTION_FIELDS - @edit[:new][:attrs].length).times { @edit[:new][:attrs].push([]) }
 +    @edit[:new][:target_class] = @resolve[:target_class]
      @edit[:new][:starting_object] ||= "SYSTEM/PROCESS"
 +    @edit[:new][:name] = @custom_button.name
 +    @edit[:new][:description] = @custom_button.description
 +    @edit[:new][:button_image] = @custom_button.options && @custom_button.options[:button_image] ? @custom_button.options[:button_image] : ""
 +    @edit[:new][:display] = @custom_button.options && @custom_button.options.key?(:display) ? @custom_button.options[:display] : true
 +    @edit[:new][:object_message] = @custom_button.uri_message || "create"
      @edit[:new][:instance_name] ||= "Request"
++<<<<<<< HEAD
++=======
+ 
+     @edit[:new].update(
+       :target_class   => @resolve[:target_class],
+       :name           => @custom_button.name,
+       :description    => @custom_button.description,
+       :button_image   => @custom_button.options.try(:[], :button_image).to_s,
+       :display        => @custom_button.options.try(:[], :display).nil? ? true : @custom_button.options[:display],
+       :open_url       => @custom_button.options.try(:[], :open_url) ? @custom_button.options[:open_url] : false,
+       :object_message => @custom_button.uri_message || "create",
+     )
++>>>>>>> c34468f... Merge pull request #13001 from h-kataria/custom_buttons_options_fix
      @edit[:current] = copy_hash(@edit[:new])
  
      @edit[:new][:button_images] = @edit[:current][:button_images] = build_button_image_options

@simaishi
Copy link
Contributor

simaishi commented Jan 9, 2017

@h-kataria Please resolve conflict and make Euwe-specific PR (referencing this one) or suggest other PRs to backport.

@h-kataria
Copy link
Contributor Author

@simaishi create an EUWE PR: #13415

@simaishi
Copy link
Contributor

Backported to Euwe via #13415

@h-kataria h-kataria deleted the custom_buttons_options_fix branch April 14, 2020 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants