Bug 1770300
| Summary: | When trying to delete Service Dialogs, we get an error that custom button is not found | |||
|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | mabah <mabah> | |
| Component: | Automate | Assignee: | Martin Hradil <mhradil> | |
| Status: | CLOSED NOTABUG | QA Contact: | Nikhil Dhandre <ndhandre> | |
| Severity: | high | Docs Contact: | Red Hat CloudForms Documentation <cloudforms-docs> | |
| Priority: | high | |||
| Version: | 5.10.11 | CC: | dmetzger, duhlmann, gmccullo, hkataria, lpichler, mfeifer, mhradil, mkanoor, mshriver, obarenbo, simaishi, tfitzger | |
| Target Milestone: | GA | Keywords: | Reopened, TestOnly, ZStream | |
| Target Release: | 5.12.0 | Flags: | lpichler:
needinfo-
mfeifer: mirror+ |
|
| Hardware: | x86_64 | |||
| OS: | Other | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1783382 1783383 (view as bug list) | Environment: | ||
| Last Closed: | 2020-06-10 13:00:07 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | Bug | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | CFME Core | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1783382, 1783383 | |||
|
Comment 7
Tina Fitzgerald
2019-11-14 19:14:50 UTC
Hi Mabah, The customer states that "We have several old Dialogs." Can you ask the customer to recreate the issue with a new service dialog? Thanks, Tina (In reply to Tina Fitzgerald from comment #8) > Hi Mabah, > > The customer states that "We have several old Dialogs." > Can you ask the customer to recreate the issue with a new service dialog? > > Thanks, > Tina Hi Tina, Sorry for the delayed response on this. I am OoO on PTO and just got back this morning. I will be working with the customer today and update the case. Thanks, Mamadou Thanks for the info! I managed to reproduce the issue in question. Unfortunately the only way I could reproduce was by manually deleting the custom button using a delete in rails console -- an action that doesn't run callbacks and will not correctly remove the relationships necessary to be able to delete this. I don't think this is a valid issue for that reason. Precisely as you said in the description, destroy runs any callbacks on the model while delete doesn't. So anyone who runs a delete is going to end up with issues where the associations are still present and won't have been correctly removed. Based on the fact that there is no way that I'm aware of for this issue to arise without manual deletion of the custom buttons outside the application, Dennis informs me I can close this ticket as not a bug. (In reply to drew uhlmann from comment #13) > Based on the fact that there is no way that I'm aware of for this issue to > arise without manual deletion of the custom buttons outside the application, > Dennis informs me I can close this ticket as not a bug. Drew, let's not close it yet, until at least I get the video reproducer from the customer. I understand that you are only able to reproduce via the rails c, however the issue with the customer is that they cannot delete the buttons from UI. Thanks, Mamadou >> or could the API be doing delete instead of destroy?
Nope, I verified that on 5.10.11 an API custom button removal runs the callback.
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/773a1547fb99d0fb1b91d28ce1f6ce5f53f44490 commit 773a1547fb99d0fb1b91d28ce1f6ce5f53f44490 Author: Martin Hradil <mhradil> AuthorDate: Tue Dec 3 16:43:01 2019 -0500 Commit: Martin Hradil <mhradil> CommitDate: Tue Dec 3 16:43:01 2019 -0500 Dialog#destroy should ignore resource actions linking nonexisting entities Currently, if you have a Dialog associated with a Custom Button, and `delete` the custom button (as opposed to `destroy`; that should not happen, but apparently does), deleting the dialog will fail, because `ra.resource_type.constantize.find(ra.resource_id)` throws an exception as the resource no longer exists. (The resource being a removed custom button.) So, updating `reject_if_has_resource_action` to ignore resource actions pointing to nonexistent resources. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1770300 app/models/dialog.rb | 8 +- spec/models/dialog_spec.rb | 10 + 2 files changed, 16 insertions(+), 2 deletions(-) The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days |