-
-
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
Migrate custom file attachments to new case on reassignment. #14213
Conversation
(Standard links)
|
I like the test! We are adding new functionality specifically to the case entity so we should think about whether there are any cases for this for other entities or it truly is case-specific. Also, we are by-passing the api so we are bypassing hooks and acls (the latter might not be relevant) when we use the dao methods |
Also - how does this relate to the custom field handling we added to the DAO class to copy custom files? |
A big part of the |
Test failure is related. |
test this please |
@agilewarealok it's a style failure |
23c5fdd
to
c147e17
Compare
c147e17
to
ea44f0f
Compare
I think DAO is already handling the custom fields copy in I've removed my copy files code and now the Test case I've written is throwing an error. Can someone guide on this? So we can get this merged in. @eileenmcnaughton @mattwire |
@agilewarealok I took a look - the issue is the file doesn't exist so the call to CRM_Core_BAO_File::path doesn't retrieve it I took a look at how api_v3_AttachmentTest works & it has a fn like this
What we've been doing is moving utilities in the test code base that support specific types of testing to traits - e.g CRMTraits_ACL_PermissionTrait I think maybe we want a CRMTraits_Core_FileTrait & then move the functions from AttachmentTest that are needed here into that trait & use it from this test (otherwise it's duplication) |
Separate from the test, the code in copyGeneric is duplicating the code at https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/BAO/Case.php#L2110, so I get a duplicate INSERT error when I try to reassign a case with a custom field (of any type not just file). If the plan is to use copyGeneric/copyCustomFields then need to also remove the duplicate code? |
@eileenmcnaughton please close this PR. I think we'll re-submit a new one. |
@jusfreeman - sure - but can't you close them? |
…ts to new case on reassignment Add unit test from PR civicrm#14213 Migrate custom file attachments to new case on reassignment. civicrm#14213
…ts to new case on reassignment Add unit test from PR civicrm#14213 Migrate custom file attachments to new case on reassignment. civicrm#14213
Unit test has been copied to #15051 |
…ts to new case on reassignment Add unit test from PR civicrm#14213 Migrate custom file attachments to new case on reassignment. civicrm#14213
…ts to new case on reassignment Add unit test from PR civicrm#14213 Migrate custom file attachments to new case on reassignment. civicrm#14213
…ts to new case on reassignment Add unit test from PR civicrm#14213 Migrate custom file attachments to new case on reassignment. civicrm#14213
…ts to new case on reassignment Add unit test from PR civicrm#14213 Migrate custom file attachments to new case on reassignment. civicrm#14213
…ts to new case on reassignment Add unit test from PR civicrm#14213 Migrate custom file attachments to new case on reassignment. civicrm#14213
Overview
Steps to reproduce the bug:
That does not work, CiviCRM Redirects to Contact's Cases Tab with bounce message "Could not retrieve File"
Before
Custom file attachments are not migrated to the new case.
After
Custom file attachments are migrated to the new case and downloadable.
Comments
Agileware Ref: CIVICRM-967