CRM-20545 - port extended reports metadata approach to adding columns #11276
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
Port extended reports approach to metadata for fields alternative to #11244. Note that the ticket suggested is_deleted filtering should be added - this does it but it can be unset. Filtering by is_deleted probably DOES make sense, but not by is_deceased
Before
Contribution detail report not filtered by is deleted or is_deceased
After
Contribution detail report not filtered by is deceased but is filtered by deleted - but that can be altered in the report by the user. Extended reports metadata method exists
Technical Details
@colemanw this is what the extended reports approach looks like - obviously it seems quite long but the idea is that on the individual reports you don't define all the fields - although you can define special treatment of them - in this case overriding the default order by (display-name - although perhaps sort_name makes more sense), the default fields (to be the same as the existing report), to specify not to display id & to require it & to specify a filter.
The no_field_disambiguation I added - normally a common error in reports is ambiguity between 2 reports fields - ie. 'status_id' on case and on activity or something. This causes a tonne of issues so normally I append a string to disambiguate, but it would change the saved field names, so erring on the side of existing behaviour.
Note this code is the basis for the reports allowing details about 2 contacts in one report - because of the 'prefix' stuff