Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-05-24T10:43:11Zhttps://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/4304getUFLocale() is not setting the proper locale2023-05-24T06:37:15ZshaneonabikegetUFLocale() is not setting the proper locale## Overview
Presently, the function ```getUFLocale()``` obtains the interface language for Wordpress with integration with WPML. The present formula is using incorrect ```apply_filters``` to generate the wrong locale for front-endusers....## Overview
Presently, the function ```getUFLocale()``` obtains the interface language for Wordpress with integration with WPML. The present formula is using incorrect ```apply_filters``` to generate the wrong locale for front-endusers.
This was discovered while working validating the pull request [#289](https://github.com/civicrm/civicrm-wordpress/pull/289) for better WPML integration for front-end users.
## What should happen
The link should be generated in the language that the current user has set.
## What is the problem
```php
// Maybe override with the locale that WPML reports.
elseif (defined('ICL_LANGUAGE_CODE')) {
$languages = apply_filters('wpml_active_languages', NULL);
foreach ($languages as $language) {
if ($language['active']) {
$locale = $language['default_locale'];
break;
}
}
}
```
According to the docs, ```apply_filters('wpml_active_languages', NULL)``` only retrieves a list of languages, but this has no bearing on the user's current language. The value ```$language['active']``` refers to whether the language is active or not. In my case, I have seen this reported as _false_ in some cases where languages are active - go figure :shrug: .
So we need to use ```apply_filters('wpml_current_language')``` [to obtain](https://wpml.org/wpml-hook/wpml_current_language/) the users front-end language.
I'll post a patch for this and link it to this one.
cc @kcristianohttps://lab.civicrm.org/dev/wordpress/-/issues/141getUFLocale() is not setting the proper locale2023-05-19T18:47:06ZshaneonabikegetUFLocale() is not setting the proper locale## Overview
Presently, the function ```getUFLocale()``` obtains the interface language for Wordpress with integration with WPML. The present formula is using incorrect ```apply_filters``` to generate the wrong locale for front-endusers....## Overview
Presently, the function ```getUFLocale()``` obtains the interface language for Wordpress with integration with WPML. The present formula is using incorrect ```apply_filters``` to generate the wrong locale for front-endusers.
This was discovered while working validating the pull request [#289](https://github.com/civicrm/civicrm-wordpress/pull/289) for better WPML integration for front-end users.
## What should happen
The link should be generated in the language that the current user has set.
## What is the problem
```php
// Maybe override with the locale that WPML reports.
elseif (defined('ICL_LANGUAGE_CODE')) {
$languages = apply_filters('wpml_active_languages', NULL);
foreach ($languages as $language) {
if ($language['active']) {
$locale = $language['default_locale'];
break;
}
}
}
```
According to the docs, ```apply_filters('wpml_active_languages', NULL)``` only retrieves a list of languages, but this has no bearing on the user's current language. The value ```$language['active']``` refers to whether the language is active or not. In my case, I have seen this reported as _false_ in some cases where languages are active - go figure :shrug: .
So we need to use ```apply_filters('wpml_current_language')``` [to obtain](https://wpml.org/wpml-hook/wpml_current_language/) the users front-end language.
I'll post a patch for this and link it to this one.
cc @kcristianohttps://lab.civicrm.org/dev/wordpress/-/issues/140Event registration confirmation page no longer shown. Error: Could not find v...2023-12-07T09:30:02Zdarren.woodsEvent registration confirmation page no longer shown. Error: Could not find valid value for id.WordPress 6.2, Civi ESR 5.57.5.
The confirmation page after event registration is no longer shown (for both Test and Live links). Instead, the attached error is shown:-
![image](/uploads/602b80ebba49507af86158d362c9b164/image.png)
The ...WordPress 6.2, Civi ESR 5.57.5.
The confirmation page after event registration is no longer shown (for both Test and Live links). Instead, the attached error is shown:-
![image](/uploads/602b80ebba49507af86158d362c9b164/image.png)
The workaround is to embed the event registration page as a shortcode. However the confirmation page and confirmation emails show a link to the event info page, which then has the "Register" button taking people to the wrong page.
I'm wondering if this can be fixed, or if we need to override the confirmation and event info pages somehow to redirect users to the WordPress page (perhaps using a naming convention).
Thanks!https://lab.civicrm.org/dev/core/-/issues/4301FormBuilder: Allow placeholder text to be configured2023-05-24T06:34:31Zaydunsaidan.saunders@squiffle.ukFormBuilder: Allow placeholder text to be configuredIt would be nice to be able to specify placeholder text on form fields such as filters.It would be nice to be able to specify placeholder text on form fields such as filters.https://lab.civicrm.org/dev/core/-/issues/4300FormBuilder: Client-side email validation doesn't work2023-07-07T03:55:58ZkcristianoFormBuilder: Client-side email validation doesn't workThis is a follow up issue to https://lab.civicrm.org/dev/core/-/issues/4173 and relayed to https://lab.civicrm.org/dev/core/-/issues/4174#note_90537
Steps to Reproduce:
- Build WP site with latest CiviCRM - Cureently using WP 6.2.1 and...This is a follow up issue to https://lab.civicrm.org/dev/core/-/issues/4173 and relayed to https://lab.civicrm.org/dev/core/-/issues/4174#note_90537
Steps to Reproduce:
- Build WP site with latest CiviCRM - Cureently using WP 6.2.1 and CiviCRM 5.61.2
- Create a submission form with the following Fields - all required
- First Name
- Last Name
- Email
- Phone
Compete the form, but for email use `meatme` as the email address.
- expected behavior - fails validation
- Actual behavior form submits
Email validation not working client side or server side. I have confirmed this on WP and Drupal 7.
~~Possibly related - on phone or address - add a second item (second phone in my testing). Do not choose a location type. Form submits, but the record does not update CiviCRM. This behavior only exists on WP, I cannot reproduce on Drupal. I can break this out as another issue if needed. But adding here as I see this as validation failing.~~
EDIT: The location issue is fixed in WP with the master branch.
ping @eileen @colemanw @shaneonabike @JonGold As we all commented on original issue notifying and asking for feedback and comments on a possible way to fix.https://lab.civicrm.org/dev/core/-/issues/4299Send contribution receipt when contribution completed by recording payment on...2023-08-01T14:42:08ZlarsssandergreenSend contribution receipt when contribution completed by recording payment on the backendThrough discussion in this [PR](https://github.com/civicrm/civicrm-core/pull/26247), it has become clear that there is an inconsistency in which message templates are sent when completing a pending contribution with a payment, depending ...Through discussion in this [PR](https://github.com/civicrm/civicrm-core/pull/26247), it has become clear that there is an inconsistency in which message templates are sent when completing a pending contribution with a payment, depending on where the payment is recorded.
If the payment is recorded via API and the receipt has not yet been set, a contribution receipt template is sent.
If the payment is recorded via a Search Action and the receipt has not been sent, a contribution receipt template is sent.
If the payment is recorded via Record Payment in the UI, there is an option to send to send a receipt, but if selected a "Additional Payment Receipt or Refund Notification" template is sent.
I think that in the third case, for consistency, we should send a contribution receipt template as long as the contribution is now completed. The same logic works with membership receipt templates.https://lab.civicrm.org/dev/core/-/issues/4298CiviMail - throw 400 (Bad Request) rather than 500 (Server Error) if public u...2023-07-27T17:17:06ZufundoCiviMail - throw 400 (Bad Request) rather than 500 (Server Error) if public url endpoints hit with bad parametersOverview
----------------------------------------
Urls for CiviMail public endpoints like `civicrm/mailing/open` have a few required parameters, identifying the user / url etc. How should we handle if params aren't valid?
Current behavi...Overview
----------------------------------------
Urls for CiviMail public endpoints like `civicrm/mailing/open` have a few required parameters, identifying the user / url etc. How should we handle if params aren't valid?
Current behaviour
----------------------------------------
Current standard behaviour Civi-wide for missing/invalid params is a `CRM_Core_Exception`, which in turn results in a 500 server error.
Proposed behaviour
----------------------------------------
I think a 400 Bad Request error is more appropriate, for the "public" CiviMail links in particular.
Comments
----------------------------------------
It also helps with detecting and blocking spammy click behaviour, which I've seen with random permutations of parameters and things like this.5.65.0https://lab.civicrm.org/dev/core/-/issues/4297Do help links go after the label or after the field?2023-06-20T20:38:21ZlarsssandergreenDo help links go after the label or after the field?It seems like on some backend forms, the little help links are after the label, while in other places they are after the field itself. If we can agree on one or the other, I will adjust the templates so forms are consistent. My unscienti...It seems like on some backend forms, the little help links are after the label, while in other places they are after the field itself. If we can agree on one or the other, I will adjust the templates so forms are consistent. My unscientific survey indicates that we have about 2/3 after the label and 1/3 after the field right now.
Here's an example with both:
![image](/uploads/28270ce52cc725f384c3e4bcb368442a/image.png)
Additional consideration: When there is both a setting and a help, probably having one after the other would be not great.
![image](/uploads/2966630753c68c090d2a80269a488c34/image.png)
Also, there are a few with help at the end of the description
![image](/uploads/964d812410ed131320947dc6d7b0b7c5/image.png)
Some fields it has to be after the field because there is no label
![image](/uploads/d2f943517edf44b307599502855c4346/image.png)
Checkboxes are always after the label, but that's at the end of the line.
![image](/uploads/f7d02999614ef14009d158d8236b9951/image.png)
With multiple checkboxes, it has to be after the label, there isn't really any other option.
![image](/uploads/155a387d37d5452b9e4f7373cb7a447a/image.png)
Another different layout, I think it only makes sense after the label here
![image](/uploads/d13c5bd26e5bb9aff8f72adf5dc2f109/image.png)https://lab.civicrm.org/dev/core/-/issues/4296FormBuilder filters suggestion: text filter as select2023-06-08T18:02:44Zaydunsaidan.saunders@squiffle.ukFormBuilder filters suggestion: text filter as selectOverview
----------------------------------------
For FormBuilder filters, it would be useful to have the option to turn `Text` into `Select`.
Example use-case
----------------------------------------
For a search return results like:
...Overview
----------------------------------------
For FormBuilder filters, it would be useful to have the option to turn `Text` into `Select`.
Example use-case
----------------------------------------
For a search return results like:
```
Org, Contact
------------
Org1, ContactA
Org1, ContactB
Org1, ContactC
Org2, ContactD
Org2, ContactE
```
you can add a filter on Org Display Name which is displayed as a text box.
It would be nice to be able to present this as a `Select` dropdown of 'Org1', 'Org2' etc (or even multi-select). The configuration for the filter provides a `Type` box with several options, so add a `Select` one to that (in addition to the existing `Text`).
The current text filter is a substring match which means that if one display name is a substring of another, you can't filter to just the shorter name. So eg 'Org1', 'Org1 - committee A', 'Org1 - committee B' you can't just show 'Org1'. Turning this into a `Select` should either exact match on the text string or convert to filtering by `id`.https://lab.civicrm.org/dev/core/-/issues/4295SearchKit - non-core legacy search tasks don't work with contributions2023-05-24T07:05:24ZufundoSearchKit - non-core legacy search tasks don't work with contributionsReproduction steps
----------------------------------------
1. Create a SearchKit with contribution entities
1. Enable an extension with a legacy search task (e.g. https://lab.civicrm.org/ufundo/ukgiftaid/-/tree/searchkit-actions )
1. Ta...Reproduction steps
----------------------------------------
1. Create a SearchKit with contribution entities
1. Enable an extension with a legacy search task (e.g. https://lab.civicrm.org/ufundo/ukgiftaid/-/tree/searchkit-actions )
1. Task appears in the ACTIONS menu for the contributions
2. But the popup when you click the action fails ( "Unable to reach the server. Please refresh this page in your browser and try again.")
Current behaviour
----------------------------------------
![image](/uploads/f8f841892e5741e9544b5797aa07fbfd/image.png)
```
We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.<br /><br />Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.<br /><br />Error type: Could not find a valid session key.
```
Expected behaviour
----------------------------------------
Action form should appear in the pop up.
Comments
----------------------------------------
`SearchDisplay::getSearchTasks` currently generates qfKey for legacy search task forms based on hard-coded class `CRM_Contribute_Controller_Task` in this line https://github.com/civicrm/civicrm-core/blob/a599e40ad27ebcd9d4b8e80bf0a5904983d5ee82/ext/search_kit/Civi/Api4/Action/SearchDisplay/GetSearchTasks.php#LL196C1-L196C77
This causes tasks using any other class controller fail due to the mismatch.
Couple of potential fixes incoming...ufundoufundohttps://lab.civicrm.org/dev/core/-/issues/4294Fix mailto links that get converted to traceable urls2023-06-19T23:31:10ZyashodhaFix mailto links that get converted to traceable urlsmailto links also get converted to trackable urls causing issues. Let's avoid doing that.mailto links also get converted to trackable urls causing issues. Let's avoid doing that.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4293Uncaught SyntaxError: '#' not followed by identifier2023-11-23T07:47:01ZBastien HoUncaught SyntaxError: '#' not followed by identifierIn a contribution page, I get an `Uncaught SyntaxError: '#' not followed by identifier` error in the console.
Reproduction steps
----------------------------------------
1. Create a contribution page.
1. Insert it in a WordPress page.
1...In a contribution page, I get an `Uncaught SyntaxError: '#' not followed by identifier` error in the console.
Reproduction steps
----------------------------------------
1. Create a contribution page.
1. Insert it in a WordPress page.
1. Display the page.
1. Open the console of the navigator
In _templates/CRM/Contribute/Form/Contribution/Main.tpl_, the following lines are misinterpreted before being output:
```js
function useAmountOther() {
var priceset = {/literal}
{if $contriPriceset}'{$contriPriceset}'
{else}0
{/if}
{literal};
for (i = 0; i < document.Main.elements.length; i++) {
element = document.Main.elements[i];
if (element.type == 'radio' && element.name == priceset) {
if (element.value == '0') {
element.click();
} else {
element.checked = false;
}
}
}
}
```
In the source of the generated page:
```js
function useAmountOther() {
var priceset =
0
;
for (i = 0; i < document.Main.elements.length; i++) {
element = document.Main.elements[i];
if (element.type == 'radio' && element.name == priceset) {
if (element.value == '0') {
element.click();
} else {
element.checked = false;
}
}
}
}
```
Environment information
----------------------------------------
<!-- Some of the items below may not be relevant for every bug - if in doubt please include more information than you think is neccessary. -->
* __Browser:__ _Firefox 112_
* __CiviCRM:__ _5.61.2_
* __PHP:__ _8.0_
* __CMS:__ _WordPress 6.2_
* __Database:__ _MariaDB 10.5_
* __Web Server:__ _Apache 2.4_https://lab.civicrm.org/dev/core/-/issues/4292Add validation to verify html body content for empty text/ only image in mailing2023-05-24T06:23:56ZyashodhaAdd validation to verify html body content for empty text/ only image in mailingAdd validation to verify html body content for empty text (if img are used) and show the error accordingly.Add validation to verify html body content for empty text (if img are used) and show the error accordingly.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4291Smarty variable tokens not correctly processed in message subject2023-09-24T22:40:26Zmagnolia61Smarty variable tokens not correctly processed in message subjectOverview
----------------------------------------
Smarty variable tokens are not processed in message subject
Reproduction steps
----------------------------------------
1. In a message template body html we have for instance {capture a...Overview
----------------------------------------
Smarty variable tokens are not processed in message subject
Reproduction steps
----------------------------------------
1. In a message template body html we have for instance {capture assign="firstname"}{contact.first_name}{/capture}
2. We use {$firstname} in the body.
3. We use {$firstname} in the subject.
4. When sending a email manually the subject token gets replaced.
5. When sending via scheduled reminders or civirules the subject token does not get replaced.
6. Worse: our automatic birthday mail batch (civirules) got firstnames of the previous contact (only in the subject)
Current behaviour
----------------------------------------
smart variables are sometimes not correctly replaced as a token in the message subject
Expected behaviour
----------------------------------------
smart variables are sometimes always correctly replaced as a token in the message subject
Environment information
----------------------------------------
- CiviCRM: 5.61.2
- CMS: Drupal 7.97
- PHP: 7.4.33 (fpm-fcgi)
- Database: 10.5.19-MariaDB-0+deb11u2-log engine: InnoDB 10 row format: Dynamic
- Webserver: Apache/2.4.56 (Debian)
- OS: Linux
Comments
----------------------------------------
I will doublecheck if this is only the case with civirules or also with the scheduled remindershttps://lab.civicrm.org/dev/core/-/issues/4290SearchKit: Return results faster by optimizing access check2023-05-15T08:14:11ZlarsssandergreenSearchKit: Return results faster by optimizing access checkThrough some testing, it looks like quite a bit of the execution time for SearchKit results on Compose Search, at least for relatively simple queries, is being spent checking the current user's access to edit or delete the specific entit...Through some testing, it looks like quite a bit of the execution time for SearchKit results on Compose Search, at least for relatively simple queries, is being spent checking the current user's access to edit or delete the specific entity for the View / Edit / Delete menu in the last column. It's not too bad with just 50 rows, but if you increase the page size to 100 or more, there's a pretty perceptible difference between checking the access and skipping that access check. I had a few thoughts about how we could improve this:
1. Since we aren't actually showing the links until the user clicks on the hamburger menu, we could just add the links as usual, but then check access in JS and only unhide those that the user has access to. This way we aren't doing 100 checkAccess API calls per page of 50 entities (one for update, one for delete). This would make the Compose Search page faster as well as any Displays that contain the same menu, but wouldn't help if there are links or buttons in a Display.
2. I think quite a few of the users accessing Compose Search probably have superadmin, so we could check that at the start of the process and then skip the access checks for each row.
3. Maybe it would make sense to make it possible to pass an array of ids to the checkAccess API. I don't know the details of how this works, but imagine that would speed up the process. At least for Contacts, there already is `allowList()`, so maybe this could be implemented just for Contacts without too much trouble.https://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/4288Price set option limit = 0 should mean no spaces, rather than no limit2023-05-15T08:16:42ZlarsssandergreenPrice set option limit = 0 should mean no spaces, rather than no limitIf you set a price set option limit to 0, this is the same as not specifying a limit. I would expect that a limit of 0 would mean there are no spaces. Setting the limit to 0 is different than disabling the price set option, as disabling ...If you set a price set option limit to 0, this is the same as not specifying a limit. I would expect that a limit of 0 would mean there are no spaces. Setting the limit to 0 is different than disabling the price set option, as disabling makes it so the option does not appear on public forms, while I expect setting the limit to 0 would just make it sold out, but still appear. I can't think of a good reason you would want 0 to be the same as no limit, but maybe others can?
Will submit PR unless there are objections. Otherwise, will add help text.https://lab.civicrm.org/dev/drupal/-/issues/187Installing drupal/fontawesome causes CiviCRM to freeze the browser.2023-05-24T06:53:44Zdarren.woodsInstalling drupal/fontawesome causes CiviCRM to freeze the browser.Install vanilla Drupal 9 via composer.
Installed CiviCRM via composer according to docs.
Installed the Fontawesome module: composer require 'drupal/fontawesome:^2.25'
Loading any CiviCRM paths /civicrm/admin causes the browser to enter...Install vanilla Drupal 9 via composer.
Installed CiviCRM via composer according to docs.
Installed the Fontawesome module: composer require 'drupal/fontawesome:^2.25'
Loading any CiviCRM paths /civicrm/admin causes the browser to enter an infinite loop once the DOM is loaded.
Tracked it down to all.js from Fontawesome.
Removing Fontawesome module resolves it: composer remove 'drupal/fontawesome'
Could this be related to the civicrm asset plugin?
Before the browser freezes, I can see there are two icons for each admin menu option.
We would dearly love to use fa icons in our Drupal theme :pray:https://lab.civicrm.org/dev/core/-/issues/4286Fatal error with managed custom groups containing duplicate field names2023-05-17T10:45:16ZAndrew WestFatal error with managed custom groups containing duplicate field namesOverview
----------------------------------------
I have two custom groups. Each contains a field titled 'Status'. In the database they have the same 'name': 'status'.
I want these groups to be managed entities. So I export both groups ...Overview
----------------------------------------
I have two custom groups. Each contains a field titled 'Status'. In the database they have the same 'name': 'status'.
I want these groups to be managed entities. So I export both groups using the 'export' command on the 'CustomGroup' entity. I set the export to match on 'name' - this seems the sensible field as users can't change it.
This helpfully exports everything I need: I get a .mdg.php file with each custom groups, their fields, and the fields' option values.
But when I enable the extension on a test machine I get a fatal error because of the duplicate 'name'.
The first field gets created fine, but when creating the second field it erroneously matches on the first one so thinks it exists already, and things go wrong from there.
The fix is to set the 'match' parameter on the managed entity to include the custom group name too:
```
'match' => [
'name','custom_group_id.name',
],
```
But you can't do this through the UI. The 'match' option on the CustomGroup Export action doesn't include fields from the CustomField entity (let alone the name).
Reproduction steps
----------------------------------------
1. Create a new extension with the two managed entities from [this gist](https://gist.github.com/awestuk/a9956427ce1937fcbd8fddeed675cef5)
2. Try to enable it
Environment information
----------------------------------------
* __CiviCRM:__ _5.60_ <!-- If this problem relates to an upgrade, then specify both old and new versions -->
* __PHP:__ _7.4_
Comments
----------------------------------------
I can fix it manually by changing the field names, or by manually adding the custom_group_id.name to the .mgd.php files. But I figure duplicate names are common enough to trip people up, and it was a tough one to debug, so I thought it was worth reporting.