Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-08-07T05:03:23Zhttps://lab.civicrm.org/dev/core/-/issues/2589doPayment vs doDirectPayment and $0 payments - regression, bug or feature?2023-08-07T05:03:23ZAlanDixondoPayment vs doDirectPayment and $0 payments - regression, bug or feature?As per https://github.com/iATSPayments/com.iatspayments.civicrm/issues/362 it appears that the switch from doDirectPayment to doPayment can result in $0 transactions being sent to payment processors.
@mattwire has kindly provided some c...As per https://github.com/iATSPayments/com.iatspayments.civicrm/issues/362 it appears that the switch from doDirectPayment to doPayment can result in $0 transactions being sent to payment processors.
@mattwire has kindly provided some code to handle the issue in this extension, but I wonder if it was intentional, and if so why, and if it should be documented somewhere.
Or whether doPayment should be smarter?https://lab.civicrm.org/dev/core/-/issues/2588Unable to send transactional email to more than 2 recipients if there is an a...2021-05-07T03:42:47Zfreeform.stephUnable to send transactional email to more than 2 recipients if there is an attachmentOverview
----------------------------------------
If you attempt to send a transactional email with an attachment to 3 or more contacts, there is an error:
> Sorry, due to an error, we are unable to fulfill your request at the moment. Y...Overview
----------------------------------------
If you attempt to send a transactional email with an attachment to 3 or more contacts, there is an error:
> Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
>
> One of parameters (value: ) is not of the type Integer
The first 2 contacts receive the message, but no one else does.
There is no issue observed if there is no attachment, nor if there is an attachment but only 2 recipients.
I replicated the error on two different sites with two different SMTP providers, both running CiviCRM 5.36.1.
This may be related to an issue someone else reported here: https://civicrm.stackexchange.com/questions/39254/contacts-new-email-fails-when-sending-to-more-than-one-contact-after-upgrade-to/39463#39463
Reproduction steps
----------------------------------------
1. View the contacts of a group
1. Select 3 or more contacts
1. Select action "Email - send now (to 50 or less)"
1. Compose a message and include an attachment (I used a pdf that was only 13kb)
Current behaviour
----------------------------------------
> Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your
> administrator or service provider with more details about what action you were performing when this occurred.
> One of parameters (value: ) is not of the type Integer
Full message in error log:
```
May 04 19:06:02 [error]
$Fatal Error Details = array:3 [
"message" => "One of parameters (value: ) is not of the type Integer"
"code" => null
"exception" => CiviCRM_API3_Exception {#1944
-extraParams: array:4 [
"tip" => "add debug=1 to your API call to have more info about the error"
"is_error" => 1
"error_message" => "One of parameters (value: ) is not of the type Integer"
"error_code" => "undefined"
]
#message: "One of parameters (value: ) is not of the type Integer"
#code: 0
#file: "/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/api/api.php"
#line: 133
trace: {
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/api/api.php:133 {
› if (is_array($result) && !empty($result['is_error'])) {
› throw new CiviCRM_API3_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result);
› }
}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php:984 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php:1180 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Contact/Form/Task/EmailTrait.php:431 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Contact/Form/Task/EmailTrait.php:351 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Form.php:526 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php:152 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php:119 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Controller.php:347 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:313 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
/var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/drupal/civicrm.module:458 { …}
/var/www/vhosts/example.org/httpdocs/includes/menu.inc:527 { …}
/var/www/vhosts/example.org/httpdocs/index.php:21 { …}
}
}
]
May 04 19:06:02 [debug] $backTrace = #0 /var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Error.php(433): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CiviCRM_API3_Exception))
#2 /var/www/vhosts/example.org/httpdocs/sites/all/modules/civicrm/drupal/civicrm.module(458): CRM_Core_Invoke::invoke((Array:3))
#3 /var/www/vhosts/example.org/httpdocs/includes/menu.inc(527): civicrm_invoke("group", "search")
#4 /var/www/vhosts/example.org/httpdocs/index.php(21): menu_execute_active_handler()
#5 {main}
```
Expected behaviour
----------------------------------------
All recipients should receive mail with attachments without error
Environment information
----------------------------------------
* __CiviCRM:__ _5.36.1_
* __PHP:__ _7.3.27_
* __CMS:__ _Drupal 7_
* __Database:__ _MariaDB 5.5.5-10.3.28-MariaDB-log_5.37.0https://lab.civicrm.org/dev/core/-/issues/2587Editing a mailing triggers two autosaves instead of one2022-01-07T13:49:52ZromainEditing a mailing triggers two autosaves instead of oneWhen editing a mailing or an A/B mailing, any change to the content triggers an autosave after 5 seconds, as expected. But 5 seconds after the first autosave, another one gets triggered even if nothing was changed after the first save.
...When editing a mailing or an A/B mailing, any change to the content triggers an autosave after 5 seconds, as expected. But 5 seconds after the first autosave, another one gets triggered even if nothing was changed after the first save.
This is no big deal in most situations, but when saving a mailing is slow on the server side to a point it's longer than 5 seconds (because of overloading or contention at that moment), this actually makes things worse.
I debugged the JS code, and found out that it's because [the autoSave controller stores a copy of the mailing before calling the server](https://lab.civicrm.org/dev/core/-/blob/master/ang/crmAutosave.js#L36), and when the server replies [the modified date of the mailing is updated by the `crmMailingMgr`](https://lab.civicrm.org/dev/core/-/blob/master/ang/crmMailing/services.js#L378) with the one coming from the server. As a result, the mailing object and "last seen" copy differ by the modified date, and the autoSave controller detects a change.
Not too sure what would be the best way to solve this as I'm not familiar at all with this part of the code. Maybe the `options.save` promise of the autoSave should allow for a result when resolving, that would replace the lastSeen copy? But replacing lastSeen after the save may also be a risk of conflicting with any change that the user did?5.47.0https://lab.civicrm.org/dev/core/-/issues/2586CiviContribute: Cannot clear the Thank-you Date (does not set to null on save)2021-05-06T01:47:07ZpbarmakCiviContribute: Cannot clear the Thank-you Date (does not set to null on save)Overview
----------------------------------------
When editing a Contribution in version 5.36.1, we click on the x to clear the Thank-you Date field. It removes the date and time. But, when we click Save, the field remains with the last-...Overview
----------------------------------------
When editing a Contribution in version 5.36.1, we click on the x to clear the Thank-you Date field. It removes the date and time. But, when we click Save, the field remains with the last-used data/time. It does not saved the cleared/null value. This is true on the latest demo as well.
Reproduction steps
----------------------------------------
1. Find any contribution. Click View. Then click Edit.
2. Click the small x next to the time field to clear out the date and time (or simply erase/delete what is there)
3. Click Save.
4. View the contribution, and the Thank-you Date is still set to the old value.
Expected behaviour
----------------------------------------
It should clear out the value of that field.
Environment information
----------------------------------------
<!-- Some of the items below may not be relevant for every bug - if in doubt please include more information than you think is neccessary. -->
* __Browser:__ _Firefox 88
* __CiviCRM:__ 5.36.1
* __PHP:__ 7.3
* __CMS:__ Drupal 75.37.1https://lab.civicrm.org/dev/core/-/issues/2585GroupContact pre/post hooks have inconsistent signatures2023-08-08T05:03:21ZJonGoldGroupContact pre/post hooks have inconsistent signaturesFixing this is going to require breaking the extension contract, so I think it needs core team approval.
I think the inconsistency was introduced as an unintended side effect of...introducing consistency (for API4).
Looking at [CRM_Con...Fixing this is going to require breaking the extension contract, so I think it needs core team approval.
I think the inconsistency was introduced as an unintended side effect of...introducing consistency (for API4).
Looking at [CRM_Contact_BAO_GroupContact](https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/BAO/GroupContact.php), the `pre` and `post` hooks are called three times each - once in `add()`, once in `addContactsToGroup()`, once in `removeContactsFromGroup`.
Compare signatures:
```php
// add()
CRM_Utils_Hook::pre($hook, 'GroupContact', CRM_Utils_Array::value('id', $params), $params);
// addContactsToGroup() and removeContactsFromGroup()
CRM_Utils_Hook::pre('create', 'GroupContact', $groupId, $contactIds);
```
The second one is obviously incorrect, but has existed since SVN times. The `add()` hook was introduced by @colemanw in 5.6 in [PR 12382](https://github.com/civicrm/civicrm-core/pull/12832).
In addition to the change in signature (which will require communication with extension devs) this will probably also introduce a performance hit when removing folks from groups, but that's unavoidable(?).
@jaapjansma this will break CiviRules: `CRM_CivirulesPostTrigger_GroupContact::triggerTrigger()` relies on the old signature, which is how I found this.https://lab.civicrm.org/dev/core/-/issues/2584Proposal - Separation of Default Language for contacts from the default Language2023-08-05T05:03:23ZVangelisPProposal - Separation of Default Language for contacts from the default Language## Scenario
Right now, the preferred communication language for new contacts is bound to what the site's default language is in or to 'use language in use at the time' is in but as it seems, neither of them fits the scenario below:
A m...## Scenario
Right now, the preferred communication language for new contacts is bound to what the site's default language is in or to 'use language in use at the time' is in but as it seems, neither of them fits the scenario below:
A multinational organization in country A has 2 (or more) enabled languages in their Drupal configuration, thus into each user's profile. They want to have the preferred communication language for each of their contacts set to country A's language while the menus needs to be retained in English by force.
## How to replicate
1. On a Drupal 7 site, allow 2 languages, set the English as default
1. In CiviCRM > Administer > Localisation, set:
* the default language to the non-English
* Inherit CMS language to 'Yes'
* Available Languages: Add the 2 languages that you've added in Drupal
* Default Language for contacts: Any (I tried all options)
* Logout and login again
1. Try to create a new contact
## Possible solution
The suggestion is besides what already is in the selector, to add also a list of available languages to the field 'Default Language for contacts' so that we can enforce a language.
I've already worked on a patch that does the above, I'm not sure if my approach of this idea hides any potentials flaws.
Selector before:
![image](/uploads/f19b2c389213236f81e0df86a5335d33/image.png)
Selector after:
![image](/uploads/75e42b33fe04528f1e2b0d298b03ac30/image.png)
Example: Danish
![Screenshot_from_2021-05-03_09-58-12](/uploads/b12950fd7f96ee0604c839ee1bcbb61e/Screenshot_from_2021-05-03_09-58-12.png)
![Screenshot_from_2021-05-03_09-56-50](/uploads/96302b55f8779875e89b5b565cdd07d0/Screenshot_from_2021-05-03_09-56-50.png)
---
PR is [here - 20214](https://github.com/civicrm/civicrm-core/pull/20214)https://lab.civicrm.org/dev/core/-/issues/2583Backend Membership Renewal returns a fatal error when min fee is empty2021-05-03T10:39:04ZjitendraBackend Membership Renewal returns a fatal error when min fee is emptyTo replicate -
- Create Membership Type with no amount value.
- Create a membership on a contact.
- Renew from the Membership tab.
![image](/uploads/50793b0035f0dd0df1bbddbf361fad5c/image.png)
- Error message when the link is opened...To replicate -
- Create Membership Type with no amount value.
- Create a membership on a contact.
- Renew from the Membership tab.
![image](/uploads/50793b0035f0dd0df1bbddbf361fad5c/image.png)
- Error message when the link is opened in a new window -
![image](/uploads/772d973198c86a4d9a7439625b7fda43/image.png)jitendrajitendrahttps://lab.civicrm.org/dev/core/-/issues/3356Include confirm from email and name as organizer for event ics file, instead ...2022-10-03T19:42:29ZlarsssandergreenInclude confirm from email and name as organizer for event ics file, instead of event location emailCurrently, the ics file that is generated for an event (and included in email confirmations and on the confirmation page) uses the event location email as the organizer of the event, with no organizer if there is no event location email....Currently, the ics file that is generated for an event (and included in email confirmations and on the confirmation page) uses the event location email as the organizer of the event, with no organizer if there is no event location email. There is no organizer name.
I suggest using the online registration confirm from name and confirm from email for the ics file. If these aren't present, use event location email as before.
Event location email is a strange field that could be either the organizer of the event or the location of the event. Event location email is likely often not set, especially for online events. I think it makes more sense to use the online registration confirm name and email as these are where the email that contains the ics file are coming from. It's not ideal either way, but I think this is better. It's a clear improvement if there is no event location email, no change if there is no online event registration name and email, and I think often better if they both exist.
Will submit PR if supported.https://lab.civicrm.org/dev/wordpress/-/issues/99Support User Account properly for profiles2023-12-06T21:29:55ZJoeMurraySupport User Account properly for profilesCurrently, only Drupal properly implements the Used For options for Profiles. This issue chips away at the backlog for WordPress by proposing to properly support User Account.
1. Change the [x] option for User Account for all profiles s...Currently, only Drupal properly implements the Used For options for Profiles. This issue chips away at the backlog for WordPress by proposing to properly support User Account.
1. Change the [x] option for User Account for all profiles so that it is a checkbox widget.
1. If User Account is unchecked, do not change current behaviour of CiviCRM
1. If User Account is checked, expose the profile on wp-admin/user-edit.php?user_id=nnn and wp-admin/profile.php?user_id=nnn in an appropriate manner consistent with other plugin fields that are exposed. When Update Profile is clicked, validate the profile as appropriate for this form. Once the form is validated, save the field values as appropriate.
1. Create unit tests.JoeMurrayJoeMurrayhttps://lab.civicrm.org/dev/core/-/issues/2582system workflow template uses backend URL2021-05-03T07:11:08Zphilmorbrusystem workflow template uses backend URLOverview
----------------------------------------
The default Pledge Reminder system workflow template is configured to send out public-facing messages that include backend URLs. In Joomla this means the URL in the message is "domain.org...Overview
----------------------------------------
The default Pledge Reminder system workflow template is configured to send out public-facing messages that include backend URLs. In Joomla this means the URL in the message is "domain.org/administrator/" rather than "domain.org/index.php". See [SE question](https://civicrm.stackexchange.com/questions/39414/configure-urls-in-system-workflow-messages).
Reproduction steps
----------------------------------------
1. N/a
Current behaviour
----------------------------------------
Public users of the pledge system get reminders with links that don't work (go to administrator site, not public site).
Expected behaviour
----------------------------------------
Link should go to front end.
Environment information
----------------------------------------
* __CiviCRM:__ 5.33.2
* __CMS:__ Joomla 3.9.24 (unsure of other CMS)
Comments
----------------------------------------
Simple fix of adding param "fe=1" to the crmURL in the smarty code. Have not evaluated other templates which might have the same problem. Do not know if this is only Joomla, or if the fe=1 fix will cause any problems with other CMSs.5.38.0https://lab.civicrm.org/dev/core/-/issues/2581Cannot add case type in multilingual installation with MariaDB 10.2 strict mode2023-09-02T01:52:37ZhansrosselCannot add case type in multilingual installation with MariaDB 10.2 strict modeWhen adding a new case type via the UI at /en/civicrm/a/#/caseType/new in a multilingual site there is an error
```
"error_message": "DB Error: unknown error",
"mode": 16,
"debug_info": "INSERT INTO `civicrm_case_type_en_US` (`n...When adding a new case type via the UI at /en/civicrm/a/#/caseType/new in a multilingual site there is an error
```
"error_message": "DB Error: unknown error",
"mode": 16,
"debug_info": "INSERT INTO `civicrm_case_type_en_US` (`name` , `is_active` ) VALUES ('ExampleNew' , 1 ) [nativecode=1423 ** Field of view 'sitex.civicrm_case_type_en_US' underlying table doesn't have a default value]",
"type": "DB_Error",
"user_info": "INSERT INTO `civicrm_case_type_en_US` (`name` , `is_active` ) VALUES ('ExampleNew' , 1 ) [nativecode=1423 ** Field of view 'sitex.civicrm_case_type_en_US' underlying table doesn't have a default value]",
"to_string": "[db_error: message=\"DB Error: unknown error\" code=-1 mode=callback callback=CRM_Utils_REST::fatal prefix=\"\" info=\"INSERT INTO `civicrm_case_type_en_US` (`name` , `is_active` ) VALUES ('ExampleNew' , 1 ) [nativecode=1423 ** Field of view 'sitex.civicrm_case_type_en_US' underlying table doesn't have a default value]\"]",
```
Environment information
----------------------------------------
Drupal 7.80 / CiviCRM 5.36.1
MariaDB 10.2 with strict mode
Cause
----------------------------------------
MySQL having a strict mode set which won’t allow INSERT or UPDATE commands with empty fields where the schema doesn’t have a default value set.
Solution
----------------------------------------
I solved it with disabling strict mode by adding sql_mode=NO_ENGINE_SUBSTITUTION to /etc/my.cnf (and restarting mysql). Because the new Case Type was made from /en/civicrm/a/#/caseType/new I got first an empty label, but could after saving change the label to the desired case type human name.
I suppose there could also be a default value defined for these multilingual tables.5.66.0https://lab.civicrm.org/dev/core/-/issues/2580API4: Smart group parameters with booleans result in incorrect sql2023-08-03T05:03:25ZAndrew WestAPI4: Smart group parameters with booleans result in incorrect sqlOverview
----------------------------------------
API4 smart groups with a boolean parameter result in sql of "where field_name = 'true'" instead of 'where field_name = 1'.
Reproduction steps
----------------------------------------
1. ...Overview
----------------------------------------
API4 smart groups with a boolean parameter result in sql of "where field_name = 'true'" instead of 'where field_name = 1'.
Reproduction steps
----------------------------------------
1. Run [this API4 search](https://wpmaster.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fapi4#/explorer/RelationshipCache/get?where=%5B%5B%22is_active%22,%22%3D%22,%22true%22%5D%5D&limit=0&select=%5B%22far_contact_id%22%5D&groupBy=%5B%22far_contact_id%22%5D). Currently this returns about 123 contact IDs.
2. Remove the GroupBy and save the search as a smart group
3. Open the smart group. It only has 27 people in it.
If you log the sql from CRM_Contact_BAO_GroupContactCache::getApiSQL() you can see the SQL call uses 'true' rather than '1'.
This has unpredictable results! The query doesn't fail - it just returns...something. I've seen it return a subset of the correct results, and sometimes the exact inverse.
Environment information
----------------------------------------
Tested in latest master (5.38 alpha 1).
Comments
----------------------------------------
I _think_ this applies to all booleans. The above RelationshipCache was where we hit it, and tests on 'is_deleted' in the more-usual contact entity do the same thing.https://lab.civicrm.org/dev/core/-/issues/2579What is the purpose/meaning of `_single`, e.g. when used in core classes as `...2023-10-06T05:03:15ZDaveDWhat is the purpose/meaning of `_single`, e.g. when used in core classes as `if ($this->_single)`The purpose of this is to help clear something up that I'm not clear on. There's no specific proposal right now. And this is also a bit of a brain dump so may not even be discussable (is that word? - I seem to keep making up new words la...The purpose of this is to help clear something up that I'm not clear on. There's no specific proposal right now. And this is also a bit of a brain dump so may not even be discussable (is that word? - I seem to keep making up new words lately).
I'm thinking the meaning of `single` has gotten confused a bit over time - there appear to be two interpretations:
* There's only one id. Period. It doesn't mean anything else.
* We were viewing/doing something in the context of a single entity, like we we're viewing a contribution and now we're doing something related to it.
The first situation is confusing because why would it require a whole other variable and separate handling, but seems to be how it's being interpreted in some places.
The second is more like how "context" is used in various places (particularly context=search), so is also confusing because it seems to duplicate it, but seems to match the uses of it in the code in some places.
@eileenhttps://lab.civicrm.org/dev/core/-/issues/2578Angular $location interferes with the Drupal7 Overlay Module2023-08-05T05:03:24ZCésarAngular $location interferes with the Drupal7 Overlay ModuleHello, I have detected a strange behaviour that I cannot reproduce in dmaster. Maybe something is interfering, but I have detected that since **CiviCRM 5.33.0** the links of the Drupal 7 toolbar-menu with "Garland 7.78" do not work the s...Hello, I have detected a strange behaviour that I cannot reproduce in dmaster. Maybe something is interfering, but I have detected that since **CiviCRM 5.33.0** the links of the Drupal 7 toolbar-menu with "Garland 7.78" do not work the same in the dashboard as in other places of CiviCRM.
I attach an example:
![menu-dashboard-issue__1_](/uploads/85c5564a9efc29c90ef2788b1deea605/menu-dashboard-issue__1_.gif)
Reviewing the changes from version 5.33.0 onwards, I have seen that this part has changed: https://github.com/civicrm/civicrm-core/pull/18971 Maybe it's related, but I'm not sure.https://lab.civicrm.org/dev/core/-/issues/2577Changing Payment Method on a Transaction causes fatal error2021-05-02T21:47:08ZhaystackChanging Payment Method on a Transaction causes fatal errorOverview
----------------------------------------
Changing the Payment Method on a Transaction causes fatal error with the message: `"Mandatory key(s) missing from params array: contribution_id"`.
Reproduction steps
--------------------...Overview
----------------------------------------
Changing the Payment Method on a Transaction causes fatal error with the message: `"Mandatory key(s) missing from params array: contribution_id"`.
Reproduction steps
----------------------------------------
1. Go to Contribution Dashboard
1. Click the discovery triangle to reveal Transactions
1. Click the pencil icon to edit a Transaction
1. Change the Payment Method, e.g. from *Credit Card* to *Debit Card*
1. Click "Update"
1. Log shows "**Fatal error: Mandatory key(s) missing from params array: contribution_id"**".
Current behaviour
----------------------------------------
Changing the Payment Method on a Transaction cancels existing Payment but causes fatal error when trying to create a new replacement Payment.
Expected behaviour
----------------------------------------
Changing the Payment Method on a Transaction should replace (or update) the existing Payment.
Environment information
----------------------------------------
Replicated on Drupal Master.5.37.0https://lab.civicrm.org/dev/core/-/issues/2576Trigger on civicrm_activity causing performance problems2023-09-11T05:03:23ZErikHommelTrigger on civicrm_activity causing performance problemsWhile looking for the root cause of a performance issue for a client, I tracked it down to a couple of triggers performing an inefficient UPDATE statement:
civicrm_activity_before_update civicrm_activity_before_delete
Original SQL (~4 ...While looking for the root cause of a performance issue for a client, I tracked it down to a couple of triggers performing an inefficient UPDATE statement:
civicrm_activity_before_update civicrm_activity_before_delete
Original SQL (~4 seconds):
`UPDATE civicrm_case SET modified_date = CURRENT_TIMESTAMP WHERE id IN (SELECT ca.case_id FROM civicrm_case_activity ca WHERE ca.activity_id = OLD.id);`
~1000x faster SQL to do the same thing:
`UPDATE civicrm_case, civicrm_case_activity SET civicrm_case.modified_date = CURRENT_TIMESTAMP WHERE civicrm_case.id = civicrm_case_activity.case_id AND civicrm_case_activity.activity_id = OLD.id;`
I tracked this down to the following PHP file: sites/all/modules/civicrm/Civi/Core/Container.php
The patch to fix the SQL payload in the file:
`--- Container.php.orig 2021-04-12 11:30:35.039270421 +0100
+++ Container.php 2021-04-12 11:32:00.485650901 +0100
@@ -286,7 +286,7 @@
'table' => 'civicrm_activity',
'when' => 'BEFORE',
'event' => ['UPDATE', 'DELETE'],
- 'sql' => "\nUPDATE civicrm_case SET modified_date = CURRENT_TIMESTAMP WHERE id IN (SELECT ca.case_id FROM civicrm_case_activity ca WHERE ca.activity_id = OLD.id);\n",
+ 'sql' => "\nUPDATE civicrm_case, civicrm_case_activity SET civicrm_case.modified_date = CURRENT_TIMESTAMP WHERE civicrm_case.id = civicrm_case_activity.case_id AND civicrm_case_activity.activity_id = OLD.id;\n",
],
],
]
`
The bug doesn't manifest if you rewrite the UPDATE as a SELECT, but in the UPDATE form it takes an absurdly long time when a sub-select is used. Tested on MariaDB 10.4 and 10.5.
(SE issue [Performance bug in trigger](https://civicrm.stackexchange.com/questions/39303/performance-bug-in-trigger-causing-1000x-slowdown))https://lab.civicrm.org/dev/core/-/issues/2575Redundant indexes2022-05-16T23:19:04ZErikHommelRedundant indexesIssue reported by Gordan Bobic on SE: https://civicrm.stackexchange.com/questions/39409/redundant-indexes
It looks like there are several redundant or partly redundant indexes that civicrm creates on the database. Some of this may be st...Issue reported by Gordan Bobic on SE: https://civicrm.stackexchange.com/questions/39409/redundant-indexes
It looks like there are several redundant or partly redundant indexes that civicrm creates on the database. Some of this may be storage engine specific (e.g. InnoDB), but some isn't.
(see SE issue for more information)https://lab.civicrm.org/dev/core/-/issues/2574Grant report: Grant details not showing properly state/province and country2021-04-28T05:32:44ZVangelisPGrant report: Grant details not showing properly state/province and country## Issue
This issue is similar to the one reported [here - #220](https://lab.civicrm.org/dev/core/-/issues/220)
On the Detailed Grant report, the state/province shows the numeric values instead of the actual text labels.
## How to rep...## Issue
This issue is similar to the one reported [here - #220](https://lab.civicrm.org/dev/core/-/issues/220)
On the Detailed Grant report, the state/province shows the numeric values instead of the actual text labels.
## How to replicate
On https://dmaster.demo.civicrm.org create 1-2 grants. Then go to Grants - Grant Reports -> Allow state/province in the list of columns and render the report.
![image](/uploads/dea83dd0ab256d3fcea7b7d017b9ac14/image.png)
`Country` and `state/province` show numeric values instead.
## How to fix
Adding the following line:
`$entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, NULL, NULL) ? TRUE : $entryFound;`
before [here](https://lab.civicrm.org/dev/core/-/blob/master/CRM/Report/Form/Grant/Detail.php#L248) seems to be solving the issue (code replicated from issue #220)
Edit: PR is [here - 20169](https://github.com/civicrm/civicrm-core/pull/20169)5.38.0https://lab.civicrm.org/dev/core/-/issues/2573api4: CaseActivity requires "administer CiviCRM" permission2021-04-29T03:37:13ZDaveDapi4: CaseActivity requires "administer CiviCRM" permissionI think the easiest way to see this is:
1. Add a user that has view all contacts, edit all contacts, view all activities, "all" the case permissions, add contacts, access CiviCRM, etc just don't give it administer CiviCRM.
1. Create a c...I think the easiest way to see this is:
1. Add a user that has view all contacts, edit all contacts, view all activities, "all" the case permissions, add contacts, access CiviCRM, etc just don't give it administer CiviCRM.
1. Create a case, doesn't matter which user creates it.
1. Note the activity id of any of the activities on the case.
1. Replace 1234 in this command with the id:
* `cv ev --user=the_user "$r = \Civi\Api4\Activity::get(TRUE)->addSelect('id', 'case_activity.case_id')->setJoin([['CaseActivity AS case_activity', 'LEFT']])->addWhere('id', '=', 1234)->execute()->first(); var_dump($r);"`
1. Note the case id is not returned.
1. Now run the same thing but replace with --user=admin, where admin has administer CiviCRM.
1. The case id is returned.
It was suggested in chat that the class maybe needs a permission override somewhere.
A similar thing happens if I use a chain instead of join.
I don't think this strictly counts as a regression since CaseActivity was just added recently.5.37.0https://lab.civicrm.org/dev/core/-/issues/3204Add recurring contributions to contribution reports2022-09-16T21:11:08ZlarsssandergreenAdd 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.