Search and Reporting - archived issueshttps://lab.civicrm.org/dev/report/-/issues2022-04-22T15:46:52Zhttps://lab.civicrm.org/dev/report/-/issues/61Search-kit offer actions when grouped by an entity2022-04-22T15:46:52ZeileenSearch-kit offer actions when grouped by an entityWhen we have a search with an entity as group by we should offer actions for that entity
eg.
```
SELECT contact_id, SUM(total_amount) as totes FROM civicrm_contribution GROUP BY contact_id HAVING totes > 2000;
```
Should have contact...When we have a search with an entity as group by we should offer actions for that entity
eg.
```
SELECT contact_id, SUM(total_amount) as totes FROM civicrm_contribution GROUP BY contact_id HAVING totes > 2000;
```
Should have contact actions & the ability to create a smart groups
See https://github.com/civicrm/civicrm-core/pull/19936
@colemanwhttps://lab.civicrm.org/dev/report/-/issues/69How to package SearchKit Displays in an extension2022-04-22T15:46:59ZcolemanwHow to package SearchKit Displays in an extension## Use Case
Ship an extension with SearchKit-based tabs for the Contact Summary screen.
## Requirements
Using a Search Display as a contact summary tab requires 3 interconnected entities:
1. A **SavedSearch** containing the api param...## Use Case
Ship an extension with SearchKit-based tabs for the Contact Summary screen.
## Requirements
Using a Search Display as a contact summary tab requires 3 interconnected entities:
1. A **SavedSearch** containing the api params for the search.
2. A **SearchDisplay** linked to the `SavedSearch` by id (`saved_search_id = $savedSearch.id`).
3. An **Afform** linked to both the `SavedSearch` and the `SearchDisplay` by name (via embedded tag).
## Solutions
### 1. The Status Quo
Afforms can already be packaged as `.aff.html/.aff.json` files, and the Afform API & GUI have excellent handling for packaged Afforms to be overridden and reverted by site admins. If an extension upgrade provides updates to a packaged Afform, overrides will not be affected but the default version will be upgraded automatically.
DAO-based entities like `SavedSearch` and `SearchDisplay` can be packaged as `.mgd.php` files which will be added to the database via `hook_civicrm_managed`. However, the `CRM_Core_ManagedEntities` system doesn't provide any way for admins to override and then revert back to the packaged version, nor to reconcile potentially overridden entities with new packaged versions during extension upgrades. There are also an issue where the system doesn't guerantee write order, and in this case we need it to write the `SavedSearch` prior to the `SearchDisplay`, which contains a foreign key to the former.
Currently there is a workaround using chaining and `'update' = 'never'`, for example as used by the [Deduper Extension](https://github.com/eileenmcnaughton/deduper/blob/master/entities/SavedSearch.mgd.php).
`CRM_Core_ManagedEntities` offers us 2 modes for packaging `SavedSearch` and `SearchDisplay` entities, neither is ideal:
1. **`'update' = 'always'`** will essentially lock the entities. Any changes to the search made by the site admin will be overwritten on a regular basis. This solves the extension upgrade problem at the cost of configurability.
2. **`'update' = 'never'`** will drop the entities into the database and then never touch them again. This is the lesser of two evils because at least this way they are configurable.
**The bottom line:** The status quo allows us to package searches and displays. They will be user-configurable but not revertable (if the admin makes a mess of them, he'd have to delete them all and then uninstall/reinstall the extension). During extension upgrades, the packaged Afforms will update, but changes to `.mgd.php` files will do nothing unless the extension is uninstalled, searches are deleted, and then it's reinstalled.
### 2. Create APIv4 `PackagedEntity` class
This would do something like the `Afform` APIv4 entity: read from the database and *also* from json files. This would need to be opt-in on a per-entity basis (starting with `SavedSearch` and `SearchDisplay`) and would be mostly for configuration entities, as a file/DB hybrid would not be able to perform joins in the GET action.
**Tasks**
1. Add an APIv4 trait `PackagedEntity`
2. Opt-in `SavedSearch` and `SearchDisplay` to use that trait
3. Add a specialized `get` action which would read from json files and the database.
4. Add calculated fields comparable to Afform's `has_base` & `has_local` to `get` output.
**Pros**
- Would give excellent feature parity with Afform's packaged systems.
- Reverting and upgrades would be simple.
**Cons**
- Involves extra file i/o and directory scanning with each `get` - feasible with hundreds of records but not many thousands.
- Restricted to APIv4 as the packaged entities wouldn't exist as far as the DAO is concerned.
- Entities have to opt-in (whereas `mgd` works on any entity).
- Retrofitting an existing API over would involve a slight BC breakage as the new `get` method would be missing `JOIN`, and `HAVING` clauses.
### 3. Improve `CRM_Core_ManagedEntities`
Make the manager aware of whether a record has been manually updated. Add a new `'update' = 'auto'` mode which would intelligently push updates from `.mgd.php` only to untouched records. Add a way to revert a record.
**Tasks**
1. Add an `is_overridden` column to the `civicrm_managed` table.
2. Add some type of trigger to set that column when manual changes are made to a managed entity.
3. Add some type of `Revert` api action (currently the `Managed` class doesn't even have an API so this will take some thought).
4. Add a way to know if a database record has a corresponding managed entry (maybe a calculated field or maybe a DFK join - both would be slightly tricky).
**Pros**
- Fully backward compatible with existing entities.
- Improves the existing "Managed" system instead of inventing a new one.
- Wouldn't be a drag on performance.
**Cons**
- Might be a lot of work.https://lab.civicrm.org/dev/report/-/issues/97SearchKit not functional on Joomla 42022-04-22T15:47:19Zjoshjosh@civicrm.orgSearchKit not functional on Joomla 4The past two release of CiviCRM have resulted in SearchKit not functioning on Joomla 4. When browsing to SearchKit, the user is presented with what appears to be unrendered code:
![Screenshot_2022-02-21_12.13.32](/uploads/5899ba97078e89...The past two release of CiviCRM have resulted in SearchKit not functioning on Joomla 4. When browsing to SearchKit, the user is presented with what appears to be unrendered code:
![Screenshot_2022-02-21_12.13.32](/uploads/5899ba97078e894cb86ba703c06eb300/Screenshot_2022-02-21_12.13.32.jpg)
Console presents the following error:
```
Error: [$injector:unpr] http://errors.angularjs.org/1.8.2/$injector/unpr?p0=savedSearchesProvider%20%3C-%20savedSearches%20%3C-%20searchList
at angular.min.js:7:168
at angular.min.js:46:468
at Object.d [as get] (angular.min.js:44:197)
at angular.min.js:47:29
at d (angular.min.js:44:197)
at e (angular.min.js:44:438)
at Object.instantiate (angular.min.js:45:333)
at angular.min.js:99:267
at Object.link (angular-modules.d0a616a75686afef23d3772fcee92a7f.js:5648:217)
at angular.min.js:17:134 '<div ng-view="" class="ng-scope">'
(anonymous) @ angular.js:15697
```
All other aspects of CiviCRM appear to be functional. The issue can be reproduced at https://cividemo.com and on fresh installs of just Joomla and CiviCRM (no extensions installed on either systems).Monish DebMonish Debhttps://lab.civicrm.org/dev/report/-/issues/76Search Kit: Dropdown for the related contacts entity says "name" but for disp...2022-04-22T15:47:20ZDaveDSearch Kit: Dropdown for the related contacts entity says "name" but for display it shows "label"The field that's in the relationship_cache table is the `name` of the relationship type, so it does make sense that any dropdowns related to it would say `name`. However when you are selecting columns to include in the output, what it ac...The field that's in the relationship_cache table is the `name` of the relationship type, so it does make sense that any dropdowns related to it would say `name`. However when you are selecting columns to include in the output, what it actually displays in the table (correctly I would say) is `label`. So there's a minor disconnect.
![Untitled](/uploads/cb49a36f417ece8211c0da15e5f50c51/Untitled.png)https://lab.civicrm.org/dev/report/-/issues/98SearchKit: granularity of relative dates2022-04-22T15:47:22ZJonGoldSearchKit: granularity of relative datesConsider the following search:
![Selection_1424](/uploads/15243ef6bfd34c2c9e8689275d6e69da/Selection_1424.png)
I would expect this, when run on March 14 2022, to find any donations made on or after March 14, 2021.
However, it takes "1 ...Consider the following search:
![Selection_1424](/uploads/15243ef6bfd34c2c9e8689275d6e69da/Selection_1424.png)
I would expect this, when run on March 14 2022, to find any donations made on or after March 14, 2021.
However, it takes "1 year" rather literally - if I run it at 3pm, it will only catch donations made on March 14, 2021 at or after 3pm. This doesn't match the behavior elsewhere in Civi, where we automatically add a "00:00:00" to the search when setting the beginning date of a search, or "23:59:59" when setting the end date of a search.
**Proposal**: When the interval unit is "Day", "Week", "Month" or "Year" we append the timestamp, much as we do in `CRM_Contact_BAO_Query::dateQueryBuilder()` or `CRM_Report_Form::dateClause()`.https://lab.civicrm.org/dev/report/-/issues/94SearchKit: fieldset legend display in Drupal 9 Seven admin theme2022-04-22T15:47:24ZherbdoolSearchKit: fieldset legend display in Drupal 9 Seven admin themeDrupal 9's default admin theme, Seven, sets an `position: absolute` for fieldset legends (`core/themes/seven/css/components/form.css`) if the fieldset is not in a `.fieldgroup` (`fieldset:not(.fieldgroup) > legend`). It looks like:
![Sc...Drupal 9's default admin theme, Seven, sets an `position: absolute` for fieldset legends (`core/themes/seven/css/components/form.css`) if the fieldset is not in a `.fieldgroup` (`fieldset:not(.fieldgroup) > legend`). It looks like:
![Screenshot_from_2022-01-11_11-10-20](/uploads/9381f41cacc03748bd1b90b7756b8ef6/Screenshot_from_2022-01-11_11-10-20.png)
I guess the easiest is to set a `position: relative` in `civicrm/core/ext/search_kit/css/crmSearchAdmin.css`https://lab.civicrm.org/dev/report/-/issues/39Exporting "Spouse of" or other relationship with matching labels only exports...2022-04-22T15:47:25ZtommyboboExporting "Spouse of" or other relationship with matching labels only exports the A>B relationshipWhen exporting a contact and their related contacts, the relationship type dropdown truncates all the "duplicate" relationship labels. So when you a user selects "Spouse Of" it only exports the A>B relationship.
If you were to export Jo...When exporting a contact and their related contacts, the relationship type dropdown truncates all the "duplicate" relationship labels. So when you a user selects "Spouse Of" it only exports the A>B relationship.
If you were to export John Doe(A) and James Doe(B), who are spouses, the export would be rendered as
| First | Last | Spouse of First | Spouse of Last |
| ------ | ------ | ------ | ------ |
| John | Doe | James | Doe |
| James | Doe | | |
This is an issue if you are trying to export a list of donors and spouses. If the primary donor is the B spouse you will end up with no spouse exported.
This appears to be an old issue.
https://civicrm.stackexchange.com/questions/27001/exporting-spouses-only-exports-one-side-of-relationshiphttps://lab.civicrm.org/dev/report/-/issues/64Event ID is displaying Event Title in reports2022-04-22T15:47:56ZjgentlesEvent ID is displaying Event Title in reportsFirst, when you run a report and include the event ID column in some cases it displays the event title instead. In other cases, it does not show anything for the event id field. This is in CiviCRM 5.36.1.First, when you run a report and include the event ID column in some cases it displays the event title instead. In other cases, it does not show anything for the event id field. This is in CiviCRM 5.36.1.https://lab.civicrm.org/dev/report/-/issues/100SearchKit: Rewrite and Group By don't mix2022-04-22T15:47:57ZJonGoldSearchKit: Rewrite and Group By don't mixWhen using "Rewrite" in a search display, the rendered token for fields we've grouped by only show the first value.
### Steps to Replicate
* Install Search Kit, import the Search/Display below.
* Preview the Display.
* Turn off "Rewrite...When using "Rewrite" in a search display, the rendered token for fields we've grouped by only show the first value.
### Steps to Replicate
* Install Search Kit, import the Search/Display below.
* Preview the Display.
* Turn off "Rewrite" on the "Total Amount" field and preview again.
### Expected Result
Rendered token has the same output as the non-rewritten field.
### Actual Result
Token only renders the first value in a list.
```
[
[
"SavedSearch",
"save",
{
"records": [
{
"name": "group_and_rewrite",
"label": "group and rewrite",
"form_values": null,
"search_custom_id": null,
"api_entity": "Contact",
"api_params": {
"version": 4,
"select": [
"id",
"display_name",
"GROUP_CONCAT(Contact_Contribution_contact_id_01.total_amount) AS GROUP_CONCAT_Contact_Contribution_contact_id_01_total_amount"
],
"orderBy": [],
"where": [],
"groupBy": [
"id"
],
"join": [
[
"Contribution AS Contact_Contribution_contact_id_01",
"LEFT",
[
"id",
"=",
"Contact_Contribution_contact_id_01.contact_id"
]
]
],
"having": []
},
"expires_date": null,
"description": null,
"mapping_id": null
}
],
"match": [
"name"
]
}
],
[
"SearchDisplay",
"save",
{
"records": [
{
"name": "Contacts_Table_1",
"label": "Contacts Table 1",
"saved_search_id.name": "group_and_rewrite",
"type": "table",
"settings": {
"actions": true,
"limit": 50,
"classes": [
"table",
"table-striped"
],
"pager": {
"show_count": true,
"expose_limit": true
},
"sort": [
[
"sort_name",
"ASC"
]
],
"columns": [
{
"type": "field",
"key": "id",
"dataType": "Integer",
"label": "Contact ID",
"sortable": true
},
{
"type": "field",
"key": "display_name",
"dataType": "String",
"label": "Display Name",
"sortable": true
},
{
"type": "field",
"key": "GROUP_CONCAT_Contact_Contribution_contact_id_01_total_amount",
"dataType": "Money",
"label": "(List) Contact Contributions: Total Amount",
"sortable": true,
"rewrite": "[GROUP_CONCAT_Contact_Contribution_contact_id_01_total_amount]"
}
]
},
"acl_bypass": false
}
],
"match": [
"name",
"saved_search_id"
]
}
]
]
```https://lab.civicrm.org/dev/report/-/issues/52Can't see Soft Credit fields on a Contribution Detail Report?2022-04-22T15:47:59ZswebervnaCan't see Soft Credit fields on a Contribution Detail Report?When I add Soft Credit columns to a Contribution Detail Report, the data doesn't show - they're just empty cells:
![image](/uploads/226d25462b7b82772e627914989d7475/image.png)
(That first row/entry you see is in fact a contribution with...When I add Soft Credit columns to a Contribution Detail Report, the data doesn't show - they're just empty cells:
![image](/uploads/226d25462b7b82772e627914989d7475/image.png)
(That first row/entry you see is in fact a contribution with a soft credit, I checked.)https://lab.civicrm.org/dev/report/-/issues/50Searching on address custom field for shared address2022-04-22T15:48:02ZMartinSearching on address custom field for shared addressFound this on Drupal 7 / Civi 5.28.3. We have a custom group on the Address entity with one custom field, and we often use shared addresses for our contacts (for example, an individual uses the address configured on a household contact)....Found this on Drupal 7 / Civi 5.28.3. We have a custom group on the Address entity with one custom field, and we often use shared addresses for our contacts (for example, an individual uses the address configured on a household contact).
For the contact using the shared address (i.e. the individual in the example above):
- The custom field does appear for them, for example on their contact summary page.
- The custom field does not get associated with them when doing any sort of searching (tested in advanced search and search builder).
I tested and confirmed this in dmaster (5.31.alpha1) with the following steps:
1. Created custom group for Address, with custom alphanumeric field as a select input with 3 options.
1. Created individuals test1 and test2, with relationship between them (I think actually the relationship is not needed, but anyways..).
1. Created address on test1 with "opt2" selected on custom field. On test2 selected this address to use as a shared address.
1. At this point both contact summary pages display the correct complete address with opt2 showing.
1. Do advanced search for address custom field opt2. Only contact test1 shows up.
1. Do search builder search for parameter Contacts -> Addr customgroup:customfield -> Primary -> equals -> opt2. Only contact test1 shows up.https://lab.civicrm.org/dev/report/-/issues/41Contributions search result summary not correct2022-04-22T15:48:06ZhfarooqContributions search result summary not correctCMS: Drupal 7.69
CiviCRM: 5.21.3
If contributions with status complete and for "Contributions OR Soft Credits?" field, select "Both" (both contributions and soft credits), in result summary there is a discrepancy seen; Number of total r...CMS: Drupal 7.69
CiviCRM: 5.21.3
If contributions with status complete and for "Contributions OR Soft Credits?" field, select "Both" (both contributions and soft credits), in result summary there is a discrepancy seen; Number of total results does not match with the sum of total contributions and soft credits, please see attached screenshot. I was able to replicate it on [dmaster demo](https://dmaster.demo.civicrm.org/) site at some point back few days but not anymore.
![image](/uploads/ad23a1a46871a5cf9aae541424fc4463/image.png)https://lab.civicrm.org/dev/report/-/issues/26Participant Listing report Unknown column 'contact_civireport.age_at_event2022-04-22T15:48:16ZEmerykZielinskiParticipant Listing report Unknown column 'contact_civireport.age_at_eventHey all,
when I try to sort Participant Listing report by age of the Participant (in the time of the event) i get the following error:
`[debug] $backTrace = #0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(208): CRM_Core_E...Hey all,
when I try to sort Participant Listing report by age of the Participant (in the time of the event) i get the following error:
`[debug] $backTrace = #0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(208): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/html/sites/all/modules/civicrm/packages/DB.php(987): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...")
#3 /var/www/html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...")
#4 /var/www/html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...", "DB_Error", TRUE)
#5 /var/www/html/sites/all/modules/civicrm/packages/DB/common.php(1920): PEAR->__call("raiseError", (Array:7))
#6 /var/www/html/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, "SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...", "1054 ** Unknown column 'contact_civireport.age_at_event' in 'field list'")
#7 /var/www/html/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /var/www/html/sites/all/modules/civicrm/packages/DB/common.php(1229): DB_mysqli->simpleQuery("SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...")
#9 /var/www/html/sites/all/modules/civicrm/packages/DB/DataObject.php(2416): DB_common->query("SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...")
#10 /var/www/html/sites/all/modules/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...")
#11 /var/www/html/sites/all/modules/civicrm/CRM/Core/DAO.php(435): DB_DataObject->query("SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...")
#12 /var/www/html/sites/all/modules/civicrm/CRM/Core/DAO.php(1428): CRM_Core_DAO->query("SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...", TRUE)
#13 /var/www/html/sites/all/modules/civicrm/CRM/Report/Form.php(3076): CRM_Core_DAO::executeQuery("SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...")
#14 /var/www/html/sites/all/modules/civicrm/CRM/Report/Form.php(3561): CRM_Report_Form->buildRows("SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_so...", (Array:0))
#15 /var/www/html/sites/all/modules/civicrm/CRM/Report/Form/Event/ParticipantListing.php(616): CRM_Report_Form->postProcess()
#16 /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php(495): CRM_Report_Form_Event_ParticipantListing->postProcess()
#17 /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Submit.php(74): CRM_Core_Form->mainProcess()
#18 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform(Object(CRM_Report_Form_Event_ParticipantListing), "submit")
#19 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Event_ParticipantListing), "submit")
#20 /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("submit")
#21 /var/www/html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(114): CRM_Core_Controller->run()
#22 /var/www/html/sites/all/modules/civicrm/CRM/Report/Page/Instance.php(90): CRM_Utils_Wrapper->run("CRM_Report_Form_Event_ParticipantListing", NULL, (Array:0))
#23 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(284): CRM_Report_Page_Instance->run((Array:4), NULL)
#24 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#25 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#26 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(444): CRM_Core_Invoke::invoke((Array:4))
#27 /var/www/html/includes/menu.inc(527): civicrm_invoke("report", "instance", "26")
#28 /var/www/html/index.php(21): menu_execute_active_handler()
#29 {main}`
is there a way to set up the column `contact_civireport.age_at_event` by myself?https://lab.civicrm.org/dev/report/-/issues/29In membership detail report the join date field has a different output date f...2022-04-22T15:48:17ZDaveDIn membership detail report the join date field has a different output date format than the other date fieldsCan reproduce on dmaster.demo.
On the membership details report in the columns tab select join date as a field. When you run the report the join date column has a different date format than the start/end date. It seems to always be yyyy...Can reproduce on dmaster.demo.
On the membership details report in the columns tab select join date as a field. When you run the report the join date column has a different date format than the start/end date. It seems to always be yyyy-mm-dd.
Doesn't seem to be a recent issue.https://lab.civicrm.org/dev/report/-/issues/79When using the Search Kit and Form Builder to implement a front-end Search Li...2022-04-22T15:48:18Zjustinfreeman (Agileware)When using the Search Kit and Form Builder to implement a front-end Search Listing, how do include a Reset button to clear the search criteria?When using the Search Kit and Form Builder to implement a front-end Search Listing, how do include a Reset button to clear the search criteria?
Ideally, this button would be displayed AFTER the Search button.
![Screenshot_20211112_1744...When using the Search Kit and Form Builder to implement a front-end Search Listing, how do include a Reset button to clear the search criteria?
Ideally, this button would be displayed AFTER the Search button.
![Screenshot_20211112_174423](/uploads/f2f61352919076062a21c720358beb57/Screenshot_20211112_174423.png)https://lab.civicrm.org/dev/report/-/issues/63Add recurring contributions to contribution reports2022-04-22T15:48:19ZlarsssandergreenAdd recurring contributions to contribution reportsIt would be very convenient to be able to do filter by recurring contributions for reports, add recurring contributions as a column or even group by.
[Here's a PR that adds this for the Contribution Summary report.](https://github.com/c...It would be very convenient to be able to do filter by recurring contributions for reports, add recurring contributions as a column or even group by.
[Here's a PR that adds this for the Contribution Summary report.](https://github.com/civicrm/civicrm-core/pull/20168) I will also implement in other relevant reports once this has been reviewed.https://lab.civicrm.org/dev/report/-/issues/74Cannot save a copy of a report without the "administer reports" permission2022-04-22T15:48:24ZbgmCannot save a copy of a report without the "administer reports" permissionTo reproduce:
* Create a user with the following permissions
* access CiviReport
* access Report Criteria
* save Report Criteria
* Go to an existing report (or a template)
* Refresh the results
* Under Actions, click "save as"
Re...To reproduce:
* Create a user with the following permissions
* access CiviReport
* access Report Criteria
* save Report Criteria
* Go to an existing report (or a template)
* Refresh the results
* Under Actions, click "save as"
Result: javascript error: "TypeError: $refresh_field.html() is undefined"
![report-saveas-2021-08-05_14-45](/uploads/8f943673067f615dc13147159fc50c17/report-saveas-2021-08-05_14-45.png)https://lab.civicrm.org/dev/report/-/issues/66Reports need validation on Email Delivery fields2022-04-22T15:48:26ZandrewcormickdockeryReports need validation on Email Delivery fieldsSee attached image. When trying to send reports via the Email Delivery tab, the emails do not get sent if invalid characters are included in either the To or the CC fields. In our case, the user included extraneous spaces and commas, a...See attached image. When trying to send reports via the Email Delivery tab, the emails do not get sent if invalid characters are included in either the To or the CC fields. In our case, the user included extraneous spaces and commas, as shown in the diagram. No warning is given to the user in this instance, which leads to confusion when the emails don't get sent, and a system administrator needs to examine errors on the back end to determine the problem and correct it. It would be much preferable for appropriate validation to occur on these fields to prevent invalid values from being entered in the first place, with messages being displayed towards the user entering the invalid values.
URL for this screen: https://example.com/civicrm/report/instance/####?reset=1&output=criteria where #### is the report instance ID.
CiviCRM version: 5.35.2
![image](/uploads/d1fb446ce1c82f0d10b7a57a64f6753b/image.png)https://lab.civicrm.org/dev/report/-/issues/13Contribution Detail Report: cannot sort by Contribution Status, when filter "...2022-04-22T15:48:27ZbgmContribution Detail Report: cannot sort by Contribution Status, when filter "Contribution OR Soft Credit = Both"I found that this odd combination of criteria will crash the Contribution Detail report:
* Sort: Contribution Status
* Filters: Contribution OR Soft Credit? = Both
This will result in a fatal error: "The used SELECT statements have a d...I found that this odd combination of criteria will crash the Contribution Detail report:
* Sort: Contribution Status
* Filters: Contribution OR Soft Credit? = Both
This will result in a fatal error: "The used SELECT statements have a different number of columns".
More specifically:
```
CREATE TEMPORARY TABLE civireport_contribution_detail_temp3 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
(SELECT * FROM civicrm_tmp_e_dflt_2be28f58f1295cc154076c2ded818b52)
UNION ALL
(SELECT * FROM civireport_contribution_detail_temp2)
```
where `temp1` has `civicrm_contribution_contribution_status_id`, but `temp2` does not.
I don't think it's a recent regression. I tested in CiviCRM 5.12 (master) and 5.8.https://lab.civicrm.org/dev/report/-/issues/21Contribution Details Statistics are multiplied under many circumstances2022-04-22T15:48:29ZJonGoldContribution Details Statistics are multiplied under many circumstancesThis bug was previously identified and fixed as core#655, but the fix only addresses the rows and not the statistics.
In addition to contribution detail rows getting multiplied by soft credits, they can be multipled by any one-to-many `...This bug was previously identified and fixed as core#655, but the fix only addresses the rows and not the statistics.
In addition to contribution detail rows getting multiplied by soft credits, they can be multipled by any one-to-many `JOIN` to the contribution table. Soft credits are one example, but it can also be to a contact's multi-record contact field group, or if you pick a field (like "Credit Card Type") that lives in the financial transaction tables ([first reported on SE](https://civicrm.stackexchange.com/a/28791/12) by @KarinG).
Given that the statistics don't concern itself with any data that's not in `civicrm_contribution`, we can replace the flawed (and potentially CPU-intensive) original query with a list of contribution IDs and only use `FROM civicrm_contribution`.JonGoldJonGold