Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-10-05T15:27:38Zhttps://lab.civicrm.org/dev/core/-/issues/4516Rethinking 20 minutes QF session timeouts2023-10-05T15:27:38ZJonGoldRethinking 20 minutes QF session timeoutsThe 20 minute timeout has been a part of Civi for as long as I can remember. It's also caused lost donations, frustrated applicants, and so on. Reading an [article about why short session timeouts aren't helpful](https://www.sjoerdlang...The 20 minute timeout has been a part of Civi for as long as I can remember. It's also caused lost donations, frustrated applicants, and so on. Reading an [article about why short session timeouts aren't helpful](https://www.sjoerdlangkemper.nl/2023/08/16/session-timeout/) made me think about this for Civi.
* What is the original reason? Is it still valid?
* If we lengthen the timeout, do we need to make special arrangements around event registration when there's a maximum number of seats available?https://lab.civicrm.org/dev/joomla/-/issues/52Cannot have a CiviCRM-link menu as default (home) page2024-03-07T23:14:49Zthoni56Cannot have a CiviCRM-link menu as default (home) pageIn Joomla you declare one menu item to be the default "front page" i.e. the one that you get to when no menu is selected, only the web sites base path.
In J3 this also worked for a menu entry that was a CiviCRM-entry, such as Event List...In Joomla you declare one menu item to be the default "front page" i.e. the one that you get to when no menu is selected, only the web sites base path.
In J3 this also worked for a menu entry that was a CiviCRM-entry, such as Event Listing or Mailing List Subscription. (check e.g. https://events.responsive.se which is a J3 site with Event Listing as the default menu entry.)
With J4 this no longer works. When going to the "home page" the menu item is highlighted to indicate that it is active, but there is no output in the content area.
I tried this with a clean J4 and CiviCRM and see the same thing. The underlined "Subscription" indicates that it is the menu entry that is active.The J4 default template Cassiopeia displays breadcrumbs which strangely enough shows "Home" and not "Subscription" (which is the menu entry for CiviCRM Mailing List Subscription form).
This is extra strange because the breadcrumb for the Home menu entry is actually "Home/Home" so the default page Subscription is something in between...
![image.png](/uploads/e82c3a451f5ed6010968e4d25c17d6a5/image.png)Explicitly clicking the "Subscription" menu entry correctly shows the form.
I don't really know enough about Joomlas routing to understand where the problem really is, but I'm starting by reporting it here.https://lab.civicrm.org/dev/core/-/issues/4515FormBuilder: Can't edit Submit button text in Firefox or Safari2023-08-20T16:39:28ZlarsssandergreenFormBuilder: Can't edit Submit button text in Firefox or SafariThis is a minor issue, but editing the Submit button text does not work (you cannot type any characters) in FormBuilder in Firefox (115 on macOS) or Safari. It does work in Chrome.This is a minor issue, but editing the Submit button text does not work (you cannot type any characters) in FormBuilder in Firefox (115 on macOS) or Safari. It does work in Chrome.https://lab.civicrm.org/dev/core/-/issues/4514AdminUI: Manage ACLs - An ACL mode set to 'Deny' is stored OK but still shows...2023-08-25T08:23:45ZAndy ClarkAdminUI: Manage ACLs - An ACL mode set to 'Deny' is stored OK but still shows on the list of ACLs as 'Allow' (5.64)In 'Manage ACLs' a new mode of 'Allow' or 'Deny' has been added. When you set an ACL to 'Deny' it is correctly stored but in the list of ACLs always shows as 'Allow'.In 'Manage ACLs' a new mode of 'Allow' or 'Deny' has been added. When you set an ACL to 'Deny' it is correctly stored but in the list of ACLs always shows as 'Allow'.seamusleeseamusleehttps://lab.civicrm.org/dev/core/-/issues/4513AdminUI: In 5.64 new basic search shows group names to users who, according t...2024-02-05T21:58:15ZAndy ClarkAdminUI: In 5.64 new basic search shows group names to users who, according to ACLs, don't have access to those groupsThe new basic search ('Find Contacts') in 5.64 that uses SK correctly restricts visibility of contacts for users with access limited by ACLs, but still shows the group names that those users should not be able to see. If the user then se...The new basic search ('Find Contacts') in 5.64 that uses SK correctly restricts visibility of contacts for users with access limited by ACLs, but still shows the group names that those users should not be able to see. If the user then searches those groups, they appear to have zero contacts which is confusing. Users with access limited by ACLs should only be able to see those group names that they have access to. Disabling the AdminUI extension and restoring the old basic search solves the problem - those groups are not then displayed.colemanwcolemanwhttps://lab.civicrm.org/dev/drupal/-/issues/189Epic: Drupal 10 finalization2023-10-30T18:30:20ZtottenEpic: Drupal 10 finalizationThis is a follow-up to #176. Where #176 did the main work of achieving compatibility, this issue is for the final wrap-up to handle Drupal 10 as a publicly visible option.
* [x] Add build types for test/demo infra
* [x] Add public sandb...This is a follow-up to #176. Where #176 did the main work of achieving compatibility, this issue is for the final wrap-up to handle Drupal 10 as a publicly visible option.
* [x] Add build types for test/demo infra
* [x] Add public sandbox on https://civicrm.org/demo (https://d10-master.demo.civicrm.org/)
* [ ] Add to test matrices
* [x] CiviCRM-E2E-Matrix (master)
* [ ] CiviCRM-E2E-Matrix (stable/rc)
* [ ] Fix distinctive test failures on D10
* [x] Concurrent mail tests (https://github.com/civicrm/civicrm-core/pull/27072)
* [ ] Authx tests (*these may be non-blockers since D9 has similar issues -- but we should look again*)
* [ ] Add to `Installation Guide` ([Requirements](https://docs.civicrm.org/installation/en/latest/general/requirements/), [Install on Drupal](https://docs.civicrm.org/installation/en/latest/drupal/))
* [x] Add to https://civicrm.org/downloadhttps://lab.civicrm.org/dev/core/-/issues/4512Profile notify on submit for event registration additional participants only ...2023-08-18T21:15:34ZlarsssandergreenProfile notify on submit for event registration additional participants only works if profile is used for primary participantThis one is a little obscure, but thought I might as well note it.
If you set up an event registration using a profile that sends a notification email on submit and you use that profile for the primary participant and the additional par...This one is a little obscure, but thought I might as well note it.
If you set up an event registration using a profile that sends a notification email on submit and you use that profile for the primary participant and the additional participants, everything works as intended. But if the additional participant profile that has the notification is only used for the additional participant and not the primary participant, then no notification will be sent.
This is because we only build the profile fields and send the notification if [notify is TRUE for customPre or customPost here.](https://github.com/civicrm/civicrm-core/blob/e6b439e4eb032b269fc823a7782cc2d8bb9d8304/CRM/Event/BAO/Event.php#L1077). The notification being sent for the additional participant in the case where the notification profile is used for the primary participant is sort of an unintended side effect and it would be better to handle each profile on the registration form separately.https://lab.civicrm.org/dev/core/-/issues/4511Allow multiple 'Added By' for an activity2023-09-08T20:35:49ZyashodhaAllow multiple 'Added By' for an activityThe way some clients are using the CRM, the 'Added By' person(s) is/are really the person(s) responsible for making the activity happen, and the 'Assigned To' are people that participate in the activity but are not directly responsible f...The way some clients are using the CRM, the 'Added By' person(s) is/are really the person(s) responsible for making the activity happen, and the 'Assigned To' are people that participate in the activity but are not directly responsible for it.
The issues is that the CRM only allows ONE Added By, so they rely on some custom contact reference fields 'Partnered With' to supplement the Added By. But this is not a good solution and has many limitations e,g not being able to see the activity in Partner tab etc.
Therefore the best way to move forward is to allow multiple 'Added By' for an activity. The database schema already allows for that with the _activity_contact_ table.
From technical perspective, I reckon it was an oversight to not allow multiple contacts for Contact Source as we had moved civicrm_activity.source_contact_id (single), civicrm_activity_target.contact_id, civicrm_activity_assignee.contact_id (dropped civicrm_activity_target/civicrm_activity_assignee tables) in favor of civicrm_activity_contact table.
Screens that need to be modified:
- Activity tab in the Contact screen
- Activity View screen
- Activity Edit screen
- Activities reports
- Activities resultyashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4510Report results for custom date fields does NOT respect the date format2023-08-24T13:44:13ZyashodhaReport results for custom date fields does NOT respect the date formatSteps to replicate :
--------------------
- Create a custom date field of type _Date_ and date format _yy_
![Screenshot_from_2023-08-18_18-44-03](/uploads/8033862dfeb99ff818d5fb0a58797e7b/Screenshot_from_2023-08-18_18-44-03.png)
- ...Steps to replicate :
--------------------
- Create a custom date field of type _Date_ and date format _yy_
![Screenshot_from_2023-08-18_18-44-03](/uploads/8033862dfeb99ff818d5fb0a58797e7b/Screenshot_from_2023-08-18_18-44-03.png)
- Data shows as correctly on summary screen
![Screenshot_from_2023-08-18_18-45-53](/uploads/8a835e7bf893609014a12e55e977950f/Screenshot_from_2023-08-18_18-45-53.png)
- Report results do NOT respect the format
![Screenshot_from_2023-08-18_18-46-54](/uploads/b4bf0be27d8fc889e3efb93a24206c33/Screenshot_from_2023-08-18_18-46-54.png)
All custom data of type date should have respective Date format respected like on the other screens.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4509Search Kit - Links conditional doesn't work with domain_id or domain = curren...2023-08-20T01:19:29ZseamusleeSearch Kit - Links conditional doesn't work with domain_id or domain = current domainWhen creating a menu of links if you have a conditional based on domain_id = current_domain or domain = current_domain the links just get removed because the conditional fails all the timeWhen creating a menu of links if you have a conditional based on domain_id = current_domain or domain = current_domain the links just get removed because the conditional fails all the time5.66.0https://lab.civicrm.org/dev/core/-/issues/4508CiviMail Auto complete includes unsent mailings2023-08-24T13:43:34ZseamusleeCiviMail Auto complete includes unsent mailingsAs reported by Jon Goldberg it seems the current CiviMail Recipients Auto complete includes unsent mailings https://github.com/civicrm/civicrm-core/pull/27071#issuecomment-1682481080As reported by Jon Goldberg it seems the current CiviMail Recipients Auto complete includes unsent mailings https://github.com/civicrm/civicrm-core/pull/27071#issuecomment-1682481080https://lab.civicrm.org/dev/core/-/issues/4507ctrl.recipients[entityType] is undefined2023-12-20T16:55:15ZStoobctrl.recipients[entityType] is undefinedUpon upgrade to 5.64.0 the Recipients box in CiviMail new mailing (or continue draft) stopped working with this error in js console.
```
TypeError: $element.crmAutocomplete is not a function
Angular 30
jQuery 7
api3 crm.aja...Upon upgrade to 5.64.0 the Recipients box in CiviMail new mailing (or continue draft) stopped working with this error in js console.
```
TypeError: $element.crmAutocomplete is not a function
Angular 30
jQuery 7
api3 crm.ajax.js:120
Angular 14
```
We were using Mosiaco 2.1. Upgrading to 3.2.1691060437 didn't fix the issue.
This bug it affects Traditional and Mosaico mailings equally _**even with Mosaico extension disabled completely**_. So I think the problem is part of CiviMail itself. We are using Drupal 9.5.10, if that matters, and Civi seems functional otherwise.
![recipients1](/uploads/79862d01942c2d7a9edd83423e8ab7c7/recipients1.png)
![recipients2](/uploads/153d826994e70023eb234b3f83716beb/recipients2.png)https://lab.civicrm.org/dev/core/-/issues/4506Composer errors when applying patches2023-08-18T02:07:11ZvrappComposer errors when applying patchesWhen installing a new site with:
**LAMP:**
[res@svr ~]$ cat /proc/version
Linux version 3.10.0-1160.88.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Mar 7 15:41:52 UTC...When installing a new site with:
**LAMP:**
[res@svr ~]$ cat /proc/version
Linux version 3.10.0-1160.88.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Mar 7 15:41:52 UTC 2023
PHP:
PHP Version 8.1.21
Directive Local Value Master Value
allow_url_fopen On On
allow_url_include Off Off
[res@svr ~]$ mysql -V
mysql Ver 14.14 Distrib 5.7.43, for Linux (x86_64) using EditLine wrapper
**Drupal:**
[res@svr d9]$ composer create-project drupal/recommended-project:9.5.1 "../public_html/d9"
…..
Congratulations, you’ve installed the Drupal codebase
from the drupal/recommended-project template!
**CiviCRM:**
Using Composer, all clean until CiviCRM install:
[res@svr d9]$ composer clearcache
Cache directory does not exist (cache-vcs-dir):
Cache directory does not exist (cache-repo-dir):
Cache directory does not exist (cache-files-dir):
Clearing cache (cache-dir): ./.cache/composer
All caches cleared.
[res@svr d9]$ composer config extra.enable-patching true
[res@svr d9]$ composer config minimum-stability dev
[res@svr d9]$ composer require civicrm/civicrm-{core,packages,drupal-8}:'5.64.x-dev'
**getting 12 errors like the 2 examples below:**
1) - Applying patches for adrienrn/php-mimetyper
```
https://patch-diff.githubusercontent.com/raw/adrienrn/php-mimetyper/pull/15.patch (Update gitignore to ensure that sites that manage via git don't miss out on the important db.json file)
Could not apply patch! Skipping. The error was: The "https://patch-diff.githubusercontent.com/raw/adrienrn/php-mimetyper/pull/15.patch" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0
failed to open stream: no suitable wrapper could be found)
```
2) - Applying patches for zetacomponents/mail
```
https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch (CiviCRM Custom Patches for ZetaCompoents mail)
Could not apply patch! Skipping. The error was: The "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0
failed to open stream: no suitable wrapper could be found)
```
We have checked and rechecked the **allow_url_fopen** and can be seen from the php.ini and the reported php parameters, this setting is **On**.
**php.ini:**
allow_url_fopen = On
display_errors = Off
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 64M
post_max_size = 8M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php81"
upload_max_filesize = 2M
zlib.output_compression = Off
I would like to have a clean composer based install for this new site so we can avoid sins of the past sites which were not maintained
via composer. I am not very familiar with composer but if there are things I can do to debug and provide feedback to the code base, I am happy to help.
Thankshttps://lab.civicrm.org/dev/core/-/issues/4505Localisation: Report contribution_details doesn't respect date format settings2023-08-17T14:24:07ZDetlev SieberLocalisation: Report contribution_details doesn't respect date format settings## Overview
_see_ #4503 for similar issue
## Reproduction steps
1. Set localization settings **date format** to "%d.%m.%Y %H:%M" / "%d.%m.%Y"
2. Click on **Reports -\> Contribution Detail**
3. Click on "Refresh results" and/or downloa...## Overview
_see_ #4503 for similar issue
## Reproduction steps
1. Set localization settings **date format** to "%d.%m.%Y %H:%M" / "%d.%m.%Y"
2. Click on **Reports -\> Contribution Detail**
3. Click on "Refresh results" and/or download pdf
## Current behaviour
For the header, the localisation settings are interpreted correctly.
For the report lines, the date format don't respect the localisation settings.
See screenshot:
![contribution details date format.png](/uploads/453ea5f2249edac6e89ff322862c7a8d/contribution_details_date_format.png)
## Expected behaviour
All dates should be displayed in the selected localisation format.
##https://lab.civicrm.org/dev/core/-/issues/4504Create new campaign "on the fly" when entering new contribution: custom field...2023-09-18T15:18:01ZDetlev SieberCreate new campaign "on the fly" when entering new contribution: custom fields are not supported## Overview
When I enter a new contribution as a CiviCRM Admin user, I can select a campaign - and, when the campaign is not found, I can add a new campaign.
However, the pop up screen for entering the new campaign does not include cam...## Overview
When I enter a new contribution as a CiviCRM Admin user, I can select a campaign - and, when the campaign is not found, I can add a new campaign.
However, the pop up screen for entering the new campaign does not include campaign custom fields - what makes this feature in certain use cases dysfunctional.
## Current behaviour
1. Create a custom field for a campaign.
2. Click on Campaigns -\> New Campaign: As you see on the screenshot, you can enter something in that custom field
![grafik.png](/uploads/82dd2d0b7dcf927ddef04e6cc6a60564/grafik.png)
3. Now, click on **Contributions -\> New Contributions**
4. Click on Campaigns and (1) enter some non-existent value. Now, you can click on "+" to enter a new campaign (2)
![grafik.png](/uploads/8aaf3446170f02b6fe7a0d9af8177431/grafik.png)
5. After Click on **New Campaign** a pop up opens where you can enter a new campaign - but here, the campaign's custom field is missing:
![grafik.png](/uploads/44069feb22709c809764a1db80d5d919/grafik.png)
## Proposed behaviour
It should be possible to access the custom fields in the same way as with **Campaign -\> New Campaign**
_What should happen? How is this better? If appropriate/available, include any wireframes or mockups._
##https://lab.civicrm.org/dev/core/-/issues/4503Localization: Report contribution_details doesn't respect money settings for ...2023-08-17T14:22:38ZDetlev SieberLocalization: Report contribution_details doesn't respect money settings for additional fields## Reproduction steps
1. Set localization settings: **decimal separator** to `,` and **thousand separator** to `.`
2. Click on **Reports -\> Contribution Detail**
3. Select Non-deductible Amount, Fee Amount, Net Amount, Soft Credit Amou...## Reproduction steps
1. Set localization settings: **decimal separator** to `,` and **thousand separator** to `.`
2. Click on **Reports -\> Contribution Detail**
3. Select Non-deductible Amount, Fee Amount, Net Amount, Soft Credit Amount
4. Click on "Refresh results"
## Current behaviour
For the contribution amount, the localisation settings are interpreted correctly.
The other amounts don't respect the localisation settings.
See screenshot:
![2023-08-16_21-13.png](/uploads/ea63065ddba5bb00ce85c2cd77074cae/2023-08-16_21-13.png)
## Expected behaviour
All amounts should be displayed in the selected localisation format.https://lab.civicrm.org/dev/core/-/issues/4502SearchKit should provide special options - here: get financial_account inform...2023-08-17T17:44:46ZDetlev SieberSearchKit should provide special options - here: get financial_account information for payment_instrument## Overview
I am working on a replacement for the report "Bookkeeping Transactions", based on SearchKit.
A similar thing I had done years ago by customizing this core report - but that customizing doesn't work anymore with current Civi...## Overview
I am working on a replacement for the report "Bookkeeping Transactions", based on SearchKit.
A similar thing I had done years ago by customizing this core report - but that customizing doesn't work anymore with current CiviCRM versions and I thought it were a smart idea to refactor that using SearchKit.
Unfortunately, it is very hard (if not impossible) to get this some information into this report:
## Current behaviour
1) I did not succeed at all in exporting financial transactions. So I decided, as a workaround, to use line times instead (which is sufficient in my current use case, but is not sufficient for a replacement of the report "Bookkeeping Transactions".
2) Still, I was not able to get information on the accounting_code of the payment_instrument (or any other data from the financial_account table)
## Proposed behaviour
It would be nice to have a simple way to achieve the accounting_code for a payment_instrument.
## Comments
As a workaround, until there is a fix, I used the description field of the payment method to record the accounting code to "rewrite" the field in the display - this might help until a better fix.
`{"[LineItem_Contribution_contribution_id_01.payment_instrument_id:description]"}`https://lab.civicrm.org/dev/core/-/issues/4501Redis performance issue on delete contact2023-09-23T05:08:34ZeileenRedis performance issue on delete contactWe have a process where we merge contacts and then delete the deleted contacts after a period of time.
However, we have more or less never run the delete deleted contacts script because it is too slow. I dug into it today and found that...We have a process where we merge contacts and then delete the deleted contacts after a period of time.
However, we have more or less never run the delete deleted contacts script because it is too slow. I dug into it today and found that
- on staging it takes 15 seconds to delete 500 contacts
- on production it takes 6-10 minutes to delete 500 contacts
I've spent most of the day digging into why & determined that the queries run are identical & timings are similary. However, on production each time this line of code runs ` Civi::service('prevnext')->deleteItem($id);` it takes a bit over 1 second. This is not the case on staging because there are no users populating the prevnext cache with searches. Hence I have diagnosed that the problem is having users & the solution is to lock their accounts.
More specifically the issue is that the code is going through all the Redis keys to remove the contact - which seems to be inefficient.
![image](/uploads/701ae2d41d47d0eae49ee118f80d4dc4/image.png)
I did wonder if a quick-fix would be to only call `deleteItem` if the contact is not already deleted (which they are in our use case) - I would need to change [the find to fetch here](https://github.com/civicrm/civicrm-core/blob/aef17937a6d1bf00d2ca446bf3c5fc81644b3b92/CRM/Contact/BAO/Contact.php#L907-L911) I think...
Alternatively there is probably some option around queuing the cache clear to happen at the end. However, I think that 1 second + delay is actually not great for users either - e.g when deduping a bunch of contacts than having each form submit take that bit longer would add up.
We are on the cusp of getting `coworker` going so pushing something to a queue to clear out caches might be an option.https://lab.civicrm.org/dev/core/-/issues/4500Ongoing duplicate contact creation if mismatch in civicrm_uf_match2024-01-24T21:04:46ZAllenShawOngoing duplicate contact creation if mismatch in civicrm_uf_match(I've only seen this on WordPress, but the relevant file is in core, so I'm filing under dev/core).
**Summary:**
Under certain circumstances involving "crossed wires" in the `civicrm_uf_match` table, a logged-in user's mere activity in...(I've only seen this on WordPress, but the relevant file is in core, so I'm filing under dev/core).
**Summary:**
Under certain circumstances involving "crossed wires" in the `civicrm_uf_match` table, a logged-in user's mere activity in CiviCRM will create a new contact (containing only the user's email address) for each CiviCRM page load (or ajax call, etc.). Left un-checked, this can lead to thousands of duplicate contacts containing only an identical email address.
**Scope of impact:**
I've seen this on a handful of WordPress sites over the past 5-7 years. I've not heard others in the community mention it, nor seen an existing issue on l.c.o.
**Example steps to reproduce:**
This is only one example; there are surely other steps that will get us there. See "Requisite data conditions" below.
These steps are for repro under WordPress. I haven't tried this under other CMSs.
1. Create WP user _a_ with email address _a@example.com_. Observe this creates a corresponding civicrm contact; we'll call this contact C1. Observe that the entry in `civicrm_uf_match` is correct (i.e. Summary tab for contact C1 shows the user ID of user _a_).
2. Change the email address for user _a_ to _a2@example.com_. Observe that the `civicrm_uf_match` link is preserved (but also that the email address in `civicrm_uf_match.uf_name` is unchanged).
3. Delete contact C1 (permanently or to trash). Observe entry in `civicrm_uf_match` is deleted, and user _a_ still exists.
4. Create a new contact (which we'll call C2) with another email address, e.g. _aFoo@example.com_.
5. Use CiviCRM's "Create User Record" feature to create a new WP user for contact C2; specify any username you like, but we'll assume username _a2_. Observe that the entry in `civicrm_uf_match` is correct (i.e. Summary tab for contact C2 shows the user ID of user _a2_), and that user _a2_ has email address _aFoo@example.com_.
6. Change contact C2's email address to _a2@example.com_. Observe that the email address in `civicrm_uf_match.uf_name` is updated, and the emmail address for WP user _a2_ is unchanged.
At this point, you'll have this state of data:
| wp_users.ID* | wp_users.user_login | civicrm_uf_match.id* | civicrm_uf_match.contact_id* | civicrm contact primary email | civicrm_uf_match.uf_name | wp_users.user_email |
|-------------|---------------------|---------------------|-----------------------------|-------------------------------|--------------------------|---------------------|
| 64 | a | NULL | NULL | NULL | NULL | a2@example.com |
| 65 | a2 | 162 | 75512 | a2@example.com | a2@example.com | aFoo@example.com |
_\* IDs in this table are from my real data; yours will differ of course._
7. As for permissions, I granted user _a_ the WP Administrator role, which has _Administer CiviCRM_; you could probably repro with narrower permissions.
8. Log in as user _a_. Perform a CiviCRM search for contacts having email address _a2@example.com_. Observe the result count N.
9. **Bad Behavior:** Do just about anything in CiviCRM. For example, refresh the search just performed. Observe the result count is >N.
10. Repeat step 9 and observe the increasing number of contacts with email address _a2@example.com_.
**Requisite data conditions**:
As mentioned above, there are probably many possible repro recipes, but the key is to arrive at this requisite state of data:
Given a specific WP user e.g. username _a_, email address _a2@example.com_, new contacts are created containing only this email address, each time this logged-in user takes any action (or presumably almost any action) in CiviCRM, as long as:
1. The WP user ID is not represented in `civicrm_uf_match.uf_id`; and
2. The WP user email (_a2@example.com_) is associated with one or more CiviCRM contacts; in a list of these contacts, sorted by `is_primary DESC, contact_id`, the first contact in that list is represented in `civicrm_uf_match.contact_id`; and
3. The WP user email (_a2@example.com_) is represented in `civicrm_uf_match.uf_name`.
**Relevant code:**
This all seems to be primarily handled by `CRM_Core_DAO_UFMatch::synchronizeUFMatch()`. The above "requisite data conditions" are a summary of the logical path in that method that leads to the stated problem.
Interestingly, the code seems to be aware of this problem, as in [line 284](https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/BAO/UFMatch.php#L284) it defines a variable `$msg` which would read along the lines of (using values from my data-state above) "Contact ID 162 is a match for WordPress user 64 but has already been matched to 65" -- but that message is never used or logged anywhere.
**Workarounds:**
My simplest fix has been simply to update civicrm_uf_match via SQL to link the right user with the right contact, like so (again using values from my real data above): `update civicrm_uf_match set uf_id = 64 where contact_id = 75512;`. And then of course to remove all of the duplicate contacts.
I thought _Synchronize Users to Contacts_ might do the trick, but it has no affect on the relevant data, and the bad behavior persists.
(Joinery reference: F#1180, F#1339)https://lab.civicrm.org/dev/core/-/issues/4499Undefined array key 0 when sending offline event receipt2023-10-13T01:01:38ZDaveDUndefined array key 0 when sending offline event receiptIt seems to be $lineItem[0] at https://github.com/civicrm/civicrm-core/blob/44efaf52507df2445908e02c30caef62ada0100a/CRM/Event/Form/Participant.php#L1353. It looks like it might not always be defined if editing an existing participant. B...It seems to be $lineItem[0] at https://github.com/civicrm/civicrm-core/blob/44efaf52507df2445908e02c30caef62ada0100a/CRM/Event/Form/Participant.php#L1353. It looks like it might not always be defined if editing an existing participant. But it's also confusing because it looks like sometimes it will be 0 and sometimes the array is keyed on price set id.