Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-08-10T05:03:28Zhttps://lab.civicrm.org/dev/core/-/issues/2617Automatic defaults for TIMESTAMP columns can differ between databases or data...2023-08-10T05:03:28ZFrancis (Agileware)Automatic defaults for TIMESTAMP columns can differ between databases or database configurations.This mostly applies to a difference between MariaDB and MySQL, but a difference may also be seen in certain configurations of MySQL.
Essentially, currently MySQL will normally not apply any defaults to `TIMESTAMP` columns, but MariaDB, ...This mostly applies to a difference between MariaDB and MySQL, but a difference may also be seen in certain configurations of MySQL.
Essentially, currently MySQL will normally not apply any defaults to `TIMESTAMP` columns, but MariaDB, earlier (possibly unsupported) versions of MySQL, and some (deprecated) configurations of MySQL will set `DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP`
See:
- https://mariadb.com/kb/en/timestamp/#automatic-values
- https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html , specifically:
> TIMESTAMP and DATETIME columns have no automatic properties unless they are specified explicitly, with this exception: If the explicit_defaults_for_timestamp system variable is disabled, the first TIMESTAMP column has both DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP if neither is specified explicitly.
- https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp which details the variable which can make MySQL behave differently
This can result in some unexpected behaviour if someone creates an Entity definition with no default, and the resulting SQL is installed on a system with a different database e.g.:
- on the author's system with MySQL no default is set, and the value is not automatically updated when the entity is saved
- on an end-user's system with MariaDB, the default is set to CURRENT_TIMESTAMP, and the field is updated every time the entity is saved *without that field explicitly set*
No evidence of the changed default will be visible in the XML schema or the resulting SQL code.
A possible solution to this is to ensure a fallback default (probably NULL) is used during the GenCode phase to avoid inconsistency, as per @eileen's [suggestion on chat.civicrm.org](https://chat.civicrm.org/civicrm/pl/b1sokyxyqpdutbc88drrzyxmrc)https://lab.civicrm.org/dev/core/-/issues/2616Inherited Membership is updated by a non owner2023-08-08T05:03:21ZjitendraInherited Membership is updated by a non ownerOverview
----------------------------------------
Inherited Membership is updated by a non-owner.
Reproduction steps
----------------------------------------
1. Create an inherited General membership on a contact.
![image](/uploads/660...Overview
----------------------------------------
Inherited Membership is updated by a non-owner.
Reproduction steps
----------------------------------------
1. Create an inherited General membership on a contact.
![image](/uploads/6600a2906487dcda16baf87a443b656e/image.png)
2. Visit the Membership signup page and choose Student type (same org).
![image](/uploads/eea6f4019d33b888763485bd00915aaf/image.png)
3. Existing Inherited membership is updated to hold the Student Type. The primary membership is of type General.
![image](/uploads/831b8566d3aaa1346e09ce390d9ad799/image.png)
It's a different membership type and the user should not be allowed to 'renew' a membership given by a relationship?
Civi behaviour is like 'treat it as a renewal with a membership change' which is well and good for two 'same org' memberships for a person. But with an inherited one there needs to be a different set of rules? because inheritees should not be able to touch/change their inherited membership EXCEPT by adjusting the relationship. Only the membership owner should be able to update them?
If the above make sense, i think this if clause https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/BAO/Membership.php#L1799 need to include an additional check for
```
$inheritedMemTypeChange = FALSE;
if (!empty($currentMembership['owner_membership_id'] && $membershipTypeID != $currentMembership['membership_type_id'])) {
$inheritedMemTypeChange = TRUE;
}
if ($currentMembership && !$inheritedMemTypeChange) {
```https://lab.civicrm.org/dev/core/-/issues/2615Not inserting a ACL Role using ACL Role API2023-11-21T05:03:17Zmichaels23Not inserting a ACL Role using ACL Role APIOverview
----------------------------------------
I was trying to assigning a new Users to CiviCRM ACL role through ACL Role API, but it is not showing me in database.
Reproduced on https://demo.tadpole.cc/wp-admin/admin.php?page=CiviCR...Overview
----------------------------------------
I was trying to assigning a new Users to CiviCRM ACL role through ACL Role API, but it is not showing me in database.
Reproduced on https://demo.tadpole.cc/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fapi3#explorer
[link to that conversation](https://civicrm.stackexchange.com/questions/28088/not-inserting-a-acl-role-using-acl-role-api).
Reproduction steps
----------------------------------------
Input
` $result = civicrm_api3('AclRole', 'create', [
'debug' => 1,
'sequential' => 1,
'acl_role_id' => 14,
'entity_table' => "civicrm_group",
'entity_id' => 54,
'is_active' => 1,
]);`
Output
`"values": [
{
"id": "14",
"acl_role_id": "",
"entity_table": "civicrm_group",
"entity_id": "54",
"is_active": "1"
}
]`
I verified that "acl_role_id": 15 and civicrm_group 54 do exist.
Current behaviour
----------------------------------------
I don't see any new entries at https://demo.tadpole.cc/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Facl%2Fentityrole&reset=1
Expected behaviour
----------------------------------------
new entry at https://demo.tadpole.cc/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Facl%2Fentityrole&reset=1
Environment information
----------------------------------------
* __Browser:__ Google Chrome Version 90.0.4430.212 (Official Build) (64-bit)
* __CiviCRM:__ Powered by CiviCRM 5.37.2.
* __PHP:__ PHP version 7.3.27
* __CMS:__ _WordPress.Version 5.5.5
Comments
----------------------------------------https://lab.civicrm.org/dev/core/-/issues/2612CiviCRM 5.37.2 'CRM_Utils_ReCAPTCHA' not found2021-11-19T20:29:40ZbrianpCiviCRM 5.37.2 'CRM_Utils_ReCAPTCHA' not foundWe upgraded to 5.37.2 on Drupal 7 this morning and all the donation pages are now broken. I've cleared the cache and ensured the DB upgrade is complete. Per Issues #2596 I don't see a /ext/recaptcha in civicrm-core. Should that be there?...We upgraded to 5.37.2 on Drupal 7 this morning and all the donation pages are now broken. I've cleared the cache and ensured the DB upgrade is complete. Per Issues #2596 I don't see a /ext/recaptcha in civicrm-core. Should that be there?
Error: Class 'CRM_Utils_ReCAPTCHA' not found in CRM_Contribute_Form_ContributionBase->hasToAddForcefully() (line 845 of /code/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionBase.php).https://lab.civicrm.org/dev/core/-/issues/2611Change default_value column for custom fields from varchar to text2023-08-20T02:32:58ZlarsssandergreenChange default_value column for custom fields from varchar to textA custom field can be of many types, including note. For a custom field that is a note, you may want to use a default value that is longer than 255 characters, but currently the default value is stored as a varchar(255). It would make se...A custom field can be of many types, including note. For a custom field that is a note, you may want to use a default value that is longer than 255 characters, but currently the default value is stored as a varchar(255). It would make sense to change this column to text, so that longer values can be entered.
In the custom fields UI, this field would be changed to a textarea when note is selected.
For us, the use case would be storing the content of a short waiver, so that the exact value of the waiver at the time of signing can be stored on the participant for an event, but I can imagine there may be other use cases.
Will submit PR if supported.https://lab.civicrm.org/dev/core/-/issues/2610Bulk update on activities doesn't work incase checkbox custom field2023-08-12T05:03:23ZPradeep Nayakpradpnayak@gmail.comBulk update on activities doesn't work incase checkbox custom fieldReplicate:
1. Create a custom field against the activity of type checkbox
2. Create a profile and include the checkbox field created at step 1
3. Find Activities
4. Select activities to update and choose update multiple activities
5. Sel...Replicate:
1. Create a custom field against the activity of type checkbox
2. Create a profile and include the checkbox field created at step 1
3. Find Activities
4. Select activities to update and choose update multiple activities
5. Select the profile created from step 2
6. Click 'update activities' (make no changes)
Could replicate on https://dmaster.demo.civicrm.org/
Backtrace
```
$Fatal Error Details = array:3 [
"message" => "'' is not a valid option for field custom_52"
"code" => null
"exception" => CiviCRM_API3_Exception {#997
-extraParams: array:6 [
"error_field" => "custom_52"
"error_code" => 2001
"entity" => "Activity"
"action" => "create"
"is_error" => 1
"error_message" => "'' is not a valid option for field custom_52"
]
#message: "'' is not a valid option for field custom_52"
#code: 0
#file: "/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/api/api.php"
#line: 133
trace: {
/Users/pradeep/Sites/drupal7/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);
› }
}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/CRM/Activity/Form/Task/Batch.php:234 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/CRM/Core/Form.php:526 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/CRM/Core/StateMachine.php:144 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php:43 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/CRM/Core/Controller.php:347 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:313 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
/Users/pradeep/Sites/drupal7/sites/all/modules/civicrm/drupal/civicrm.module:458 { …}
/Users/pradeep/Sites/drupal7/includes/menu.inc:527 { …}
/Users/pradeep/Sites/drupal7/index.php:21 { …}
}
}
]
```
Quick Fix
```
diff --git a/CRM/Activity/Form/Task/Batch.php b/CRM/Activity/Form/Task/Batch.php
index cfbe6ff238..ef5b8a7c16 100644
--- a/CRM/Activity/Form/Task/Batch.php
+++ b/CRM/Activity/Form/Task/Batch.php
@@ -231,7 +231,7 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
$value['subject'] = $value['activity_subject'];
}
- $activityId = civicrm_api3('activity', 'create', $value);
+ $activityId = CRM_Activity_BAO_Activity::create($value)->id;
// @todo this would be done by the api call above if the parames were passed through.
// @todo extract submit functions &
@@ -240,7 +240,7 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
if (!empty($value['custom']) &&
is_array($value['custom'])
) {
- CRM_Core_BAO_CustomValueTable::store($value['custom'], 'civicrm_activity', $activityId['id']);
+ CRM_Core_BAO_CustomValueTable::store($value['custom'], 'civicrm_activity', $activityId);
}
}
CRM_Core_Session::setStatus("", ts("Updates Saved"), "success");
```https://lab.civicrm.org/dev/release/-/issues/17The version numbers for core-extensions should match core-proper.2021-05-17T19:27:11ZtottenThe version numbers for core-extensions should match core-proper.https://lab.civicrm.org/dev/core/-/issues/2609Move full text search to an extension?2023-08-11T05:03:16ZeileenMove full text search to an extension?We just hit an issue where someone crashed our db with the full text search. It feels like something that should be deliberately enabled rather than available by default....We just hit an issue where someone crashed our db with the full text search. It feels like something that should be deliberately enabled rather than available by default....https://lab.civicrm.org/dev/core/-/issues/2608Test - issue - fail when running just v32023-03-20T01:59:27ZeileenTest - issue - fail when running just v3I've been trying to get v3 api tests run as a directory locally - the tests run in isolation but not at the directory level (ie this command) - in order to try to figure out why https://github.com/civicrm/civicrm-core/pull/20243 passes i...I've been trying to get v3 api tests run as a directory locally - the tests run in isolation but not at the directory level (ie this command) - in order to try to figure out why https://github.com/civicrm/civicrm-core/pull/20243 passes in isolation but not as part of a suite.
I've found & fixed a few setup/teardown issues but am a bit stumped on the latest one. This ticket is to try to get help (from @totten ) on what to do about the below test where $_ENV seems to be undefined when running in conjunction with at least some other apiv3 tests
My command to run them is....
[docker-compose://[/home/eileen/dev/fundraising-dev/docker-compose.yml]:civicrm/]:php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=172.17.0.1 /srv/civi-sites/wmff/vendor/phpunit/phpunit/phpunit --configuration /srv/civi-sites/dmaster/web/sites/all/modules/civicrm/phpunit.xml.dist /srv/civi-sites/dmaster/web/sites/all/modules/civicrm/tests/phpunit/api/v3 --teamcity
```
Exception : CRM_Core_Exception: "ExternalBatch cannot detect environment: $_ENV is missing. (Tip: Set variables_order=EGPCS in php.ini.)"
#0 /srv/civi-sites/dmaster/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php(569): Civi\API\ExternalBatch->__construct((Array:2))
#1 /srv/civi-sites/dmaster/web/sites/all/modules/civicrm/tests/phpunit/api/v3/JobProcessMailingTest.php(460): CiviUnitTestCase->createExternalAPI()
#2 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/Framework/TestCase.php(1154): api_v3_JobProcessMailingTest->testConcurrency((Array:9), (Array:2), 4)
#3 /srv/civi-sites/dmaster/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php(228): PHPUnit\Framework\TestCase->runTest()
#4 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/Framework/TestCase.php(842): CiviUnitTestCase->runTest()
#5 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/Framework/TestResult.php(693): PHPUnit\Framework\TestCase->runBare()
#6 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/Framework/TestCase.php(796): PHPUnit\Framework\TestResult->run(Object(api_v3_JobProcessMailingTest))
#7 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/Framework/TestSuite.php(746): PHPUnit\Framework\TestCase->run(Object(PHPUnit\Framework\TestResult))
#8 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/Framework/TestSuite.php(746): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#9 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/Framework/TestSuite.php(746): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#10 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(652): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#11 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/TextUI/Command.php(206): PHPUnit\TextUI\TestRunner->doRun(Object(PHPUnit\Framework\TestSuite), (Array:64), TRUE)
#12 /srv/civi-sites/wmff/vendor/phpunit/phpunit/src/TextUI/Command.php(162): PHPUnit\TextUI\Command->run((Array:5), TRUE)
#13 /srv/civi-sites/wmff/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#14 {main}
/srv/civi-sites/dmaster/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:232
/srv/civi-sites/wmff/vendor/phpunit/phpunit/phpunit:61
```https://lab.civicrm.org/dev/core/-/issues/2607How to handle removed files2023-12-15T15:29:01Zaydunsaidan.saunders@squiffle.ukHow to handle removed filesSee [this SE question](https://civicrm.stackexchange.com/questions/39531/database-upgrade-script-failing-call-to-undefined-method-crm-upgrade-incrementa/39546#39546)
A file was removed from the installation tarball but [the Joomla upgr...See [this SE question](https://civicrm.stackexchange.com/questions/39531/database-upgrade-script-failing-call-to-undefined-method-crm-upgrade-incrementa/39546#39546)
A file was removed from the installation tarball but [the Joomla upgrade process](https://docs.civicrm.org/sysadmin/en/latest/upgrade/joomla/#install-the-extension) installs into existing directories meaning the 'removed' file was still present. In this case, it caused the upgrade to fail and will cause problems for any Joomla upgrades following the documented method.
More generally, the same problem applies to any files no longer included in releases.
Some possibilities:
- in the release notes say that files have been removed so don't follow the normal upgrade process
- add an upgrade step that removes old files (but note this problem occurred early in the upgrade process)
- change the upgrade instructions for Joomlahttps://lab.civicrm.org/dev/joomla/-/issues/32Resource URL for images is really "media"?2021-05-25T11:07:57Zthoni56Resource URL for images is really "media"?CiviCRM 5.36.1 on Joomla 3.9.26
In Administer->Resource URL:s there is a setting that is named "Image Upload URL", but I'm suspecting that it is actually the base path for [civicrm.files] to which settings on Administer->Directories are...CiviCRM 5.36.1 on Joomla 3.9.26
In Administer->Resource URL:s there is a setting that is named "Image Upload URL", but I'm suspecting that it is actually the base path for [civicrm.files] to which settings on Administer->Directories are added ("images", "files", "custom_ext", etc.)?
With the label and help text you are led to believe that
1. It is only for images
2. It is only for upload
This has made us set it to `/media/civicrm/images` (on Joomla) and we are now uploading images to `media/civicrm/images/images` uploading files to `/media/civicrm/images/files` etc.
If my interpretation is correct, I'd suggest that the label, lead and help texts for the field should be updated to not include "images" but say "media", and even "[civicrm.files]" instead.
If not, then the duplicated "images" in image directory is the problem I could get around setting the resource-URL for upload of images to just `/media/civicrm`. But that trashed the CiviCRM menus.
I feel there is an inconsistency here.https://lab.civicrm.org/dev/core/-/issues/2600Multilingual mode prevents adding new price sets2021-05-08T18:08:06ZlarsssandergreenMultilingual mode prevents adding new price setsIf you enable multilingual mode, additional columns are added to the civicrm_price_set table and other columns are re-named (e.g. title_lang_LOCALE and title_lang_LOCALE). This is not respected by the code that creates new price sets, wh...If you enable multilingual mode, additional columns are added to the civicrm_price_set table and other columns are re-named (e.g. title_lang_LOCALE and title_lang_LOCALE). This is not respected by the code that creates new price sets, which does not add values for those columns. The code also attempts to add a row to table `civicrm_price_set_lang_LOCALE`, which does not exist (it is civicrm_price_set with some columns changed).
Not sure how any of this works, so not going to try to fix it myself, so just reporting here. 5.38.alpha1
EDIT: Can't duplicate on dmaster, closing.https://lab.civicrm.org/dev/core/-/issues/2599"Forward Mailing" feature results in Smarty error2023-08-12T05:03:22Zedgimar"Forward Mailing" feature results in Smarty errorI just noticed on Civi 5.36.1 + WordPress 5.7.1 that the "Forward Mailing" feature does not work correctly: after I click on the 'forward' link in a received mailing, it takes me to the civi page where I can enter in email addresses to ...I just noticed on Civi 5.36.1 + WordPress 5.7.1 that the "Forward Mailing" feature does not work correctly: after I click on the 'forward' link in a received mailing, it takes me to the civi page where I can enter in email addresses to forward the mailing to. After entering an email address, I press the "Forward" button, I just get a WP page that says `There has been a critical error on this website.`
The webserver error logs contain the following (slightly redacted) associated entries:
```
[Thu May 06 18:31:42.466433 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: PHP Fatal error: Smarty error: [in string:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466519 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: <html xmlns="http://www.w3.org/1999/xhtml"><head>, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466553 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466576 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: <meta name="viewport" content="initial-scale=1.0">, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466597 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: <meta name="format-detection" content="telephone=no">, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466613 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: <title>[subject]</title>, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466628 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: , referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466643 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: <style type="text/css">, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466657 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: body{ Margin: 0; padding: 0; }, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466672 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: img{ border: 0px; display: block; }, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466687 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: .socialLinks{ font-size: 6px; }, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466709 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: .socialLinks a{, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466723 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: display: inline-block;, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466738 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: }, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466770 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: .socialIcon{, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466785 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: display: inline-block;, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466800 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: vertical-align: top;, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466814 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: padding-bottom: 0px;, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466829 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: border-radius: 100%;, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466843 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: }, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466857 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: .oldwebkit{ max-width: 570px; }, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466908 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: td.vb-outer{ padding-left: 9px; padding-right: 9px; }, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
[Thu May 06 18:31:42.466923 2021] [fcgid:warn] [pid 19485:tid 4146279196416] [client x.x.x.x:39364] mod_fcgid: stderr: table.vb-container, table.vb-row, table. in /home/data2/mywebsite.com/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1100, referer: https://mywebsite.com/civicrm/mailing/forward/?reset=1&jid=111&qid=2117&h=a267e50acef0d4e4
```https://lab.civicrm.org/dev/core/-/issues/2598Error emailing with attachments2021-05-07T13:02:48Zwil_SRQError emailing with attachmentsOverview
----------------------------------------
Sending an email with two attachments to multiple recipients fails
Reproduction steps
----------------------------------------
1. From any search result select 6 Individuals with mailabl...Overview
----------------------------------------
Sending an email with two attachments to multiple recipients fails
Reproduction steps
----------------------------------------
1. From any search result select 6 Individuals with mailable email addresses
2. Email now (50 or less)
3. Short HTML body, minor formatting (probably irrelevant)
4. Attach two **short** .doc files (the type is likely irrelevant, but I tested with various .doc)
4. Send
Current behaviour
----------------------------------------
![Screenshot_2021-05-06_203153](/uploads/9ffcfa12bb48bb8df4017364e62b22a0/Screenshot_2021-05-06_203153.png)
Expected behaviour
----------------------------------------
Emails sent and activities created.
Environment
----------------------------------------
As you can see in the screen snippet, I duplicated it in dmaster a few minutes ago. One of my users pointed me to this in 5.36.1/Drupal 7.80.
Comments
----------------------------------------
This is low priority. Sending attachments from Civi is not a best practice and my users have heard that. Documenting it in case it intersects with other more serious problems. And I guess to satisfy my OCD.https://lab.civicrm.org/dev/core/-/issues/2597Tabset for manage contribution pages or manage events requires Classname to e...2023-08-07T15:13:57ZlarsssandergreenTabset for manage contribution pages or manage events requires Classname to equal pathIf you add a tab to a tabset for Configure Event, it will work fine with the last word of the class name different from the last word of the path, except for trying to save, which will save, but redirect to Manage Events instead of stayi...If you add a tab to a tabset for Configure Event, it will work fine with the last word of the class name different from the last word of the path, except for trying to save, which will save, but redirect to Manage Events instead of staying on the same tab. This is because [code here](https://github.com/civicrm/civicrm-core/blob/5db0bc3c1f54eaca4307f103a73bda596ae914d6/CRM/Event/Form/ManageEvent.php#L377) expects lastWord from CRM_myExtension_Form_lastWord to be the same as the path, i.e. /civicrm/event/manage/lastword. Everything else works as expected if these are different, except Save.
Looks like this same issue exists for [Contribution Pages](https://github.com/civicrm/civicrm-core/blob/5db0bc3c1f54eaca4307f103a73bda596ae914d6/CRM/Contribute/Form/ContributionPage.php#L427
) and probably elsewhere.
For now, I've added a warning to the docs for [the tabset hook](https://lab.civicrm.org/documentation/docs/dev/-/merge_requests/908). It would be good to fix this so the code linked above uses the path for the url instead of the class, at some point.https://lab.civicrm.org/dev/core/-/issues/2596Donation page error in CiviCRM 5.372021-05-13T16:06:10Zmarvs5Donation page error in CiviCRM 5.37Overview
----------------------------------------
I developed a site in Drupal 8 and CiviCRM 5.36.1 earlier this week. This morning I updated to Civi 5.37. I now get an error when trying to use the public donation page: The website enc...Overview
----------------------------------------
I developed a site in Drupal 8 and CiviCRM 5.36.1 earlier this week. This morning I updated to Civi 5.37. I now get an error when trying to use the public donation page: The website encountered an unexpected error. Please try again later. See error log below.
It was working fine prior to the update.
Reproduction steps
----------------------------------------
Click on the donation link.
Current behaviour
----------------------------------------
The error in the nginx log (website name and directory changed):
`2021/05/06 09:08:12 [error] 1423550#1423550: *4606 FastCGI sent in stderr: "PHP message: Error: Class 'CRM_Utils_ReCAPTCHA' not found in /example/web/vendor/civicrm/civicrm-core/CRM/Contribute/Form/ContributionBase.php on line 845 #0 /example/web/vendor/civicrm/civicrm-core/CRM/Contribute/Form/Contribution/Main.php(293): CRM_Contribute_Form_ContributionBase->hasToAddForcefully()
#1 /example/web/vendor/civicrm/civicrm-core/CRM/Core/Form.php(642): CRM_Contribute_Form_Contribution_Main->buildQuickForm()
#2 /example/web/vendor/civicrm/civicrm-core/CRM/Core/QuickForm/Action/Display.php(76): CRM_Core_Form->buildForm()
#3 /example/web/vendor/civicrm/civicrm-packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform()
#4 /example/web/vendor/civicrm/civicrm-packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle()
#5 /example/web/vendor/civicrm/civicrm-core/CRM/Core/Controller.php(347): HTML_QuickForm_Pag" while reading response header from upstream, client: 173.72.20.196, server: www.example.com, request: "GET /civicrm/contribute/transact?reset=1&id=1 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "www.example.com", referrer: "https://www.example.com/"`
Expected behaviour
----------------------------------------
The contribution page should display and collect money from visitors.
Environment information
----------------------------------------
* __CiviCRM:__ 5.37
* __PHP:__ 7.4.3
* __CMS:__ Drupal 8.9.15
* __Database:__ 5.5.5-10.5.9-MariaDB-1:10.5.9+maria~focal
* __Web Server:__ Nginx 1.18.0
Comments
----------------------------------------
None.https://lab.civicrm.org/dev/core/-/issues/2595Change Log Tab Excrutiatingly Slow - Poorly Performing Query and Fix (from 8 ...2023-08-14T13:09:44ZgordanChange Log Tab Excrutiatingly Slow - Poorly Performing Query and Fix (from 8 minutes down to 4 seconds)The page takes about 8 minutes to return which is absurdly slow for anything expected to be remotely interactive. It is so slow that my client is referring to it as the "Triangle of Doom".
I tracked it down to this query:
```
INSERT IG...The page takes about 8 minutes to return which is absurdly slow for anything expected to be remotely interactive. It is so slow that my client is referring to it as the "Triangle of Doom".
I tracked it down to this query:
```
INSERT IGNORE INTO civicrm_tmp_e_logsummary_ffa3ac146126d178ade367f2a5d17bf5
SELECT activity_id, IF (entity_log_civireport.log_action = 'Insert' AND extra_table.activity_type_id = 51 , GROUP_CONCAT(entity_log_civireport.contact_id), 1) , entity_log_civireport.log_action as log_civicrm_entity_log_action, 'log_civicrm_activity_contact' as log_civicrm_entity_log_type, entity_log_civireport.log_user_id as log_civicrm_entity_log_user_id, entity_log_civireport.log_date as log_civicrm_entity_log_date, modified_contact_civireport.display_name as log_civicrm_entity_altered_contact, modified_contact_civireport.id as log_civicrm_entity_altered_contact_id, entity_log_civireport.log_conn_id as log_civicrm_entity_log_conn_id, modified_contact_civireport.is_deleted as log_civicrm_entity_is_deleted, altered_by_contact_civireport.display_name as altered_by_contact_display_name
FROM staging_civicrm.log_civicrm_activity_contact entity_log_civireport
JOIN civicrm_contact modified_contact_civireport ON (entity_log_civireport.contact_id = modified_contact_civireport.id )
JOIN staging_civicrm.log_civicrm_activity extra_table ON extra_table.id = entity_log_civireport.activity_id
LEFT JOIN civicrm_contact altered_by_contact_civireport ON (entity_log_civireport.log_user_id = altered_by_contact_civireport.id)
WHERE modified_contact_civireport.id = 338520 AND
entity_log_civireport.log_action != 'Initialization'
GROUP BY entity_log_civireport.log_conn_id,
entity_log_civireport.log_user_id,
EXTRACT(DAY_MICROSECOND FROM entity_log_civireport.log_date),
entity_log_civireport.id
ORDER BY entity_log_civireport.log_date DESC;
EXPLAIN shows:
```
```
+------+-------------+-------------------------------+--------+---------------+---------+---------+---------------------------------------------------+---------+-------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------------------------------+--------+---------------+---------+---------+---------------------------------------------------+---------+-------------------------------------------------+
| 1 | SIMPLE | modified_contact_civireport | const | PRIMARY | PRIMARY | 4 | const | 1 | Using temporary; Using filesort |
| 1 | SIMPLE | extra_table | ALL | NULL | NULL | NULL | NULL | 3014020 | |
| 1 | SIMPLE | entity_log_civireport | ALL | NULL | NULL | NULL | NULL | 5518537 | Using where; Using join buffer (flat, BNL join) |
| 1 | SIMPLE | altered_by_contact_civireport | eq_ref | PRIMARY | PRIMARY | 4 | staging_civicrm.entity_log_civireport.log_user_id | 1 | Using where |
+------+-------------+-------------------------------+--------+---------------+---------+---------+---------------------------------------------------+---------+-------------------------------------------------+
```
The fix passes:
First pass:
```
ALTER TABLE log_civicrm_activity_contact ADD INDEX index_activity_id (activity_id);
```
With no further changes, this alone makes the above query go from 8 minutes to 1m45s.
Explain plain:
```
+------+-------------+-------------------------------+--------+-------------------+-------------------+---------+---------------------------------------------------+---------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------------------------------+--------+-------------------+-------------------+---------+---------------------------------------------------+---------+---------------------------------+
| 1 | SIMPLE | modified_contact_civireport | const | PRIMARY | PRIMARY | 4 | const | 1 | Using temporary; Using filesort |
| 1 | SIMPLE | extra_table | ALL | NULL | NULL | NULL | NULL | 3014020 | Using where |
| 1 | SIMPLE | entity_log_civireport | ref | index_activity_id | index_activity_id | 5 | staging_civicrm.extra_table.id | 1 | Using where |
| 1 | SIMPLE | altered_by_contact_civireport | eq_ref | PRIMARY | PRIMARY | 4 | staging_civicrm.entity_log_civireport.log_user_id | 1 | Using where |
+------+-------------+-------------------------------+--------+-------------------+-------------------+---------+---------------------------------------------------+---------+---------------------------------+
```
Second pass:
```
ALTER TABLE log_civicrm_activity ADD INDEX index_id (id);
```
Change the JOIN order explicitly and add a hint for the query optimizer to not re-order the JOINs:
```
SELECT STRAIGHT_JOIN activity_id, IF (entity_log_civireport.log_action = 'Insert' AND extra_table.activity_type_id = 51 , GROUP_CONCAT(entity_log_civireport.contact_id), 1) , entity_log_civireport.log_action as log_civicrm_entity_log_action, 'log_civicrm_activity_contact' as log_civicrm_entity_log_type, entity_log_civireport.log_user_id as log_civicrm_entity_log_user_id, entity_log_civireport.log_date as log_civicrm_entity_log_date, modified_contact_civireport.display_name as log_civicrm_entity_altered_contact, modified_contact_civireport.id as log_civicrm_entity_altered_contact_id, entity_log_civireport.log_conn_id as log_civicrm_entity_log_conn_id, modified_contact_civireport.is_deleted as log_civicrm_entity_is_deleted, altered_by_contact_civireport.display_name as altered_by_contact_display_name
FROM civicrm_contact modified_contact_civireport
JOIN staging_civicrm.log_civicrm_activity_contact entity_log_civireport ON entity_log_civireport.contact_id = modified_contact_civireport.id
JOIN staging_civicrm.log_civicrm_activity extra_table ON extra_table.id = entity_log_civireport.activity_id
LEFT JOIN civicrm_contact altered_by_contact_civireport ON entity_log_civireport.log_user_id = altered_by_contact_civireport.id
WHERE modified_contact_civireport.id = 338520 AND
entity_log_civireport.log_action != 'Initialization'
GROUP BY entity_log_civireport.log_conn_id,
entity_log_civireport.log_user_id,
EXTRACT(DAY_MICROSECOND FROM entity_log_civireport.log_date),
entity_log_civireport.id
ORDER BY entity_log_civireport.log_date DESC;
```
New EXPLAIN:
```
+------+-------------+-------------------------------+--------+-------------------+----------+---------+---------------------------------------------------+---------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------------------------------+--------+-------------------+----------+---------+---------------------------------------------------+---------+---------------------------------+
| 1 | SIMPLE | modified_contact_civireport | const | PRIMARY | PRIMARY | 4 | const | 1 | Using temporary; Using filesort |
| 1 | SIMPLE | entity_log_civireport | ALL | index_activity_id | NULL | NULL | NULL | 5518537 | Using where; Using filesort |
| 1 | SIMPLE | extra_table | ref | index_id | index_id | 5 | staging_civicrm.entity_log_civireport.activity_id | 1 | |
| 1 | SIMPLE | altered_by_contact_civireport | eq_ref | PRIMARY | PRIMARY | 4 | staging_civicrm.entity_log_civireport.log_user_id | 1 | Using where |
+------+-------------+-------------------------------+--------+-------------------+----------+---------+---------------------------------------------------+---------+---------------------------------+
```
This gets it down to 4 seconds!
Since the first index we started with is no longer getting used in the final variant, we can just not add it.
Summary:
To fix "Change Log" tab taking forever to load, the following fix is needed:
Add index:
```
ALTER TABLE log_civicrm_activity ADD INDEX index_id (id);
```
Make the code emit the query modified as follows:
```
INSERT IGNORE INTO civicrm_tmp_e_logsummary_ffa3ac146126d178ade367f2a5d17bf5
SELECT STRAIGHT_JOIN activity_id, IF (entity_log_civireport.log_action = 'Insert' AND extra_table.activity_type_id = 51 , GROUP_CONCAT(entity_log_civireport.contact_id), 1) , entity_log_civireport.log_action as log_civicrm_entity_log_action, 'log_civicrm_activity_contact' as log_civicrm_entity_log_type, entity_log_civireport.log_user_id as log_civicrm_entity_log_user_id, entity_log_civireport.log_date as log_civicrm_entity_log_date, modified_contact_civireport.display_name as log_civicrm_entity_altered_contact, modified_contact_civireport.id as log_civicrm_entity_altered_contact_id, entity_log_civireport.log_conn_id as log_civicrm_entity_log_conn_id, modified_contact_civireport.is_deleted as log_civicrm_entity_is_deleted, altered_by_contact_civireport.display_name as altered_by_contact_display_name
FROM civicrm_contact modified_contact_civireport
JOIN staging_civicrm.log_civicrm_activity_contact entity_log_civireport ON entity_log_civireport.contact_id = modified_contact_civireport.id
JOIN staging_civicrm.log_civicrm_activity extra_table ON extra_table.id = entity_log_civireport.activity_id
LEFT JOIN civicrm_contact altered_by_contact_civireport ON entity_log_civireport.log_user_id = altered_by_contact_civireport.id
WHERE modified_contact_civireport.id = 338520 AND
entity_log_civireport.log_action != 'Initialization'
GROUP BY entity_log_civireport.log_conn_id,
entity_log_civireport.log_user_id,
EXTRACT(DAY_MICROSECOND FROM entity_log_civireport.log_date),
entity_log_civireport.id
ORDER BY entity_log_civireport.log_date DESC;
```
Not only does this speed it up from 8 minutes down to 4 seconds, it also doesn't wreak havoc with row locking where every row scanned gets locked by the transaction engine, potentially resulting in a massive query pile-up in the database.https://lab.civicrm.org/dev/core/-/issues/2594Contribution Recur reference in membership not updated in merging2024-03-14T05:03:20ZseamusleeContribution Recur reference in membership not updated in mergingWhen 2 contacts are merged and memberships are merged together, if the duplicate membership has a recurring contribution linked to it but the original didn't or visa versa (say someone renewed and opted in for a recurring membership). Th...When 2 contacts are merged and memberships are merged together, if the duplicate membership has a recurring contribution linked to it but the original didn't or visa versa (say someone renewed and opted in for a recurring membership). There is at present no handling in https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/BAO/Membership.php#L2599 or https://github.com/civicrm/civicrm-core/blob/master/CRM/Dedupe/Merger.php#L385 https://github.com/civicrm/civicrm-core/blob/master/CRM/Dedupe/Merger.php#L427 which would cause the contribution recur information to be migrated across to the kept membership
cc @JoeMurrayhttps://lab.civicrm.org/dev/core/-/issues/2592Afform: Replace Actions on Join not available for anon users2021-05-18T15:46:03ZseamusleeAfform: Replace Actions on Join not available for anon usersWhilst testing the work on Entity Reference fields in PR https://github.com/civicrm/civicrm-core/pull/20216 I found that when I constructed a form with the attached JSON and the attached markup I would get these errors if I filled in eit...Whilst testing the work on Entity Reference fields in PR https://github.com/civicrm/civicrm-core/pull/20216 I found that when I constructed a form with the attached JSON and the attached markup I would get these errors if I filled in either the Email field or the Website field for the relevant parts
```
Array
(
[error_id] => ihJT-pVbh-Papi
[exception] => Civi\API\Exception\UnauthorizedException: "Cannot process APIv4 request for Individual1 (Email.replace): Action is not approved"
#0 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/ext/afform/core/Civi/Api4/Action/Afform/Submit.php(89): Civi\Afform\FormDataModel->Civi\Afform\{closure}("Email", "replace", (Array:3))
#1 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/ext/afform/core/Civi/Api4/Action/Afform/Submit.php(57): Civi\Api4\Action\Afform\Submit::saveJoins(Object(Closure), "Contact", "207", (Array:1))
#2 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(214): Civi\Api4\Action\Afform\Submit::processContacts(Object(Civi\Afform\Event\AfformSubmitEvent), "civi.afform.submit", Object(Civi\Core\CiviEventDispatcher))
#3 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:2), "civi.afform.submit", Object(Civi\Afform\Event\AfformSubmitEvent))
#4 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(129): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("civi.afform.submit", Object(Civi\Afform\Event\AfformSubmitEvent))
#5 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/ext/afform/core/Civi/Api4/Action/Afform/Submit.php(36): Civi\Core\CiviEventDispatcher->dispatch("civi.afform.submit", Object(Civi\Afform\Event\AfformSubmitEvent))
#6 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/ext/afform/core/Civi/Api4/Action/Afform/AbstractProcessor.php(44): Civi\Api4\Action\Afform\Submit->processForm()
#7 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(68): Civi\Api4\Action\Afform\AbstractProcessor->_run(Object(Civi\Api4\Generic\Result))
#8 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/Civi/API/Kernel.php(149): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Action\Afform\Submit))
#9 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php(239): Civi\API\Kernel->runRequest(Object(Civi\Api4\Action\Afform\Submit))
#10 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/api/api.php(85): Civi\Api4\Generic\AbstractAction->execute()
#11 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Api4/Page/AJAX.php(139): civicrm_api4("Afform", "submit", (Array:4), NULL)
#12 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Api4/Page/AJAX.php(80): CRM_Api4_Page_AJAX->execute("Afform", "submit", (Array:4), NULL)
#13 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(313): CRM_Api4_Page_AJAX->run((Array:5), NULL)
#14 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:12))
#15 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:5))
#16 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/drupal/civicrm.module(458): CRM_Core_Invoke::invoke((Array:5))
#17 /home/seamus/buildkit/build/47-test/web/includes/menu.inc(527): civicrm_invoke("ajax", "api4", "Afform", "submit")
#18 /home/seamus/buildkit/build/47-test/web/index.php(21): menu_execute_active_handler()
#19 {main}
)
May 06 17:31:21 [debug] AJAX Error ({error_id}): failed with exception
Array
(
[error_id] => g6Pr-4qZq-aCoC
[exception] => Civi\API\Exception\UnauthorizedException: "Cannot process APIv4 request for Organization1 (Website.replace): Action is not approved"
#0 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/ext/afform/core/Civi/Api4/Action/Afform/Submit.php(89): Civi\Afform\FormDataModel->Civi\Afform\{closure}("Website", "replace", (Array:3))
#1 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/ext/afform/core/Civi/Api4/Action/Afform/Submit.php(57): Civi\Api4\Action\Afform\Submit::saveJoins(Object(Closure), "Contact", "209", (Array:1))
#2 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(214): Civi\Api4\Action\Afform\Submit::processContacts(Object(Civi\Afform\Event\AfformSubmitEvent), "civi.afform.submit", Object(Civi\Core\CiviEventDispatcher))
#3 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:2), "civi.afform.submit", Object(Civi\Afform\Event\AfformSubmitEvent))
#4 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(129): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("civi.afform.submit", Object(Civi\Afform\Event\AfformSubmitEvent))
#5 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/ext/afform/core/Civi/Api4/Action/Afform/Submit.php(36): Civi\Core\CiviEventDispatcher->dispatch("civi.afform.submit", Object(Civi\Afform\Event\AfformSubmitEvent))
#6 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/ext/afform/core/Civi/Api4/Action/Afform/AbstractProcessor.php(44): Civi\Api4\Action\Afform\Submit->processForm()
#7 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(68): Civi\Api4\Action\Afform\AbstractProcessor->_run(Object(Civi\Api4\Generic\Result))
#8 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/Civi/API/Kernel.php(149): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Action\Afform\Submit))
#9 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php(239): Civi\API\Kernel->runRequest(Object(Civi\Api4\Action\Afform\Submit))
#10 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/api/api.php(85): Civi\Api4\Generic\AbstractAction->execute()
#11 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Api4/Page/AJAX.php(139): civicrm_api4("Afform", "submit", (Array:4), NULL)
#12 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Api4/Page/AJAX.php(80): CRM_Api4_Page_AJAX->execute("Afform", "submit", (Array:4), NULL)
#13 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(313): CRM_Api4_Page_AJAX->run((Array:5), NULL)
#14 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:12))
#15 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:5))
#16 /home/seamus/buildkit/build/47-test/web/sites/all/modules/civicrm/drupal/civicrm.module(458): CRM_Core_Invoke::invoke((Array:5))
#17 /home/seamus/buildkit/build/47-test/web/includes/menu.inc(527): civicrm_invoke("ajax", "api4", "Afform", "submit")
#18 /home/seamus/buildkit/build/47-test/web/index.php(21): menu_execute_active_handler()
#19 {main}
```
thoughts @colemanw @totten
[afformRegisterASite.aff.html](/uploads/da267f8d0ec569d9081f211eeb86c6ae/afformRegisterASite.aff.html)
[afformRegisterASite.aff.json](/uploads/de9c7e89d13e2d2216256e2a63a145fd/afformRegisterASite.aff.json)colemanwcolemanwhttps://lab.civicrm.org/dev/core/-/issues/2591Can't sort case2021-05-06T22:07:11ZDevAppCan't sort caseSteps to replicate:
Find case, click search.
With the results, click the "most recent" column to sort by this field.
SQL error is produced and sort fails.
Same occurs for next scheduled activity.
Have tested in several copies of CivIC...Steps to replicate:
Find case, click search.
With the results, click the "most recent" column to sort by this field.
SQL error is produced and sort fails.
Same occurs for next scheduled activity.
Have tested in several copies of CivICRM 5.36.1 and happens in all of them.
```
SELECT civicrm_case.id , contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, contact_a.display_name as `display_name`, civicrm_phone.id as phone_id, civicrm_phone.phone_type_id as phone_type_id, civicrm_phone.phone as `phone`, civicrm_case.id as case_id, civicrm_case_type.title as case_type, case_status.label as case_status, civicrm_case.is_deleted as case_deleted, IF(case_relationship.contact_id_b = contact_a.id, case_relation_type.label_b_a, case_relation_type.label_a_b) as case_role, case_activity.activity_date_time as case_activity_date_time, case_activity.subject as case_activity_subject, civicrm_case.subject as case_subject, rec_activity_type.label as case_activity_type FROM civicrm_contact contact_a LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id INNER JOIN civicrm_case ON civicrm_case_contact.case_id = civicrm_case.id LEFT JOIN civicrm_relationship case_relationship ON ( case_relationship.contact_id_a = civicrm_case_contact.contact_id AND case_relationship.contact_id_b = 102 AND case_relationship.case_id = civicrm_case.id OR case_relationship.contact_id_b = civicrm_case_contact.contact_id AND case_relationship.contact_id_a = 102 AND case_relationship.case_id = civicrm_case.id ) LEFT JOIN civicrm_relationship_type case_relation_type ON ( case_relation_type.id = case_relationship.relationship_type_id AND\n
case_relation_type.id = case_relationship.relationship_type_id ) INNER JOIN civicrm_case_activity ON civicrm_case_activity.case_id = civicrm_case.id INNER JOIN civicrm_activity case_activity ON ( civicrm_case_activity.activity_id = case_activity.id
AND case_activity.is_current_revision = 1 ) LEFT JOIN civicrm_option_group option_group_activity_type ON (option_group_activity_type.name = 'activity_type') LEFT JOIN civicrm_option_value rec_activity_type ON (case_activity.activity_type_id = rec_activity_type.value AND option_group_activity_type.id = rec_activity_type.option_group_id ) LEFT JOIN civicrm_option_group option_group_case_status ON (option_group_case_status.name = 'case_status') LEFT JOIN civicrm_option_value case_status ON (civicrm_case.status_id = case_status.value AND option_group_case_status.id = case_status.option_group_id ) LEFT JOIN civicrm_case_type ON civicrm_case.case_type_id = civicrm_case_type.id WHERE ( civicrm_case.is_deleted = 0 ) AND ( 1 ) AND (contact_a.is_deleted = 0) GROUP BY civicrm_case.id ORDER BY `case_recent_activity_date` asc, `contact_a`.`id` LIMIT 0, 50 [nativecode=1054 ** Unknown column 'case_recent_activity_date' in 'order clause']
```