-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
CRM-20578: Empty update of Activity assignee/target results into DB e… #10361
Conversation
Jenkins re test this please |
What happens if we just remove that check, like the code comments suggest to do? |
This part is to check if correct contact ids are passed in source, assignee and target keys of params. If there are If I remove this, the error would be replaced by DB error(constraint violation). Similar error is shown on contribution create api if |
I think we decided early on with the api that we didn't really want to impose a performance cost on every api call just to give developers clearer information when they get it wrong. I don't know if it has been changed - since I can't find evidence of calls to https://github.com/civicrm/civicrm-core/blob/master/api/v3/utils.php#L1639-L1639 but there was code that validated constraints AFTER DB constraint error - giving extra information in that case, but not adding unnecessary queries if all the fields were present |
@eileenmcnaughton Moved foreign key validation for activity contact to wrapper when they are passed as an array. Now the error would be shown as |
@jitendrapurohit that seems good as an api behaviour, and the test fails are unrelated. Is the screen capture you displayed a 'real' one or a simulated one' - if the former should we be catching the exception at the display layer? |
This is the simulated one which I got when I write the api in Invoke.php(just to test). The real would be the yellow part with the backtrace of where the api is being called(if backtrace is enabled on the site). When tried from the api explorer, it displays like where the |
Ok - I think that is good. The limited error message is correct & the extra info is good too. Merging |
Thanks @eileenmcnaughton |
…rror. https://issues.civicrm.org/jira/browse/CRM-20578