Created attachment 1482686 [details] Steps and BZ refection. Description of problem: ----------------------- With `submit all` and display for `single and list` getting the error while executing for multiple entities objects. I tested it with two objects VM and Host. It may be refect on all other custom button objects as sharing the same bunch of code. Version-Release number of selected component (if applicable): ------------------------------------------------------------- Version 5.10.0.14.20180831154906_2f9a1dd How reproducible: ---------------- Always Steps to Reproduce: ------------------- 1. Create a custom button group on with HOST/VM object 2. Create a custom button with the following configuration Dialog: None Open URL: false Display for: Single and list Submit: Submit all System/Process/: Request Request: InspectMe 3. Now navigate to object `All` Page 4. Try to execute custom button with a single object. It will work 5. Now, try to select `multiple/all` objects on `All` page. Actual results: -------------------- Error executing: "submit_all button" undefined method `primary_key' for Vm::ActiveRecord_Relation:Class Expected results: ----------------------- It should execute and send a single request for all selected objects. Additional info: ---------------------- Attaching gif file
I was able to reproduce this with a Host button. Works on a single item but if you select multiple items, the error occurs. Reproducer : 10.8.198.217 Billy
https://github.com/ManageIQ/manageiq/pull/18042
New commit detected on ManageIQ/manageiq/hammer: https://github.com/ManageIQ/manageiq/commit/9a9f529a3be9c31132cc9d57a809faeb7e23661f commit 9a9f529a3be9c31132cc9d57a809faeb7e23661f Author: Brandon Dunne <brandondunne> AuthorDate: Mon Oct 1 14:35:47 2018 -0400 Commit: Brandon Dunne <brandondunne> CommitDate: Mon Oct 1 14:35:47 2018 -0400 Merge pull request #18042 from d-m-u/custom_button_event_fix_for_bz1628224 Create custom button events for each object in target list (cherry picked from commit 4b78ead7c15a39ac01fb17b9678cd64b7378007a) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628224 app/models/custom_button.rb | 6 +- spec/models/custom_button_spec.rb | 30 +- 2 files changed, 29 insertions(+), 7 deletions(-)
https://github.com/ManageIQ/manageiq/pull/18056
Ok, sorry Nikhil, take two!
New commit detected on ManageIQ/manageiq/hammer: https://github.com/ManageIQ/manageiq/commit/1310fd6601221b8940e73edfdc7dbbaeba8d6271 commit 1310fd6601221b8940e73edfdc7dbbaeba8d6271 Author: Greg McCullough <gmccullo> AuthorDate: Fri Oct 5 10:51:47 2018 -0400 Commit: Greg McCullough <gmccullo> CommitDate: Fri Oct 5 10:51:47 2018 -0400 Merge pull request #18056 from d-m-u/use_whoops_size_rather_than_possibly_nonexistent_array Force targets to be an array so we can each them in cb run on multiple objects (cherry picked from commit ead55ecf0c3b576028caaa3103b7b2b190508c7c) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628224 app/models/custom_button.rb | 2 +- spec/models/custom_button_spec.rb | 49 +- 2 files changed, 36 insertions(+), 15 deletions(-)
I tested it with Version 5.10.0.19 UI error fixed nearly for all custom button type objects but... with button conf: Submit: Submit all Suppose I have 20 entities and when I select all of those and execute custom button flash message awesome but I am not getting a request in automation log. It should fire a single request for 20 entities. test_infra_objects.py::test_custom_button_automate[Datastore-virtualcenter-Submit_all] FAILED test_infra_objects.py::test_custom_button_automate[Template_image-virtualcenter-Submit_all] FAILED with button conf: Submit: One by One automation log showing me 20 request after execution. test_infra_objects.py::test_custom_button_automate[Template_image-virtualcenter-One_by_one] PASSED
https://github.com/ManageIQ/manageiq-automation_engine/pull/250
Okay, peeps, please ignore comment 15, and in lieu of it, here's this: https://github.com/ManageIQ/manageiq/pull/18088 cause I like that solution better. Thanks!
Okay, peeps, the PR listed in comment 16 isn't the right one, either.
https://github.com/ManageIQ/manageiq-automation_engine/pull/258
New commit detected on ManageIQ/manageiq-automation_engine/hammer: https://github.com/ManageIQ/manageiq-automation_engine/commit/58ec9220bc415118cf5ec3c214e6db7f6e72de27 commit 58ec9220bc415118cf5ec3c214e6db7f6e72de27 Author: Greg McCullough <gmccullo> AuthorDate: Thu Oct 25 09:35:51 2018 -0400 Commit: Greg McCullough <gmccullo> CommitDate: Thu Oct 25 09:35:51 2018 -0400 Merge pull request #258 from d-m-u/integer_or_Integer_in_object_convert_value_based_on_datatype convert_value_based_on_datatype won't take "Integer" (cherry picked from commit 67488e44a7d3529400f55f34d1a9a8452e8ee0b0) https://bugzilla.redhat.com/show_bug.cgi?id=1628224 lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_object.rb | 2 +- spec/miq_ae_object_spec.rb | 6 + 2 files changed, 7 insertions(+), 1 deletion(-)
tested with 5.10.0.22 working fine