Issue while creating a Custom Button with expression via API
Similar to https://github.com/ManageIQ/manageiq-api/issues/1053, setting a custom button expression through the API is different than setting it on the backend (note the MiqExpression in the visibility expression below in the first part but not in the second part.
Discussed in https://github.com/ManageIQ/manageiq/discussions/21904
Originally posted by Inkompetenz20 June 3, 2022 Hello,
I want to add a custom Button via the API of ManageIQ. After my API call, the button exists in ManageIQ, but the enablement and visibility expressions are not displayed.

The first select statement displays the button, when added/updated via the GUI and the secound select statement displays the button, when added/updated via API.
I think it looks like a similar error as in https://github.com/ManageIQ/manageiq-api/issues/1053. Is this a known error?
Best, Paul
@kbrock Can you take a look at this one?
Hi @kbrock, is there an update on the issue? Is there more information we can deliver to make the problem more clear? Our manageIQ breaks regularly due to the problem with custom buttons and their visibility expression.
e.g.
1-ui-6ff548c899-dp9ln 1-ui {"@timestamp":"2022-08-16T07:43:19.122458 ","hostname":"1-ui-6ff548c899-dp9ln","pid":8,"tid":"acb48","service":"production","level":"crit","message":"Error caught: [NoMethodError] undefined method
lenient_evaluate' for #<Hash:0x000055e0f0fe7d98>\n/var/www/miq/vmdb/app/models/custom_button.rb:208:inevaluate_visibility_expression_for'\n/var/www/miq/vmdb/app/models/custom_button_set.rb:87:inblock (2 levels) in filter_with_visibility_expression'\n/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.5.1/lib/active_record/relation/delegation.rb:88:ineach'\n/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.5.1/lib/active_record/relation/delegation.rb:88:in `each'\n
Thanks a lot, Thomas
This issue has been automatically marked as stale because it has not been updated for at least 3 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.
This issue has been automatically marked as stale because it has not been updated for at least 3 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.
@kbrock I think this is still an issue - since you're currently in MiqExpression code, can you take a look at this one?
There is a deep_symbolize_keys in there. I'll see what parts of the symbolize are necessary.
This issue has been automatically marked as stale because it has not been updated for at least 3 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.
This issue has been automatically marked as stale because it has not been updated for at least 3 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.
This issue has been automatically marked as stale because it has not been updated for at least 3 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.
This issue has been automatically marked as stale because it has not been updated for at least 3 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.