CiviCRM Core issueshttps://lab.civicrm.org/dev/core/-/issues2023-06-15T15:29:14Zhttps://lab.civicrm.org/dev/core/-/issues/4363CiviMail Trackable URL Click Through Broken2023-06-15T15:29:14ZMichael LabriolaCiviMail Trackable URL Click Through BrokenI am using CiviCRM 5.62 with WordPress 6.2.2. After sending a CiviMail with a trackable URL, clicking on the URL in the email produces this WordPress error: There has been a critical error on this website. The PHP error on the server i...I am using CiviCRM 5.62 with WordPress 6.2.2. After sending a CiviMail with a trackable URL, clicking on the URL in the email produces this WordPress error: There has been a critical error on this website. The PHP error on the server is PHP Fatal error: Uncaught Error: Class "CRM_Mailing_Event_BAO_MailingEventClickThrough" not found in /var/www/fkww/wp-content/plugins/civicrm/wp-rest/Controller/Url.php:58
URL.php is calling CRM_Mailing_Event_BAO_MailingEventClickThrough::track which does not exist anymore. I changed it to CRM_Mailing_Event_BAO_MailingEventTrackableURLOpen::track, which works.
I don't know if url.php is supposed to be calling CRM_Mailing_Event_BAO_MailingEventTrackableURLOpen::track (and the WordPress integration is broken) or if there is an alias missing somewhere (and the CiviMail core is broken).
Last time I opened up an issue with the WordPress integration project I was told that they weren't going to fix it and I should consider migrating to a different product, so I'm opening this ticket here.
Thank you.5.62.0https://lab.civicrm.org/dev/core/-/issues/4350Proposal: Smart Group Profiler to help identify slow smart groups2023-11-02T14:29:14ZlarsssandergreenProposal: Smart Group Profiler to help identify slow smart groupsSlow smart groups are a problem that I'm sure we've all experienced. It's difficult for users to guess which of their potentially many smart groups is exceptionally slow or if they just have too many, each taking a little time. @JonGold ...Slow smart groups are a problem that I'm sure we've all experienced. It's difficult for users to guess which of their potentially many smart groups is exceptionally slow or if they just have too many, each taking a little time. @JonGold has a [profiling script](https://gist.github.com/MegaphoneJon/59089c1e155645a438af41051bca7ce7), but that's not accessible to many. I'm sure many orgs would be happy to cut or re-work their slow smart groups if it meant they could use the listing accordion on individual contacts, etc — but they just don't know which ones they need to cut!
What I propose is a Smart Group Profiler in Admin that lets admin users easily check their smart groups in the UI. Here's a quick sketch:
- The user can select groups to profile or leave the select empty to profile all (active, non-hidden) smart groups
- The user can select to run once or average up to three times, to reduce the potential for random variation
- The profiler queues CRM_Contact_BAO_GroupContactCache::add for each group, in random order
- Once the queue finishes, the user gets a table with average time and links to edit the Smart Group criteria for each
I'd be happy to do this as an extension, but it also seems like something that address a core problem, so I think it makes sense to have in core.5.67.0https://lab.civicrm.org/dev/core/-/issues/4338Prevent people from sneakily adding fields to your extension's reserved custo...2023-06-15T22:56:03ZDaveDPrevent people from sneakily adding fields to your extension's reserved custom groups by using the Move action1. Make an extension that makes a reserved custom field group.
2. Someone adds a field to some other non-reserved custom field group.
3. Then they sneakily use the Move link from the links on the right to move it into your reserved group...1. Make an extension that makes a reserved custom field group.
2. Someone adds a field to some other non-reserved custom field group.
3. Then they sneakily use the Move link from the links on the right to move it into your reserved group.
4. You make some code update that then crashes or mangles the data in that field because it's not expecting it to be there.
The UI currently goes out of its way to prevent you even seeing that reserved groups exist, and bouncing if you try to hack an edit link to a field. It should also prevent moving a field into the group.5.64.0https://lab.civicrm.org/dev/core/-/issues/4326Notice errors on backoffice event registration2023-06-09T23:38:52ZJoeMurrayNotice errors on backoffice event registrationOverview
----------------------------------------
_Register a participant in backoffice. See notice errors._
Reproduction steps
----------------------------------------
1. On dmaster, click on **Events -> Register Event Participant**.
1...Overview
----------------------------------------
_Register a participant in backoffice. See notice errors._
Reproduction steps
----------------------------------------
1. On dmaster, click on **Events -> Register Event Participant**.
1. Select a contact, event fall fundraiser dinner, click **Save**.
1. Get three copies for different line numbers of "Notice: Trying to get property '_id' of non-object in CRM_Event_Form_Participant::formRule()".
Current behaviour
----------------------------------------
![2023-05-31_12-59-37](/uploads/b2ec1cad1728b29ecc09742cd557d759/2023-05-31_12-59-37.png)
```
Notice: Trying to get property '_id' of non-object in CRM_Event_Form_Participant::formRule() (line 825 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Event/Form/Participant.php).
Notice: Trying to get property '_id' of non-object in CRM_Event_Form_Participant::formRule() (line 828 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Event/Form/Participant.php).
Notice: Trying to get property '_action' of non-object in CRM_Event_Form_Participant::formRule() (line 836 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Event/Form/Participant.php).
```
Note: happens when recording payment and when not recording payment.
Expected behaviour
----------------------------------------
_No notice errors_
Environment information
----------------------------------------
dmaster
Comments
----------------------------------------
_Anything else you would like the reviewer to note._5.63.0Monish DebMonish Debhttps://lab.civicrm.org/dev/core/-/issues/4317Import contribution fails with custom fields2023-07-05T23:48:39ZPhilipp MichaelImport contribution fails with custom fieldsOverview
----------------------------------------
When importing contributions with field mappings to a custom field, the process fails after continuing from step 2 of 3.
Reproduction steps
----------------------------------------
1. Cl...Overview
----------------------------------------
When importing contributions with field mappings to a custom field, the process fails after continuing from step 2 of 3.
Reproduction steps
----------------------------------------
1. Click on **Contributions -> Import Contributions**.
1. Choose mandotory options and continue to step 2.
1. In "Matching CiviCRM Field" choose at least one custom field and try to continue to step 3
1. Got an error "**TypeError: CRM_Import_Parser::getFieldMetadata(): Return value must be of type array, null returned**".
Current behavior
----------------------------------------
Regardless of the provided CSV data, the process fails with:
```
TypeError: CRM_Import_Parser::getFieldMetadata(): Return value must be of type array, null returned in CRM_Import_Parser->getFieldMetadata() (line 1768 of /var/www/html/vendor/civicrm/civicrm-core/CRM/Import/Parser.php).
CRM_Import_Parser->getFieldMetadata('Zu_belastendes_Konto.nur_anstehende_Zuwendungen._IBAN') (Line: 165)
CRM_Contribute_Import_Parser_Contribution->getMappedRow(Array) (Line: 221)
CRM_Contribute_Import_Parser_Contribution->validateValues(Array) (Line: 2551)
CRM_Import_Parser->validateRow(Array) (Line: 1842)
CRM_Import_Parser->validate() (Line: 90)
CRM_Import_Form_MapField->postProcess() (Line: 612)
CRM_Core_Form->mainProcess() (Line: 144)
CRM_Core_StateMachine->perform(Object, 'next', 'Next') (Line: 43)
CRM_Core_QuickForm_Action_Next->perform(Object, 'next') (Line: 203)
HTML_QuickForm_Controller->handle(Object, 'next') (Line: 103)
HTML_QuickForm_Page->handle('next') (Line: 355)
CRM_Core_Controller->run(Array, NULL) (Line: 319)
CRM_Core_Invoke::runItem(Array) (Line: 69)
CRM_Core_Invoke::_invoke(Array) (Line: 36)
CRM_Core_Invoke::invoke(Array) (Line: 88)
Drupal\civicrm\Civicrm->invoke(Array) (Line: 83)
Drupal\civicrm\Controller\CivicrmController->main(Array, '')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
```
Environment information
----------------------------------------
* __CiviCRM:__ _Master/5.60/5.62/5.64_
* __PHP:__ _8.0_
* __CMS:__ _Drupal 9.5.9_
* __Database:__ _MariaDB 10.4.28_
Comments
----------------------------------------
I've tested latest versions and can reproduce it in 5.60 and later. It was probably caused with changes in [Update Contribution Import to use apiv4 field names, prior to adding hooks](https://github.com/civicrm/civicrm-core/pull/25886). The way of getting custom fields available for import has changed, which leads to different field keys respectively option values. Previously you got the short version "custom_xy", now you get a long database field name like one.
5.59:
![mapping-custom-fields-options-5.59](/uploads/e4f4adc83357fd0c3e7613b6f92d5bb2/mapping-custom-fields-options-5.59.png)
5.60 (and 5.62, 5.64):
![mapping-custom-fields-options-5.62](/uploads/d0f7573c8f279bc53c794949d3183ea9/mapping-custom-fields-options-5.62.png)
The import parser can't find related field meta data regarding to those keys.
I'm not sure, if those key names provided by the API are intended and therefor can't provide a PR.5.63.0https://lab.civicrm.org/dev/core/-/issues/4316Allow administrators to restrict which contacts will receive an email notific...2023-05-31T23:54:42Zayush_compucoAllow administrators to restrict which contacts will receive an email notification when an activity is assigned to a contactHow it works currently:
----------------------------------------
Administrators can only choose either to enable or disable sending email notifications (including a copy of the activity) when an activity is assigned to a contact OR limit...How it works currently:
----------------------------------------
Administrators can only choose either to enable or disable sending email notifications (including a copy of the activity) when an activity is assigned to a contact OR limit it to specific types of activity.
![image](/uploads/15806181b9f0204f847f4e8a8a70b817/image.png)
https://dmaster.demo.civicrm.org/civicrm/admin/setting/preferences/display?reset=1
**Improvement**
----------------------------------------
We would like to allow administrators to specify which groups of users would receive an email so that certain users can be assigned an activity, but they would not receive CiviCRM's default activity assignee email.
**Note**
----------------------------------------
Note, there is already some similar (but subtly different!) functionality on CiviCase for case activities:
![image](/uploads/7683b54741cb91ec61227f47c7eb87cc/image.png)
The above restricts **who can be selected** to be assigned an activity, whereas we are specifying **who would be sent** a notification for an activity.
**Proposed solution**
----------------------------------------
We propose adding a new functionality that allows administrators to specify which CiviCRM groups would receive an email notifications. This can be achieved by introducing a new dropdown field.
We would create 2 new settings for this under the setting for "Do not notify assignees for" <Activity types> on the Display Preferences page: https://dmaster.demo.civicrm.org/civicrm/admin/setting/preferences/display?reset=1 which states:
1. Restrict email recipients to groups
- <Select Group> (list all CiviCRM groups or smart groups)
- Multiselect
- Help: Limit which contacts will receive a CiviCRM activity notification email when an activity is assigned to them. You can select any group or smart group. Leave blank for no restriction. Note that you may still assign an activity to a contact who is not in the group, but they will not receive an email.
If the field is blank there will be no restriction. If a group is selected, emails will be restricted to only go to that group.
2. Restrict email recipients to Website Users
- Checkbox
- Help: Limit which contacts will receive a CiviCRM activity notification email to only be those who have a CMS user when an activity is assigned to them. Note that you may still assign an activity to a contact who does not have a CMS user, but they will not receive an email.
Emails will be suppressed in each case.
**Next steps**
----------------------------------------
We are prepared to submit a pull request (PR) for this feature. If the concept is approved, we will promptly submit the core PR.
Thank you.https://lab.civicrm.org/dev/core/-/issues/4309Editing multiple scheduled reminders at the same time overwrites the most rec...2023-07-21T03:01:16Zchrisgaraffachris@aghstrategies.comEditing multiple scheduled reminders at the same time overwrites the most recently openedOverview
----------------------------------------
If you open the Edit link for multiple Scheduled Reminders in new tabs/windows and save any but the most recently opened, that most recently opened reminder gets overwritten.
Reproductio...Overview
----------------------------------------
If you open the Edit link for multiple Scheduled Reminders in new tabs/windows and save any but the most recently opened, that most recently opened reminder gets overwritten.
Reproduction steps
----------------------------------------
1. Administer > Communications > Schedule Reminders
2. Create two new Reminders, Test 1 and Test 2. The specifics don't seem to matter.
3. Observe that the list has Test 1 and Test 2.
4. Open the Edit link for Test 1 in a new window or tab.
5. Open the Edit link for Test 2 in a new window or tab.
6. Rename Test 1 to Test 3 (and/or change any other settings).
7. Save Test 1 (now Test 3)
8. View the Scheduled Reminders list
Current behaviour
----------------------------------------
The list now reads Test 1, Test 3.
Test 2, which was opened after Test 1, is overwritten by the changes and is now Test 3. The original Test 1 remains untouched.
Expected behaviour
----------------------------------------
The list should read Test 3, Test 2.
Test 1 should be renamed to Test 3. Nothing should have changed on Test 2.
Environment information
----------------------------------------
Reproduced on WordPress 5.9.7 / Civi 5.8.1, WordPress 6.2.2 / Civi 5.61.3 and on d9-master / 5.63.alpha1.https://lab.civicrm.org/dev/core/-/issues/4305Implementing hook_civicrm_alterAngular breaks href attributes that include so...2023-05-24T10:43:11ZDaveDImplementing hook_civicrm_alterAngular breaks href attributes that include some angular expressionsSee also https://chat.civicrm.org/civicrm/pl/xqbryepb4fra5f6smn8uazbeoc
searchkit has a line like this in the code: `<a href="#/create/{{:: row.data.api_entity + '?params=' + $ctrl.encode(row.data.api_params) }}">`
If you implement alt...See also https://chat.civicrm.org/civicrm/pl/xqbryepb4fra5f6smn8uazbeoc
searchkit has a line like this in the code: `<a href="#/create/{{:: row.data.api_entity + '?params=' + $ctrl.encode(row.data.api_params) }}">`
If you implement alterAngular, even if you don't change anything, it breaks that code because the `+`'s become spaces. e.g.
```php
function myextension_civicrm_alterAngular(\Civi\Angular\Manager $angular) {
$changeSet = \Civi\Angular\ChangeSet::create('dosomething')
->alterHtml('~/crmSearchAdmin/searchListing/buttons.html',
function (phpQueryObject $doc) {
// it breaks even if you don't do anything here
});
$angular->add($changeSet);
```
The problem seems to be in DOMDocument itself (or maybe libxml). It treats href specially, but is picky about which characters it encodes. It will encode `{`, `[`, `&`, `$`, etc but not `+`, `.`, `=`, etc, and amazingly not even `%`. So then when you urldecode it turns the `+` into a space, and if you had something like `%12` in your original string, it would end up decoding that into a single char. It serves you right a bit for using those chars in a filename/url, but it's legal.
This seems inconsistent/error-prone.
And note it only does this for href attributes, e.g.
```php
<?php
$d = new DOMDocument();
$d->loadHTML('<a href="abc/!@#$%12*-.+(){}[]=" data-foo="abc/!@#$%12*-.+(){}[]=">');
echo $d->saveHTML();
```
gives
```
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><a href="abc/!@#%24%12*-.+()%7B%7D%5B%5D=" data-foo="abc/!@#$%12*-.+(){}[]="></a></body></html>
```
So while Civi\Angular\Coder could maybe be updated somehow, there isn't really a way for it to know if you meant something like `%2C` to be a literal percent followed by 2C, or if you meant `,`, and ditto for all the other characters it skips. So using ng-href instead seems like a good way of avoiding the problem, just as noted in the chat it's hard to enforce this. But core could do it at least.5.63.0https://lab.civicrm.org/dev/core/-/issues/4289Multi record Profile forms not saving and redirecting on "Add New Record".2023-11-08T14:04:31Zdarren.woodsMulti record Profile forms not saving and redirecting on "Add New Record".Overview
----------------------------------------
Multi record Profile forms are no longer respecting the "Redirect URL" for the Profile:-
![image](/uploads/3b349b061965a160ec7a51cfab703972/image.png)
Reproduction steps
----------------...Overview
----------------------------------------
Multi record Profile forms are no longer respecting the "Redirect URL" for the Profile:-
![image](/uploads/3b349b061965a160ec7a51cfab703972/image.png)
Reproduction steps
----------------------------------------
1. Under "Administer/Custom Data and Screens/Display Preferences" deselect "Enable Popup Forms".
2. Create a multi record custom data group and add a field.
2. Create a Profile which exposes these fields as a standalone form, setting the "Redirect URL" to be a valid URL.
3. Embed this Profile in a WordPress page using a shortcode, e.g.: [civicrm component="profile" gid="16" mode="edit" hijack="0"]
4. View the Page and click "Add new record", enter some valid data and click "Submit button.
Current behaviour
----------------------------------------
Form data is not saved and user is redirected to /civicrm/profile/edit which results in a blank WordPress page.
Expected behaviour
----------------------------------------
Form data is saved and user is redirected to the Redirect URL.
Environment information
----------------------------------------
CiviCRM 5.61.2
WordPress 6.2
Comments
----------------------------------------
_Anything else you would like the reviewer to note._https://lab.civicrm.org/dev/core/-/issues/4284Allow deletion of primary email2023-05-27T04:50:27ZlarsssandergreenAllow deletion of primary emailOn the Contact Summary tab, you can delete a contact's non-primary email, but you cannot delete their primary email. Seems like you should be able to delete any email, primary or not. If you delete a primary email, the next email on the ...On the Contact Summary tab, you can delete a contact's non-primary email, but you cannot delete their primary email. Seems like you should be able to delete any email, primary or not. If you delete a primary email, the next email on the list should become primary.
This is also kind of annoying if you want to add a new primary email and delete the old one, in which case you have to add the new email, make it primary, save, re-open the edit window and then delete the old primary email.https://lab.civicrm.org/dev/core/-/issues/4283Search Kit did not install automatically (Civi 5.61.1 FR and Drupal 7.97.FR2023-05-25T13:23:57ZWebmasterBouclierSearch Kit did not install automatically (Civi 5.61.1 FR and Drupal 7.97.FROverview
----------------------------------------
Funny issue while doing a fresh installation of CiviCRM 5.61.1 FR on a Drupal 7.97 FR (not an upgrade). Search Kit is available in the extensions and indicatated as "Obligatoire" (mandato...Overview
----------------------------------------
Funny issue while doing a fresh installation of CiviCRM 5.61.1 FR on a Drupal 7.97 FR (not an upgrade). Search Kit is available in the extensions and indicatated as "Obligatoire" (mandatory). But it is not outlined in green as the other extensions allready installed. And there is no button to install it.
While trying to install Mosaico, system tell me that Search Kit needs to be installed before.
The Search Kit were not created in the Civi database.
More details and screenshots on chat.civicrm.org : [https://chat.civicrm.org/civicrm/pl/ea5osnwhrj855regwhjkbpse9y](https://chat.civicrm.org/civicrm/pl/ea5osnwhrj855regwhjkbpse9y)
Is this a bug in the installation process of SearchKit?
I solved the issue by using API3 install process, and that solved my problem.
But I understand that Search Kit should have installed itself automatically.
PHP 7.3
MySQL 5.7
Hosting OVH (France)https://lab.civicrm.org/dev/core/-/issues/4279Add support for loading ECMAScript Modules (ESM)2023-10-16T11:57:58ZtottenAdd support for loading ECMAScript Modules (ESM)Introduction
-------------
There was [a recent announcement](https://web.dev/import-maps-in-all-modern-browsers/) about a milestone -- all major browsers [now support](https://caniuse.com/import-maps) ECMAScript Modules (ESM) with "impo...Introduction
-------------
There was [a recent announcement](https://web.dev/import-maps-in-all-modern-browsers/) about a milestone -- all major browsers [now support](https://caniuse.com/import-maps) ECMAScript Modules (ESM) with "import-maps". Import-maps make ESM viable for complex applications (like CiviCRM) without requiring NodeJS during deployment.
The aim of this issue is to fully support ESM for JS development in CiviCRM -- by leveraging browser support for import-maps. It is broken down into a few sections:
* Part 1: Basic ESM Support
* Part 2: Import Map Support
However, because this is relatively new functionality with some risk and compatibility issues, the approach described here is an incremental phase-in -- where specific files/pages/extensions may use ESM (without requiring it for existing screens).
Background
----------
* As discussed in https://gist.github.com/totten/5c34e3885a4fe7002f990e09395b4294, one major factor in updating CiviCRM's Javascript tooling is support for ECMAScript Modules (ESM).
* ESM has increasingly become necessary for a wide of range Javascript tools and libraries.
* Originally, browsers did not support ESM. Instead, JS developers used NodeJS-based tools (such as Webpack or Rollup) to convert ESM's into basic Javascript. However, browser support for ESM has improved over the years.
* For a decent introduction to the concepts of ESM and its import-maps, see (e.g.) https://blog.logrocket.com/es-modules-in-browsers-with-import-maps/ (**Reading this #4279 will be easier if you've already been introduced to the concepts.**)
* This issue corresponds to [approach 4 in the gist](https://gist.github.com/totten/5c34e3885a4fe7002f990e09395b4294#approaches-to-linkingloading-es6-for-civicrm), except that (now) Firefox and Safari both have native support for import-maps.
Part 1. Basic ESM Support
--------------------------------
CiviCRM currently allows you to add Javascript to a page. For example:
```php
Civi::resources()->addScript('doStuff();');
Civi::resources()->addScriptFile('my_extension', 'js/foo.js');
Civi::resources()->addScriptUrl('https://example.com/bar.js');
```
generates output like:
```html
<script type="text/javascript">
doStuff();
</script>
<script type="text/javascript" src="https://example.com/path/to/my_extension/js/foo.js"></script>
<script type="text/javascript" src="https://example.com/bar.js"></script>
```
ESM documents are slightly different from regular Javascript documents -- e.g. they support the `import` and `export` keywords. Browsers require a different declaration for ESM:
```html
<script type="module">
import doStuff from './do-stuff.js';
doStuff();
</script>
<script type="module" src="https://example.com/path/to/my_extension/js/foo.js"></script>
<script type="module" src="https://example.com/bar.js"></script>
```
On the PHP side, we probably need a way to flag resources as ESMs. Perhaps:
```php
Civi::resources()->addScript('import doStuff from \'./do-stuff.js\'; doStuff();', ['esm' => TRUE]);
Civi::resources()->addScriptFile('my_extension', 'js/foo.js', ['esm' => TRUE]);
Civi::resources()->addScriptUrl('https://example.com/bar.js', ['esm' => TRUE]);
```
or
```php
Civi::resources()->addModule('import doStuff from \'./do-stuff.js\'; doStuff();');
Civi::resources()->addModuleFile('my_extension', 'js/foo.js');
Civi::resources()->addModuleUrl('https://example.com/bar.js');
```
Other considerations:
* Does it matter if or how ESM's appear in `hook_civicrm_coreResourceList`? Assuming we keep our current file-names (`*.js`), then there'd be no way to distinguish vanilla JS files from ESM files. OTOH, that hook was [deprecated circa 5.31](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_coreResourceList/). The newer `hook_civicrm_alterBundle` should be more agreeable (e.g. allowing `$bundle->addModuleFile()`, `$bundle->filter()`, etc).
* Is it absolutely necessary to add more methods or flags to `Civi::resources()`? Hypothetically, we could do a global swap in all generated HTML (replace `<script type="text/javascript">` with `<script type="module">`). However, [there are differences of interpretation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#other_differences_between_modules_and_standard_scripts) - e.g. wrt scoping and global variables. I did a quick hack to use `type="module"` globally... and the page didn't render. Nothing's impossible, but changing all-at-once feels like a heavier lift.
Part 2. Import Map Support
-----------------------
Outputting `<script type="module">` is a prerequisite for using ESM's in Civi. However, it's not sufficient - a CiviCRM deployment is split across various folders (*what with core, core-exts, downloaded-ext's, CMS plugins, and so on*). With basic ESM's, it's tricky to reference all these folders.
By adding an import-map, we can load dependencies from all these different folders.
For example, on a site with `civicrm`, `search_kit`, and `mosaico`, you might generate an import-map that looks like this:
```html
<script type="importmap">
{
"imports": {
"civicrm/": "https://example.com/modules/civicrm/js/",
"search_kit/": "https://example.com/modules/civicrm/ext/search_kit/js/"
"mosaico/": "https://example.com/files/civicrm/ext/mosaico/js"
}
}
</script>
```
which would enable imports from those paths, as in
```javascript
import searchFoo from 'search_kit/foo.js';
import mosaicoFoo from 'mosaico/foo.js';
```
There are a few important considerations here. In no particular order...
* [Quote](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap): "Only the first import map in the document with an inline definition is processed; any additional import maps and external import maps are ignored." -- This means that the importmap will (eventually) be subject to contention among applications like CiviCRM, Drupal, WordPress, etc. We'll (eventually) need a way to integrate the import-maps from different applications.
* AFAICS, the CMS's do not currently have a standard way to handle import-maps. But it's on their radar. (Ex: [Drupal issue](https://www.drupal.org/project/drupal/issues/3331393), [WP/Gutenberg issue](https://github.com/WordPress/gutenberg/issues/36716)) We should expect that (eventually) some CMS's will define their own registry. Even when they don't, we should expect *other* CMS plugins will start adding import-maps.
* There is a _logical namespace_. We need some guideline for organizing in the logical-namespace.
* Example: Map between CiviCRM extension-names and ESM folders (as in the `search_kit` and `mosaico` items above).
* Given that every page is limited to one import-map, that means the _logical namespace_ will be shared between Civi extensions and `$open_ended_future_cms_stuff`. We should probably use a prefix.
* Should we automatically map all extensions -- or require an opt-in (e.g. `hook_civicrm_esm` or `hook_civicrm_importMaps`)? How confident are we that CiviCRM extensions should be mapped 1-to-1 with ESM's folder namespace?
* "The `src`, `async`, ... attributes must not be specified." ([source](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap)) -- The entire importmap must be outputted inline as part of the top-level HTML page; you can load an external map (`<script type="importmap" src="url">`). However, this should eventually change as [WICG's specs define define a way to move the importmap to a `src`](https://github.com/WICG/import-maps#import-map-processing).
Given the constraints and expectation of future change, this approach comes to mind:
1. Define `hook_civicrm_esmImportMap(array &$importMap)` as a way for CiviCRM (core/exts) to modify the import-map.
2. Define `mixin/esm@1.0.0`. This is our first-best-guess at how to map between extensions and ESM folders, Maybe:
```php
return function ($mixInfo) {
Civi::dispatcher()->addListner('hook_civicrm_esmImportMap', function (&$importMap) use ($mixInfo) {
$logicalPath = 'civicrm/' . $mixInfo->shortName . '/';
$physicalPath = Civi::resources()->getUrl($mixInfo->longName) . '/';
$importMap[$logicalPath] = $physicalPath;
});
}
```
3. Provide an initial implementation which fires `hook_esmImportMap` and outputs the `<script type="importmap">...</script>` in the page-header.
* However, we should expect that (in the future) UF-integrations will need to swap this -- they will instead ask CiviCRM for `$importMap` and pass that to a CMS API.
* Additionally, if this mechanism is swappable, then that should improve the prognosis for adding the [es-module-shims](https://github.com/guybedford/es-module-shims) to extend compatibility to older browsers.https://lab.civicrm.org/dev/core/-/issues/4269Import "Fill" option doesn't work on email/phone fields2023-05-04T20:14:52ZJonGoldImport "Fill" option doesn't work on email/phone fieldsOverview
----------------------------------------
If you use the "Fill" strategy for duplicate records in Contact Import, it only sometimes fills email/phone numbers.
Reproduction steps
----------------------------------------
1. Create...Overview
----------------------------------------
If you use the "Fill" strategy for duplicate records in Contact Import, it only sometimes fills email/phone numbers.
Reproduction steps
----------------------------------------
1. Create a SearchKit query on demo data for individuals where Primary Email is empty and Primary Phone is empty.
1. Export their contact IDs.
1. Open the CSV, and a phone and email field. Populate the values.
1. Import with the "Fill" strategy for duplicate records, matching on contact ID
Current behaviour
----------------------------------------
Of 16 contacts, 4 were filled. The other 12 were not.
I left the email blank on one record. I received an import error for that record.
Expected behaviour
----------------------------------------
All contacts should get the phone and email filled. Leaving a non-match field blank should not result in an import error.
Comments
----------------------------------------
This is certainly a regression but I can't tell you exactly when.5.61.0JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/4262Auto detect line endings Deprecated2023-05-02T21:57:19ZTony Maynard-SmithAuto detect line endings DeprecatedThe civicrm.settings.php file, about line 581, tries to set the PHP ini function auto_detect_line_endings, which is now Deprecated (in PHP 8.1) and no longer required.
Remove this from the settings file.
(This is on my v5.60.0 system...The civicrm.settings.php file, about line 581, tries to set the PHP ini function auto_detect_line_endings, which is now Deprecated (in PHP 8.1) and no longer required.
Remove this from the settings file.
(This is on my v5.60.0 system, but this has been upgraded from earlier versions. Even if fixed in new installs, an upgrade should now fix it.)5.62.0https://lab.civicrm.org/dev/core/-/issues/4189Contribution Confirm incorrectly debit card information even if using credit ...2023-03-25T00:47:40ZbgmContribution Confirm incorrectly debit card information even if using credit cardTo reproduce:
- Create normal Contribution Page
- Enable dummy credit card
- Enable the Confirmation Page
Then go to the test page, enter test card (`4111111111111111`) and submit to go to the confirmation page:
![image](/uploads/ce70...To reproduce:
- Create normal Contribution Page
- Enable dummy credit card
- Enable the Confirmation Page
Then go to the test page, enter test card (`4111111111111111`) and submit to go to the confirmation page:
![image](/uploads/ce70684ddada9932e4da72bff3dcacfa/image.png)
The bug was introduced somewhere between 5.57 and 5.60. I suspect it's related to this PR: https://github.com/civicrm/civicrm-core/pull/25239
Those changes have not been applied to `ThankYou.tpl`.
When debugging, the `$contributeMode` was set to 'debit'. It seems to be the default value in the parent class. The code also has a code comment from 2016 saying that "The concept of contributeMode is deprecated."5.60.0https://lab.civicrm.org/dev/core/-/issues/3839Add system check for updated clean URL settings2022-09-27T19:51:34ZelilisseckAdd system check for updated clean URL settingsOverview
----------------------------------------
Based on my experience and this conversation: https://chat.civicrm.org/civicrm/pl/56au14c7dpb5ddebj69kbfjdir
Clean URLs should be required at this point. It's not as much of a problem in...Overview
----------------------------------------
Based on my experience and this conversation: https://chat.civicrm.org/civicrm/pl/56au14c7dpb5ddebj69kbfjdir
Clean URLs should be required at this point. It's not as much of a problem in Drupal, but in Wordpress if a site has been upgraded from the old Clean URL settings in civicrm.settings.php and ?civiwp style URLs and civicrm.settings.php has not been updated manually, strange things will being to occur. This largely manifests itself as yellow "Cannot find valid value for ID" error screens that confuse users when registering for an Event or making a Contribution on user-facing forms. This message comes from a tricky session issue and setting clean URLs up has always been the fix.
Current behaviour
----------------------------------------
Clean URL settings are often not updated by unsuspecting admins as older sites are upgraded to versions of CiviCRM where they should be required.
Proposed behaviour
----------------------------------------
System check warning appears for Wordpress users if civicrm.settings.php does not include up-to-date clean URL settings.
Comments
----------------------------------------
This check could be extended to other CMS' now or in the future, which is the motivation behind using its own check class rather than modifying the existing "Cms" for Wordpress checks. I haven't seen this issue with other CMS' so far.
Any thoughts welcome! PR will be provided and linked.https://lab.civicrm.org/dev/core/-/issues/3831PHP 8.2 Deprecated ${} string interpolation2022-10-31T03:45:54ZBradley TaylorPHP 8.2 Deprecated ${} string interpolationIn PHP 8.2 (planned to be released this November) ${} string interpolation has been deprecated:
https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
```
echo "Hello ${name}"; // Deprecated
echo "Hello {$name}"; // Suppo...In PHP 8.2 (planned to be released this November) ${} string interpolation has been deprecated:
https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
```
echo "Hello ${name}"; // Deprecated
echo "Hello {$name}"; // Supported
```
There are not loads of places where the deprecated version is used, but there are a few. We should swap the position of the dollar to the non-deprecated version.
(I also realise CiviCRM does not fully support PHP 8.1 yet, but it doesn't hurt to start to get ahead).5.54.0Bradley TaylorBradley Taylorhttps://lab.civicrm.org/dev/core/-/issues/3815Drop-down (select-list) fields don't render if "Options per line" is set2023-07-05T23:48:36ZmessicaDrop-down (select-list) fields don't render if "Options per line" is setOverview
----------------------------------------
Drop-down custom fields are not displayed if "Options per line" is set, even if the setting is hidden.
Reproduction steps
----------------------------------------
1. Create a "Radio butt...Overview
----------------------------------------
Drop-down custom fields are not displayed if "Options per line" is set, even if the setting is hidden.
Reproduction steps
----------------------------------------
1. Create a "Radio buttons" Custom Field.
1. Set "Options per line" to any value besides 0
1. Change the Field Input Type to "Drop-down (select list)"
1. Save
Current behaviour
----------------------------------------
The Drop-down field is not rendered at all, in previews or on front end.
Expected behaviour
----------------------------------------
The Drop-down field should ignore any previously set values for "Options per line"
Environment information
----------------------------------------
* __CiviCRM__: 5.46.3
* __PHP__: 7.4.27
* __CMS__: _WordPress 6.0.1
* __Database:__ 10.3.34-MariaDB-0+deb10u1
* __Web Server:__ Apache/2.4.38 (Debian)5.63.0https://lab.civicrm.org/dev/core/-/issues/3814Can Extension boot cache use the `fastArray` decorator2022-10-09T22:07:08ZeileenCan Extension boot cache use the `fastArray` decoratorThe cache - which is initialised [here](https://github.com/civicrm/civicrm-core/blob/5736060af94f073a75956717245269a018d7d094/CRM/Extension/System.php#L260-L264) repetitively hits `Redis` when an array cache seems like it could be used a...The cache - which is initialised [here](https://github.com/civicrm/civicrm-core/blob/5736060af94f073a75956717245269a018d7d094/CRM/Extension/System.php#L260-L264) repetitively hits `Redis` when an array cache seems like it could be used after the first hit....
```
1660868588.603856 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/mixinScan"
1660868588.604056 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/mixinBoot"
1660868588.604347 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/mapper_moduleFiles"
1660868588.604491 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.604607 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/default"
1660868588.604890 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.604987 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.605213 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.605300 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.605529 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.605618 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.605859 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.605945 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.606159 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.606280 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.606516 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.606605 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.606820 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.606928 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.607136 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.607217 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.607461 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.607573 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.607806 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.607908 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.608130 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.608225 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.608442 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.608549 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.608812 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.608903 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.609103 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.609186 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.609388 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.609485 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.609709 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.609797 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.610029 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.610114 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.610326 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.610413 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.610500 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/civiroot"
1660868588.610719 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.610802 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.611116 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.611204 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.611427 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.611516 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.611733 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.611819 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.612308 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.612437 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.612736 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.612839 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.613135 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.613267 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.613642 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.613763 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.614032 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.614143 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.614573 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.614711 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.615048 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.615185 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.615488 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.615592 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.615857 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.615985 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.616373 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.616485 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.616777 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.616884 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.617156 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.617253 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.617602 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.617739 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.618047 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.618154 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.618420 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.618519 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.618775 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.618898 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.619249 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.619376 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.619683 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.619781 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.620034 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.620131 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
1660868588.620400 [0 127.0.0.1:44178] "GET" "crm/3a14103a670c8f6215c383e11296de98/full"
```5.56.0https://lab.civicrm.org/dev/core/-/issues/3811Allow other extensions to use Recaptcha extension for validation2022-08-22T22:01:15ZKurund JalmiAllow other extensions to use Recaptcha extension for validation5.54.0Kurund JalmiKurund Jalmi