CiviCRM Core issueshttps://lab.civicrm.org/dev/core/-/issues2023-06-23T17:54:21Zhttps://lab.civicrm.org/dev/core/-/issues/6Add help text for "is public" setting on form to edit custom field sets2023-06-23T17:54:21ZSean ColsenAdd help text for "is public" setting on form to edit custom field setsThere's a new setting for making custom field sets public/private. I think it needs some help text.
![mockup](https://user-images.githubusercontent.com/42411/36987279-f763aae0-2069-11e8-99c8-b3dd9953a895.png)
How exactly does CiviCRM c...There's a new setting for making custom field sets public/private. I think it needs some help text.
![mockup](https://user-images.githubusercontent.com/42411/36987279-f763aae0-2069-11e8-99c8-b3dd9953a895.png)
How exactly does CiviCRM change its behavior based on this setting?
As far as I can tell, this setting has only two effects:
* Custom fields attached directly to *events* are hidden from the event info page if they are part of a private custom field set
* from https://github.com/civicrm/civicrm-core/pull/10028
* Custom fields attached to some other entities (e.g. participation, contribution, etc... *not sure of comprehensive list*) are displayed in the registration email sent to participants, but only when this email comes from a back-office registration. These fields will be hidden if they're part of a private set.
* from https://github.com/civicrm/civicrm-core/pull/106615.8https://lab.civicrm.org/dev/core/-/issues/1912Weird "null" in mailing recipient group list2023-06-23T03:51:55ZDaveDWeird "null" in mailing recipient group list![null](/uploads/0c8e6691c31580ceb2cc621df015fe93/null.png)
Can reproduce on dmaster.demo. I don't see it in 5.22 but do see it in 5.24 and up. Don't have a 5.23 handy.
1. Create at least 2 groups with the mailing list checkbox checked...![null](/uploads/0c8e6691c31580ceb2cc621df015fe93/null.png)
Can reproduce on dmaster.demo. I don't see it in 5.22 but do see it in 5.24 and up. Don't have a 5.23 handy.
1. Create at least 2 groups with the mailing list checkbox checked.
1. Go to New Mailing.
1. Pick one group.
1. Open the group dropdown again and scroll down.
1. It even lets you select it.
In drupal watchdog there is this:
`Location: http://example.com/civicrm/ajax/rest?entity=Mailing&action=getlist&json=%7B%22input%22%3A%22%22%2C%22page_num%22%3A1%2C%22params%22%3A%7B%22is_hidden%22%3A0%2C%22is_active%22%3A1%2C%22options%22%3A%7B%22sort%22%3A%22is_archived+asc%2C+scheduled_date+desc%22%7D%7D%2C%22api.MailingRecipients.getcount%22%3A%7B%7D%7D`
`Notice: Undefined index: name in _civicrm_api3_generic_getlist_output() (line 191 of .../api/v3/Generic/Getlist.php).`
This might be violating a higher mathematical law here too - it's not possible to exclude the null set, since the null set is a subset of every set. (Source: Math)5.64.0https://lab.civicrm.org/dev/core/-/issues/2189Activity Type cleanup2023-06-15T05:03:16ZJonGoldActivity Type cleanupCurrently, activity types can have a `component_id`, so they're not displayed unless that component is enabled. However, 4 activities definitively tied to components ("Bulk Email", "Mass SMS" for CiviMail; "Downloaded Invoice", "Emailed...Currently, activity types can have a `component_id`, so they're not displayed unless that component is enabled. However, 4 activities definitively tied to components ("Bulk Email", "Mass SMS" for CiviMail; "Downloaded Invoice", "Emailed Invoice" for CiviContribute) don't have a `component_id` assigned.
It also seems that "Meeting" and "Phone Call" are set as `is_reserved`, but there aren't any references to those in the codebase such that disabling or deleting them should affect a Civi install.JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/4090Managed Entity reconciliation fails if entity exists without Managed entity2023-06-08T16:37:28Zaydunsaidan.saunders@squiffle.ukManaged Entity reconciliation fails if entity exists without Managed entityOverview
----------------------------------------
Follow along now: "Managed Entities" involve both a `Managed` entity and the entity being managed. If the managed entity exists but the corresponding `Managed` entity does not, errors a...Overview
----------------------------------------
Follow along now: "Managed Entities" involve both a `Managed` entity and the entity being managed. If the managed entity exists but the corresponding `Managed` entity does not, errors are thrown.
For example, if an extension provides a `.mgd.php` file specifying a `PaymentProcessorType` entity, the reconciliation process will create the `PaymentProcessorType` entity and a `Managed` entity and then manage updates or deletion when the extension is updated or uninstalled.
In some (unknown) circumstances, the `Managed` entity does not exist but the managed (eg `PaymentProcessorType`) entity does exist. `CRM_Core_ManagedEntities::reconcile()` does not check for the existence of the `PaymentProcessorType` entity and so attempts to create a duplicate which fails. This happens any time a cache clear occurs.
Reproduction steps
----------------------------------------
I don't know how this has occurred on live systems, but to simulate:
1. Install Stripe (or other extension with `.mgd.php`)
2. Delete the `Managed` entity for Stripe: `cv api4 Managed.delete +w 'name = "Stripe"'`
3. `cv flush`
Current behaviour
----------------------------------------
```
$ cv flush
Flushing system caches
Error: API Call Failed: Array
(
[entity] => System
[action] => flush
[params] => Array
(
[debug] => 1
[version] => 3
)
[result] => Array
(
[trace] => #0 /opt/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php(192): CRM_Core_ManagedEntities->onApiError()
#1 /opt/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php(152): CRM_Core_ManagedEntities->insertNewEntity()
#2 /opt/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php(113): CRM_Core_ManagedEntities->reconcileEntities()
#3 /opt/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(417): CRM_Core_ManagedEntities->reconcile()
#4 /opt/buildkit/build/dmaster/web/sites/all/modules/civicrm/api/v3/System.php(33): CRM_Core_Invoke::rebuildMenuAndCaches()
#5 /opt/buildkit/build/dmaster/web/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_system_flush()
#6 /opt/buildkit/build/dmaster/web/sites/all/modules/civicrm/Civi/API/Kernel.php(158): Civi\API\Provider\MagicFunctionProvider->invoke()
#7 /opt/buildkit/build/dmaster/web/sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest()
#8 /opt/buildkit/build/dmaster/web/sites/all/modules/civicrm/api/api.php(22): Civi\API\Kernel->runSafe()
#9 phar:///opt/buildkit/bin/cv/src/Command/BaseCommand.php(63): civicrm_api()
#10 phar:///opt/buildkit/bin/cv/src/Command/FlushCommand.php(37): Civi\Cv\Command\BaseCommand->callApiSuccess()
#11 phar:///opt/buildkit/bin/cv/vendor/symfony/console/Command/Command.php(255): Civi\Cv\Command\FlushCommand->execute()
#12 phar:///opt/buildkit/bin/cv/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#13 phar:///opt/buildkit/bin/cv/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#14 phar:///opt/buildkit/bin/cv/src/Application.php(82): Symfony\Component\Console\Application->doRun()
#15 phar:///opt/buildkit/bin/cv/vendor/symfony/console/Application.php(149): Civi\Cv\Application->doRun()
#16 phar:///opt/buildkit/bin/cv/src/Application.php(49): Symfony\Component\Console\Application->run()
#17 phar:///opt/buildkit/bin/cv/bin/cv(27): Civi\Cv\Application::main()
#18 /opt/buildkit/bin/cv(14): require('phar:///opt/bui...')
#19 {main}
[is_error] => 1
[error_message] => API error: DB Error: already exists on PaymentProcessorType.create( entity name Stripe)
)
)
```
Expected behaviour
----------------------------------------
No error - or at least a helpful error message.
I think `reconcile()` could just create the missing `Managed` entity but there may be other ramifications of doing that.
Environment information
----------------------------------------
* __CiviCRM:__ _Master_
Comments
----------------------------------------
_Anything else you would like the reviewer to note._https://lab.civicrm.org/dev/core/-/issues/882ACLs don't work on "Tab with table" custom field groups2023-05-31T05:03:19ZJonGoldACLs don't work on "Tab with table" custom field groupsTo replicate on master:
* Create a new role, "Read Only".
* Give the role only the "Access CiviCRM" permission.
* Create a new group "Read Only" of type "Access Control".
* Create a multi-record custom group with display type of "Tab wit...To replicate on master:
* Create a new role, "Read Only".
* Give the role only the "Access CiviCRM" permission.
* Create a new group "Read Only" of type "Access Control".
* Create a multi-record custom group with display type of "Tab with table".
* Create a new user, give them the "Read Only" role and place them in the "Read Only" group.
* Configure an ACL that grants "View" access to one or more contacts. Since "Edit own contact" is a special case, ensure that one of the contacts doesn't belong to the user.
* Configure an ACL that grants "View" access to the multi-record custom group.
Expected result:
* This user shouldn't be able to edit a contact's data.
Actual result:
* This user can edit custom fields that are on a "tab with table".
There's a few things that need fixing, I intend to move at least some of these forward:
* The template doesn't have a permission check on the "Add" button.
* The class doesn't have a permission check on the action links.
* The class doesn't have a permission check on postProcess.
Finally, the "Edit" ACL for custom fields don't seem to be respected - but this is out of scope for this issue.JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/4031Searchkit: Download spreadsheet should use standard date format, not the form...2023-05-29T01:37:04ZlarsssandergreenSearchkit: Download spreadsheet should use standard date format, not the format set in Date FormatsIf you're downloading a CSV or other spreadsheet from Searchkit results or a SK Table, you'll get dates formatted per the Date Display format setting, which by default is `August 9th, 2012 1:17 PM`. That's a format that takes some wrang...If you're downloading a CSV or other spreadsheet from Searchkit results or a SK Table, you'll get dates formatted per the Date Display format setting, which by default is `August 9th, 2012 1:17 PM`. That's a format that takes some wrangling to get Excel or other spreadsheet programs to recognize as a date.
Instead, the date should be exported as it is using export from non-SK results, in standard format `2012-08-09 13:17`.
[Related issue](https://lab.civicrm.org/dev/core/-/issues/3730) on data types in ods or xlsx files.
Tested on dmaster (5.58).https://lab.civicrm.org/dev/core/-/issues/3986FormBuilder: defaults for bulk create2023-05-24T14:05:46Zaydunsaidan.saunders@squiffle.ukFormBuilder: defaults for bulk createOverview
----------------------------------------
Provide a 'defaults' entity for bulk entry
Example use-case
----------------------------------------
1. Create a submission form for Activities
2. On the main Activity1 fieldset, mark it...Overview
----------------------------------------
Provide a 'defaults' entity for bulk entry
Example use-case
----------------------------------------
1. Create a submission form for Activities
2. On the main Activity1 fieldset, mark it as 'Repeat'
3. You can now create a set of activities
4. But ...
Current behaviour
----------------------------------------
All relevant fields need to be completed even if they are repetitive
Proposed behaviour
----------------------------------------
Provide a 'defaults' version of the fieldset where repeated values can be entered.
The normal entries are then combined with the default values before creating the entities.
Note this is different to the 'Values' feature: those are specified by the form designer (eg specifying an activity type)
The defaults are provided by the user filling in the form such as specifying a 'key contact' that is used when creating all the other entities, unless that value is specified.
```
Default entry: Field 1: Field 2: abc
Entry 1: Field 1: Hi 1 Field 2:
Entry 2: Field 1: Hi 2 Field 2:
Entry 3: Field 1: Hi 3 Field 2: def
Entry 4: Field 1: Hi 4 Field 2:
Entry 5: Field 1: Hi 5 Field 2: ghi
```
should create:
```
Entry 1: Field 1: Hi 1 Field 2: abc
Entry 2: Field 1: Hi 2 Field 2: abc
Entry 3: Field 1: Hi 3 Field 2: def
Entry 4: Field 1: Hi 4 Field 2: abc
Entry 5: Field 1: Hi 5 Field 2: ghi
```
Comments
----------------------------------------
_Anything else you would like the reviewer to note._https://lab.civicrm.org/dev/core/-/issues/3931Blank Invoice.pdf appearing when doing Offline contributions2023-05-18T23:35:49ZshaneonabikeBlank Invoice.pdf appearing when doing Offline contributionsHi there,
Recently, my client noticed that Offline contributions made via ```Submit a Credit Card Membership``` were sending out blank Invoice pdfs. I don't think that this was happening previously.
## How to reproduce
1. Go to new me...Hi there,
Recently, my client noticed that Offline contributions made via ```Submit a Credit Card Membership``` were sending out blank Invoice pdfs. I don't think that this was happening previously.
## How to reproduce
1. Go to new member contact record and select "Membership" tab
1. Choose "Submit credit card membership"
1. Enter membership details and select "Save"
1. Receipt is automatically sent to member
## CiviCRM details
+ CiviCRM 5.49.4
+ Drupal 7
## Log Error message
```
2022/10/21 09:48:39 [error] 25282#25282: *7533568 FastCGI sent in stderr: "emplate.php).PHP message: [notice] [php] [209.169.169.221] [uid:1] [https://test.org/civicrm/contact/view/membership] [https://test.org/civicrm/contact/view/membership?reset=1&action=add&cid=107793&context=membership&mode=test] Notice: Undefined variable: html in CRM_Contribute_Form_Task_Invoice::printPDF() (line 516 of /sites/all/modules/civicrm/CRM/Contribute/Form/Task/Invoice.php).
PHP message: [notice] [php] [209.169.169.221] [uid:1] [https://test.org/civicrm/contact/view/membership] [https://test.org/civicrm/contact/view/membership?reset=1&action=add&cid=107793&context=membership&mode=test] Notice: Only variable references should be returned by reference in CRM_Mailing_Event_BAO_Delivered::create() (line 34 of /sites/all/modules/civicrm/CRM/Mailing/Event/BAO/Delivered.php)" while reading response header from upstream, client: 209.169.169.221, server: test.org, request: "POST /civicrm/contact/view/membership HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "test.org", referrer: "https://test.org/civicrm/contact/view/membership?reset=1&action=add&cid=107793&context=membership&mode=test"
```https://lab.civicrm.org/dev/core/-/issues/2049use default membership status rule rather than hard-coded "New"2023-05-10T05:03:26Zlcdwebuse default membership status rule rather than hard-coded "New"In CRM_Contribute_BAO_Contribution::updateMembershipBasedOnCompletionOfContribution() we update the membership status when a linked contribution is completed (the method name says it all...). The code that determines the calculated statu...In CRM_Contribute_BAO_Contribution::updateMembershipBasedOnCompletionOfContribution() we update the membership status when a linked contribution is completed (the method name says it all...). The code that determines the calculated status defaults to a hard coded value of "New". I believe it should instead default to whatever status rule has been flagged as default... since that's kind of the point of having a default flag.
https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/BAO/Contribution.php#L5190
I'd like to add a method "getDefaultStatus()" to CRM_Member_BAO_MembershipStatus to retrieve whichever status rule has been flagged as default. Interestingly, there's a class static "$_defaultMembershipStatus" that as far as I can see is never used. I'll populate that and return the value for some caching love.
Looking for concept approval.lcdweblcdwebhttps://lab.civicrm.org/dev/core/-/issues/2062activity_contact.record_type_id should be required in the database?2023-05-08T05:03:25ZDaveDactivity_contact.record_type_id should be required in the database?Is there a use case where null in this field makes sense?
https://github.com/civicrm/civicrm-core/blob/6777cd9378333d3c4e38e7ce5ae7a396f6fb0a6e/xml/schema/Activity/ActivityContact.xml#L54Is there a use case where null in this field makes sense?
https://github.com/civicrm/civicrm-core/blob/6777cd9378333d3c4e38e7ce5ae7a396f6fb0a6e/xml/schema/Activity/ActivityContact.xml#L54https://lab.civicrm.org/dev/core/-/issues/2064Address inconsistencies on "Cleanup Caches and Reset Paths" page in UI2023-05-07T05:03:25ZJonGoldAddress inconsistencies on "Cleanup Caches and Reset Paths" page in UIThere's a few issues here that are tangentially related:
* "Cleanup Caches" and "Reset Paths" have identical UX - the buttons look the same, there's no additional "are you sure" dialogs on either. However, one is always a harmless opera...There's a few issues here that are tangentially related:
* "Cleanup Caches" and "Reset Paths" have identical UX - the buttons look the same, there's no additional "are you sure" dialogs on either. However, one is always a harmless operation, the other can break your instance. They should NOT have an identical UX. In fact, I think there's an argument that "Reset Paths" shouldn't exist anymore. Folks on Stack Exchange looking to fix their site will clear their cache based on some online advice, then click "Reset Paths" to see if it will help, and now they have two problems.
* "Cleanup Caches" should either a) function identically to `cv flush`, or b) additional operations should be added to this page so that all the actions of `cv flush` are available. I'm particularly thinking of reconciling managed entities.
* I don't think "Rebuild Menus" is part of `cv flush`, but that should also be an option on this page. The current approach for doing so is unfriendly.JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/1897Profile with checkbox custom field fails2023-05-04T05:03:19ZMichael LabriolaProfile with checkbox custom field failsOverview
----------------------------------------
Using profile form generates error message.
Reproduction steps
----------------------------------------
1. Administer->Custom Data and Screens->Custom Fields
2. Add Set of Custom Fields:...Overview
----------------------------------------
Using profile form generates error message.
Reproduction steps
----------------------------------------
1. Administer->Custom Data and Screens->Custom Fields
2. Add Set of Custom Fields: Name = Test, Used For = Contacts, Save
3. Field Label = Test, Data and Input Field Type = Alphanumeric Checkbox, Test 1, Test 2, Save
4. Administer->Custom Data and Screens->Profiles
5. Add Profile: Profile Name = Test, Public Title = Test, Used For = Standalone Form or Directory, Save
6. Field Name = Contacts Test :: Test, Save
7. Administer->Custom Data and Screens->Profiles Test More->Use - Create Mode
Current behaviour
----------------------------------------
Warning: in_array() expects parameter 2 to be array, null given in CRM_Core_BAO_CustomField::setProfileDefaults() (line 1241 of /var/www/mcce_www/public/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php).
Expected behaviour
----------------------------------------
No error message.
Environment information
----------------------------------------
* __Browser: Chrome 84.0.4147.89
* __CiviCRM: Master/5.26.2
* __PHP: 7.3
* __CMS: Drupal 7.72
* __Database: MariaDB 10.3.22
* __Web Server: Apache 2.4
Comments
----------------------------------------
Line 1239 used to use PHP explode and it was changed to CRM_Utils_Array::explodePadded. I don't think PHP explode ever returned NULL, but CRM_Utils_Array::explodePadded does return NULL, which is the problem.https://lab.civicrm.org/dev/core/-/issues/867Expose line item name on search2023-04-30T05:03:21ZmaduraExpose line item name on search## Problem
On Advanced Search and Find Contributions there is currently no field to search for the line items. If an admin wants to be able to search for the contacts or contributions based on line items information there is no other se...## Problem
On Advanced Search and Find Contributions there is currently no field to search for the line items. If an admin wants to be able to search for the contacts or contributions based on line items information there is no other search parameters available.
## Proposed Solution
Introduce the "line item name" field in search.
Technical Steps:
- Add a new field to contribution search form and in postprocess, handle it and add suitable where clauses using existing fields as reference.
- Add a new textfield for line item search in CRM_Contribute_BAO_Query::buildSearchForm()
- In CRM_Contribute_BAO_Query::whereClauseSingle add logic for including condition for line item name.https://lab.civicrm.org/dev/core/-/issues/35avoid template variable leakage when processing more than one recurring contr...2023-04-28T01:39:33Zjamieavoid template variable leakage when processing more than one recurring contribution in a sessionThis bug happens if you have more than one iATS recurring contribution and an earlier contribution is assigned to a soft credit, but one or more later contributions are not assigned to a soft credit.
The later contributions have the sof...This bug happens if you have more than one iATS recurring contribution and an earlier contribution is assigned to a soft credit, but one or more later contributions are not assigned to a soft credit.
The later contributions have the soft credit information inserted into their receipt because the email message template variables are not properly cleared.
iATS processes multiple recurring contributions in a single session via a cron job, so may be uniquely triggering this error (although the bug is with CiviCRM Core).5.3.0https://lab.civicrm.org/dev/core/-/issues/30Exporting master address contact even if no master address contact is defined2023-04-28T01:39:33ZsamuelsovExporting master address contact even if no master address contact is definedExporting "Master address contact" should give the master contact only if there is a master_id defined for this address but currently, if there is no master_id, the first master address id found for this contact is used.
```php
class C...Exporting "Master address contact" should give the master contact only if there is a master_id defined for this address but currently, if there is no master_id, the first master address id found for this contact is used.
```php
class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
...
public static function getMasterDisplayName($masterAddressId = NULL, $contactId = NULL) {
$masterDisplayName = NULL;
$sql = NULL;
if (!$masterAddressId && !$contactId) {
return $masterDisplayName;
}
if ($masterAddressId) {
$sql = "
SELECT display_name from civicrm_contact
LEFT JOIN civicrm_address ON ( civicrm_address.contact_id = civicrm_contact.id )
WHERE civicrm_address.id = " . $masterAddressId;
}
// ==> is there any reason to do that ?
elseif ($contactId) {
$sql = "
SELECT display_name from civicrm_contact cc, civicrm_address add1
LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
WHERE cc.id = add2.contact_id AND add1.contact_id = " . $contactId;
}
$masterDisplayName = CRM_Core_DAO::singleValueQuery($sql);
return $masterDisplayName;
}
```5.3.0https://lab.civicrm.org/dev/core/-/issues/4204Direct Debit agreement is always/never shown depending on which payment proce...2023-04-25T18:46:28ZbgmDirect Debit agreement is always/never shown depending on which payment processor is the defaultTo reproduce:
- Enable the Credit Card dummy processor
- Enable a Direct Debit processor (such as CiviSepa? or iATS)
- Enable both on a Contribution Page
Depending on which Payment Processor is set as the default, that will influence i...To reproduce:
- Enable the Credit Card dummy processor
- Enable a Direct Debit processor (such as CiviSepa? or iATS)
- Enable both on a Contribution Page
Depending on which Payment Processor is set as the default, that will influence if the "direct debit agreement" is displayed on the contribution page. It should only be shown if a Direct Debit payment method was selected.
Screenshots by @Andreas in #4189:
![screenshot1](/uploads/06edccccf03f105e07263906e06ed4a4/screenshot1.png)
![screenshot2](/uploads/97f048b7788ea9672fb4b2584e8d9962/screenshot2.png)
Initially reported by @romy5.61.0https://lab.civicrm.org/dev/core/-/issues/92Prevent deletion of groups which are used as search parameters of Smart Groups2023-04-20T08:59:49ZEvanPrevent deletion of groups which are used as search parameters of Smart GroupsIt seems that a group (static or Smart) being used a search parameter for a Smart Group can be deleted. Best case scenario is the Smart Group just has that many fewer contacts in it and we go on with life. We had an issue on a client sit...It seems that a group (static or Smart) being used a search parameter for a Smart Group can be deleted. Best case scenario is the Smart Group just has that many fewer contacts in it and we go on with life. We had an issue on a client site where there were so many contacts and so many groups, that rebuilding the Smart Group cache was causing a fatal DB error whether it (Updating Smart Group counts) was done manually or via the scheduled job. Proposed approach is to prevent deletion of groups that are dependencies for other groups. Example workflow:
1. A user with permissions to delete groups chooses to delete a group by selecting the "Delete" option from the "More" link on the Manage Groups page located here: Navigation Menu > Contacts > Manage Groups (this is the only place a user can delete a group, I believe)
1. The system (CiviCRM) does a check in the background to determine if the group being deleted is used as a search parameter in any active/non-deleted Smart Groups
1. If the group being deleted is determined to be "in use" by a Smart Group(s), don't allow the group to be deleted. Instead…
1. Show a message in the "Confirm Group Delete" notification that the group cannot be deleted as it's being used by a Smart Group(s). List the name of the Smart Group(s), preferably with the name(s) linked to that/those group(s)
I am inquiring with our client if they are willing to put funds (and how much) into fixing this. I have confirmed on demo master that one can delete a group that is a dependency for another group, though there were no ill effects. My assumption / theory is there just aren't enough contacts or groups for the rebuilding of Smart Group counts to fail.https://lab.civicrm.org/dev/core/-/issues/1975Add pre/post hook for FinancialTrxn2023-04-20T05:03:26ZyashodhaAdd pre/post hook for FinancialTrxnAdd pre/post hook for FinancialTrxn entity.Add pre/post hook for FinancialTrxn entity.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/810Non-primary details exported in primary-only exports, when the setting 'Searc...2023-04-05T05:03:18ZAndrew WestNon-primary details exported in primary-only exports, when the setting 'Search Primary Details Only' is set to 'no'If you run an export with 'Export PRIMARY fields', but you have the setting 'Search Primary Details Only' set to 'No', the primary filter is not applied and you simply get the first available row in the table. This also happens when you ...If you run an export with 'Export PRIMARY fields', but you have the setting 'Search Primary Details Only' set to 'No', the primary filter is not applied and you simply get the first available row in the table. This also happens when you select the 'Primary' option when exporting individual fields.
This definitely applies to postal addresses. I haven't tested emails but I think it'll happen there too.
It happens because of this line in CRM_Contact_BAO_Query:
https://github.com/civicrm/civicrm-core/blob/a2540ad336faf7fb0218055a485c1a702200293f/CRM/Contact/BAO/Query.php#L446
which defaults to using the value from the setting. If this is set to no, the result SQL clause doesn't include 'is_primary = 1'.
CRM_Export_BAO_ExportProcessor creates the Query object here:
https://github.com/civicrm/civicrm-core/blob/a2540ad336faf7fb0218055a485c1a702200293f/CRM/Export/BAO/ExportProcessor.php#L509
but doesn't pass through a value for 'primaryLocationOnly' to override the default setting.
I can presumably adapt the above to pass through primaryLocationOnly when users have selected the 'Export PRIMARY fields' option - that *seems* simple enough. I haven't had a chance to dig into how it works when the export specifies individual fields, though - that seems like it'd be more complicated.
To replicate on demo site:
1. Create a new tmp group
2. Find a contact with an existing primary address
3. Add a new address for them, and set it to primary
4. Add this contact to the tmp group
4. Turn off the setting 'Search Primary Details Only'
5. Search for all members of the tmp group, and export them using 'Export PRIMARY fields only'
6. The contact's address in the CSV will be the original address, which is non-primaryhttps://lab.civicrm.org/dev/core/-/issues/3937Importing "No" values to Boolean field results in empty2023-04-03T02:21:49ZelilisseckImporting "No" values to Boolean field results in emptyOverview
----------------------------------------
Contact imports to custom "Yes or No" fields work with values 1 or 0. "Yes" also appears to work.
If you import a "No" value, however, the field will be blank for that contact instead o...Overview
----------------------------------------
Contact imports to custom "Yes or No" fields work with values 1 or 0. "Yes" also appears to work.
If you import a "No" value, however, the field will be blank for that contact instead of having the "No"/0 label/value.
Technical details
----------------------------------------
["strtoboolstr"](https://github.com/civicrm/civicrm-core/blob/4ce53ba3de860a5d9aac1b1bbd22b7a29e839af2/CRM/Utils/String.php#L424) gets run twice on this data. [Once on the raw value returning a boolean](https://github.com/civicrm/civicrm-core/blob/902fc38d0d6cd9d09ee02f30cc6621747151a06a/CRM/Import/Parser.php#L1602) and [once later in the code here](https://github.com/civicrm/civicrm-core/blob/902fc38d0d6cd9d09ee02f30cc6621747151a06a/CRM/Contact/Import/Parser/Contact.php#L328)
When you run this on a boolean value (you shouldn't, according to the comments, but perhaps we should check for this), "Yes"/true will _look_ like it's working okay because the preg_match will match for (bool)true but it won't match for (bool)false. I'm sure this has something to do with a PHP oddity I know nothing about but related to the fact that `strlen((bool)true)` is `1` and `strlen((bool)false)` is `0`.
Proposed solution is:
1) Don't run strtoboolstr twice. We don't need that second iteration of it because it's already been run on the data. I'm not sure of any other impacts for this so also:
2) Write a test for importing to a Yes/No field with the 6 values that should work (1,0,yes,no,true,false). I've started writing this test following examples but i'm having trouble getting my import data actually in properly to run the assertEquals on. I will open a WIP PR with this test.
Any other thoughts welcome!
Reproduction steps
----------------------------------------
1. Create a custom field with data type "Yes or No"
2. Create a csv to import first,last,custom_fieldID with data for your custom field "Yes" and "No"
3. Run the import normally through the GUI in the Contacts > Import Contacts workflow
4. Observe custom field results on the imported contacts
Expected behaviour
----------------------------------------
According to code comments, this type of field import should accept "1", "0", "Yes", "No", "true", "false" and they should all fill a "Yes or No" field correctly.
Environment information
----------------------------------------
This was reproduced on the master branch in d9 (5.56.alpha1)5.61.0