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

Use correct params for find_record_with_rbac in resize method #1139

Merged
merged 1 commit into from Apr 26, 2017
Merged

Use correct params for find_record_with_rbac in resize method #1139

merged 1 commit into from Apr 26, 2017

Conversation

petrblaho
Copy link

@petrblaho petrblaho commented Apr 24, 2017

find_record_with_rbac expects ActiveRecord like class as first parameter.
During previous refactoring a mistake was introduced and session[:userid] was
passed as first parameter and that caused "undefined method `find_by' for
"admin":String [vm/resize]" when trying to go to reconfigure a VM dialog page.

This corrects that.

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

@romanblanco
Copy link
Member

@miq-bot add_label bug, rbac

@petrblaho
Copy link
Author

How to reproduce original issue (assuming master manageiq, manageiq-ui-classic and manageiq-providers-openstack repos):

  1. Have a VM with OpenStack Cloud provider and more than 1 Flavor.
  2. Select VM from a list of VM or go to VM's detail page.
  3. Click on "Configuration" in toolbar, then "Reconfigure selected/this instance"

Result without this patch: error page with "undefined method `find_by' for
"admin":String [vm/resize]" message.
Result with patch: reconfigure dialog page for VM

@petrblaho
Copy link
Author

Error page after step 3 without patch:
manageiq_exceptions_-_2017-04-24_19 03 27

@petrblaho
Copy link
Author

Result of the same actions after applying patch:
manageiq_vms_and_instances_-_2017-04-24_19 10 40

find_record_with_rbac expects ActiveRecord like class as first parameter.
During previous refactoring a mistake was introduced and session[:userid] was
passed as first parameter and that caused "undefined method `find_by' for
"admin":String [vm/resize]" when trying to go to reconfigure a VM dialog page.

This corrects that.

https://bugzilla.redhat.com/show_bug.cgi?id=1445005
@miq-bot
Copy link
Member

miq-bot commented Apr 24, 2017

Checked commit https://github.com/petrblaho/manageiq-ui-classic/commit/52c029d8999a5859c92b57efedff57bdfe171a18 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks good. 🏆

@tzumainn
Copy link
Contributor

@miq-bot label fine/yes

@tzumainn
Copy link
Contributor

@miq-bot add_label fine/yes

@miq-bot
Copy link
Member

miq-bot commented Apr 25, 2017

@tzumainn unrecognized command 'label', ignoring...

Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

@martinpovolny martinpovolny added this to the Sprint 60 Ending May 8, 2017 milestone Apr 26, 2017
@martinpovolny martinpovolny merged commit 6c9563c into ManageIQ:master Apr 26, 2017
@tzumainn
Copy link
Contributor

@miq-bot add_label blocker

@simaishi
Copy link
Contributor

@petrblaho The refactoring PR (#919) is not in Fine branch and I'm not sure what change is needed in Fine if any. Can you please create a Fine PR?

FYI, the current Fine branch has:

def resize
    @record ||= VmOrTemplate.find_by_id(params[:rec_id])

@petrblaho
Copy link
Author

@simaishi this PR solved issue introduced by #919 as you noted. So I think this is not needed in fine. I cannot reproduce https://bugzilla.redhat.com/show_bug.cgi?id=1445005 on fine branch.

@simaishi
Copy link
Contributor

@petrblaho Thanks for the confirmation, removed the flags.

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.

None yet

6 participants