dev/core#893 - fix misfiled case print/merge pdfs (alternate to PR 15609/15364) #15626
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This is the mostly the same as #15609 and the intent of #15364 but with some cleanup and a unit test.
@ray-wright @mattwire
Before
When doing a pdf document merge on case search results, if the order of the case ids as passed in from search results differed from the order that mysql naturally returns internally, the documents get filed incorrectly. See lab ticket and other PR for more detail.
After
Filed properly.
Technical Details
As discussed at #15364 (comment), this takes a step towards removing a static function with parameters and instead using the CRM_Core_Form_Task base class and overriding variables in the subclass. Also allowing for component-specific ordering where needed.
The copied function getContactIDsFromComponent() is exactly the same as the one from CRM_Core_DAO except for lines 244 and 250 where the $orderBy is used.
Comments
If you comment out the orderBy function in Case/Form/Task.php so that it functions the same as it was before without ordering and run the test, it shows how the contact ids didn't match up to case_ids.