CiviCRM Core issueshttps://lab.civicrm.org/dev/core/-/issues2018-05-21T12:01:59Zhttps://lab.civicrm.org/dev/core/-/issues/126Soft Credit report redirect to Contribution Detail report doesn't filter cont...2018-05-21T12:01:59ZjrolfsSoft Credit report redirect to Contribution Detail report doesn't filter contact idIt looks like the names in the Soft Credit report no longer redirect to a Contribution Detail report that filters the results based on the contact's id. The same error occurs on dmaster.demo.civicrm.org.
![Snap_2018-05-17_at_16.53.45](/...It looks like the names in the Soft Credit report no longer redirect to a Contribution Detail report that filters the results based on the contact's id. The same error occurs on dmaster.demo.civicrm.org.
![Snap_2018-05-17_at_16.53.45](/uploads/229b8d3c6a85a76130928875c2616d94/Snap_2018-05-17_at_16.53.45.jpg)5.3.0https://lab.civicrm.org/dev/core/-/issues/84Error when searching for Participants2018-04-28T07:22:36ZPradeep Nayakpradpnayak@gmail.comError when searching for Participantshttps://civicrm.stackexchange.com/questions/24671/error-when-searching-for-participants
It seems that there is regression because of https://github.com/civicrm/civicrm-core/pull/11706
Commenting line 4912(self::getGroupByFromOrderBy($g...https://civicrm.stackexchange.com/questions/24671/error-when-searching-for-participants
It seems that there is regression because of https://github.com/civicrm/civicrm-core/pull/11706
Commenting line 4912(self::getGroupByFromOrderBy($groupBy, $orderBys);) in CRM/Contact/BAO/Query.php seems to fix the issue.https://lab.civicrm.org/dev/core/-/issues/4556"Check number" field isn't shown on Pending check payments (workaround exists)2023-12-12T19:08:26ZAllenShaw"Check number" field isn't shown on Pending check payments (workaround exists)(Similar to behavior described in https://lab.civicrm.org/dev/core/-/issues/60)
**One way to repro this on dmaster.demo.civicrm.org:**
1. Log in and navigate to any contact record.
2. Create and save a contribution with these attributes...(Similar to behavior described in https://lab.civicrm.org/dev/core/-/issues/60)
**One way to repro this on dmaster.demo.civicrm.org:**
1. Log in and navigate to any contact record.
2. Create and save a contribution with these attributes:
- Status: Pending
- Payment method: Check
3. Observe this contribution is displayed in the contact's Contributions tab.
4. Open the contribution for viewing, and select the "Record Payment" link or button; this opens the New Payment form.
5. In the New Payment form, observe that the Payment Method is pre-selected as "Check".
6. Observe expected vs actual (bad) behavior:
- Expected behavior: Because the Payment Method is "Check", the field "Check Number" should be displayed for data entry
- **Actual (bad) behavior:** "Check Number" field is not displayed.
**Workaround:**
Continuing from Step 6 above: Change the Payment Method to anything other than "Check", then change it back to "Check". Observe that the "Check Number" field is now available for data entry.
Screencap of problem and workaround from dmaster.demo.civicrm.org today:
![anim](/uploads/f951056d3c2c0c91aaff0d6f17a8b1b4/anim.gif)
(Joinery reference: F#1220)https://lab.civicrm.org/dev/core/-/issues/4484Feature request: New contact buttons on the API 4 autocomplete widget2023-11-01T18:20:41ZbrienneFeature request: New contact buttons on the API 4 autocomplete widgetOverview
----------------------------------------
For using the APIv4 autocomplete widget, such as for the *Existing Contact* field, it would be useful to be able to create new contacts, as is possible with the Select2 drop downs, such a...Overview
----------------------------------------
For using the APIv4 autocomplete widget, such as for the *Existing Contact* field, it would be useful to be able to create new contacts, as is possible with the Select2 drop downs, such as for selecting a Contributor on a backend contribution.
![Selection_015](/uploads/30fc0ecdd3268ebc5906ce0aa06dae9a/Selection_015.png)
Example use-case
----------------------------------------
1. Add the *Existing Contact* field to a FormBuilder form
1. A user can look up a contact to select, but if there are no results/a new one is needed, they can click a **New Individual** button to add one without being redirected from the original form
Current behaviour
----------------------------------------
The APIv4 autocomplete widget does not allow for creating new contacts.
![Selection_014](/uploads/d97659f7dddfd4858bd316acb0dda2b6/Selection_014.png)
Proposed behaviour
----------------------------------------
The APIv4 autocomplete widget should have feature parity when it comes to creating new contacts on the spot as the Select2 optionhttps://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/4149User editable Message Templates, the Contact Action: Send an Email and the Co...2023-03-29T21:09:22Zjustinfreeman (Agileware)User editable Message Templates, the Contact Action: Send an Email and the Contact Action: Print Merge/Document cannot use any Smarty Tokens with the crmDate function because CKEditor 4 unnecessarily HTML encodes single quotes (') and double quotes (")User editable Message Templates, the Contact Action: Send an Email and the Contact Action: Print Merge/Document cannot use any Smarty Tokens with the crmDate function because CKEditor 4 unnecessarily HTML encodes single quotes (') and do...User editable Message Templates, the Contact Action: Send an Email and the Contact Action: Print Merge/Document cannot use any Smarty Tokens with the crmDate function because CKEditor 4 unnecessarily HTML encodes single quotes (') and double quotes (").
So if you use a Smarty Token like:
```{contribution.receive_date|crmDate:"%E%f %B %Y"}```
```{contribution.receive_date|crmDate:'%E%f %B %Y'}```
When CKEditor 4 parses the HTML it converts this into:
```{contribution.receive_date|crmDate:"%E%f %B %Y"}```
```{contribution.receive_date|crmDate:'%E%f %B %Y'}```
Effectively rendering the crmDate function unusable in these situations.
Using CKEditor 5 does solve this specific problem, however CKEditor 5 introduces new problems such as the inability for users to resize images, loss of some formatting controls and importantly prevents the ability to view/edit the source HTML.
Agileware Ref: CIVICRM-21035.61.0https://lab.civicrm.org/dev/core/-/issues/4097CRM_Utils_Number::formatLocaleNumeric() method throws fatal error with empty ...2023-01-30T21:07:08ZbenmoreassyntCRM_Utils_Number::formatLocaleNumeric() method throws fatal error with empty string parameter.Overview
----------------------------------------
CRM_Utils_Number::formatLocaleNumeric() method throws fatal error due to string parameter.
Reproduction steps
----------------------------------------
1. Generate a report that uses cust...Overview
----------------------------------------
CRM_Utils_Number::formatLocaleNumeric() method throws fatal error due to string parameter.
Reproduction steps
----------------------------------------
1. Generate a report that uses custom fields with numeric values. In my case the custom fields were storing simple integer counts of family members.
1. The following fatal error is thrown: "Fatal error: Uncaught Error: NumberFormatter::format(): Argument #1 ($num) must be of type int|float, string given
in /path/to/civicrm/civicrm/CRM/Utils/Number.php on line 123"
Current behaviour
----------------------------------------
Fatal error is thrown. Error affects multiple reports. Full output follows.
```
Fatal error: Uncaught Error: NumberFormatter::format(): Argument #1 ($num) must be of type int|float, string given
in /path/to/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/Number.php on line 123
Call stack:
NumberFormatter::format()
wp-content/plugins/civicrm/civicrm/CRM/Utils/Number.php:123
CRM_Utils_Number::formatLocaleNumeric()
wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomField.php:1282
CRM_Core_BAO_CustomField::formatDisplayValue()
wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomField.php:1116
CRM_Core_BAO_CustomField::displayValue()
wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php:2388
CRM_Report_Form::alterCustomDataDisplay()
wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php:3293
CRM_Report_Form::sectionTotals()
wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php:2578
CRM_Report_Form::formatDisplay()
wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contact/Summary.php:154
CRM_Report_Form_Contact_Summary::postProcess()
wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php:956
CRM_Report_Form::preProcess()
wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contact/Summary.php:125
CRM_Report_Form_Contact_Summary::preProcess()
wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:668
CRM_Core_Form::buildForm()
wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php:76
CRM_Core_QuickForm_Action_Display::perform()
wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203
HTML_QuickForm_Controller::handle()
wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php:103
HTML_QuickForm_Page::handle()
wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:355
CRM_Core_Controller::run()
wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php:98
CRM_Utils_Wrapper::run()
wp-content/plugins/civicrm/civicrm/CRM/Report/Page/Instance.php:74
CRM_Report_Page_Instance::run()
wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319
CRM_Core_Invoke::runItem()
wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69
CRM_Core_Invoke::_invoke()
wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36
CRM_Core_Invoke::invoke()
wp-content/plugins/civicrm/civicrm.php:1199
CiviCRM_For_WordPress::invoke()
wp-includes/class-wp-hook.php:308
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:332
WP_Hook::do_action()
wp-includes/plugin.php:517
do_action()
wp-admin/admin.php:259
```
Expected behaviour
----------------------------------------
A CiviCRM report of custom fields and data should be shown.
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. -->
* __CiviCRM:__ 5.57.1
* __PHP:__ reproduced in 8.1 and 8.0
* __CMS:__ WordPress 6.6.1
* __Database:__ reproduced in MySQL 5.7 and MySQL 8.0
* __Web Server:__ Apache 2.4
Comments
----------------------------------------
Possible fix (submitted via pull request):
CRM/Utils/Number.php Insert the following after line 122.
```php
if ((int) $amount == $amount) {
$amount = intval($amount);
} else {
$amount = floatval($amount);
}
```5.59.0https://lab.civicrm.org/dev/core/-/issues/4096Proposal - change title for all `is_primary` fields to 'Is Primary'2023-02-06T03:57:46ZeileenProposal - change title for all `is_primary` fields to 'Is Primary'I just got REALLY confused trying to import to `Primary Email` - which turns out to be the `is_primary` field - I think we should maybe change to `Is Primary` - @colemanw ?I just got REALLY confused trying to import to `Primary Email` - which turns out to be the `is_primary` field - I think we should maybe change to `Is Primary` - @colemanw ?5.59.0https://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/4081API v.3 Event.create used for update will change Event Template to ordinary E...2023-01-16T15:26:05Zniels_erik_andersenAPI v.3 Event.create used for update will change Event Template to ordinary EventWhen API v.3 Event.create is used for update event template, it will set is_template to false so that the template is changed to an ordinary event.
To reproduce:
cv api Event.create id=nnn template_title="New Title"
Where nnn is id for...When API v.3 Event.create is used for update event template, it will set is_template to false so that the template is changed to an ordinary event.
To reproduce:
cv api Event.create id=nnn template_title="New Title"
Where nnn is id for Event Template
To fix:
In
CRM_Event_BAO_Event::create(&$params) {
$transaction = new CRM_Core_Transaction();
if (empty($params['is_template'])) {
$params['is_template'] = 0;
}
Change
if (empty($params['is_template'])) {
to:
if (empty($params['id']) && empty($params['is_template'])) {5.59.0https://lab.civicrm.org/dev/core/-/issues/4076Split up CRM_Utils_System_Base::theme2023-02-14T01:13:59ZherbdoolSplit up CRM_Utils_System_Base::themeSplit up this method into the different classes so it's specific per CMS.Split up this method into the different classes so it's specific per CMS.https://lab.civicrm.org/dev/core/-/issues/4070FlexMailer: Default Return Path not respected2023-02-27T13:47:09ZJonGoldFlexMailer: Default Return Path not respectedIn **Administer » CiviMail » Mail Accounts**, you can specify a default return path for your CiviMail mailings. This is important when, for instance, your bounce address's mailhost does not support VERP. This forces the `Return-Path` h...In **Administer » CiviMail » Mail Accounts**, you can specify a default return path for your CiviMail mailings. This is important when, for instance, your bounce address's mailhost does not support VERP. This forces the `Return-Path` header to a specific email address. The bounce processing code will find the `X-CiviMail-Bounce` header and process that instead of the bounce address.
However, this functionality was not ported to Flexmailer. You can see it at the very top of `CRM_Utils_Mail::send()` but not in `Civi\FlexMailer\Listener\BounceTracker::onCompose()`.
This causes the return-path to have the VERP address.JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/4068Running a Contact Summary report as a limited access user granted gives DB Er...2023-03-18T05:12:26ZtiminaustRunning a Contact Summary report as a limited access user granted gives DB Error: no such fieldOverview
----------------------------------------
Running a report as a limited access user based on a group that has ACL permissions granted gives ...
```
Sorry, due to an error, we are unable (etc)... DB Error: no such field
```
My par...Overview
----------------------------------------
Running a report as a limited access user based on a group that has ACL permissions granted gives ...
```
Sorry, due to an error, we are unable (etc)... DB Error: no such field
```
My particular use case was a Contact Summary report based on a smartgroup being run by a locked-down user who has acl access to that group (ie not all groups).
Reproduction steps (simplified from my actual use case).
----------------------------------------
1. Create a smart-group and set up ACL for a specific user that doesn't have global access to all contacts/groups.
2. Login as that user, create the report, select a couple of fields AND the smart-group.
3. Attempt to run the report.
Current behaviour
----------------------------------------
Report fails with DB Error: no such field as limited access user, but runs fine for full access user.
The following SQL was generated for the limited access user ...
```
SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name AS civicrm_contact_sort_name,
contact_civireport.id AS civicrm_contact_id,
email_civireport.email AS civicrm_email_email,
(address_civireport.street_number % 2) AS civicrm_address_address_odd_street_number,
address_civireport.postal_code AS civicrm_address_address_postal_code
FROM civicrm_contact contact_civireport
LEFT JOIN civicrm_address address_civireport ON
(contact_civireport.id = address_civireport.contact_id)
AND address_civireport.is_primary = 1
LEFT JOIN civicrm_email email_civireport ON
contact_civireport.id = email_civireport.contact_id
AND email_civireport.is_primary = 1
WHERE ((contact_civireport.contact_type IN ('Individual')))
AND contact_civireport.id IN
(SELECT DISTINCT cgroup_civireport.contact_id
FROM civicrm_group_contact cgroup_civireport
WHERE cgroup_civireport.group_id IN (11)
AND cgroup_civireport.status = 'Added'
UNION DISTINCT SELECT DISTINCT smartgroup_contact.contact_id
FROM civicrm_group_contact_cache smartgroup_contact
WHERE smartgroup_contact.group_id IN (11) )
AND (`contact_civireport`.`id` IS NULL
OR (`contact_civireport`.`id` IN
(SELECT contact_id FROM civicrm_acl_contact_cache WHERE user_id = 6)))
AND (`contact_civireport`.`is_deleted` IS NULL
OR (`contact_civireport`.`is_deleted` != 1))
AND (`cgroup_civireport`.`id` IS NULL
OR (`cgroup_civireport`.`id` IN (3, 7, 9, 11)))
ORDER BY contact_civireport.sort_name ASC
LIMIT 0, 50
```
The error is caused by the last where clause which is generated from buildPermissionClause(), which is trying to access 'contact_civireport' that only exists in the nested where/filter subquery.
The last 3 where clauses are not present for the full access user (ie buildPermissionsClause() return empty string).
Expected behaviour
----------------------------------------
The report should run correctly without the last where clause for limited access use.
Environment information
----------------------------------------
* __Browser: Firefox 108
* __CiviCRM: 5.57.0
* __PHP: 8.1
* __CMS: WordPress 6.1.1
* __Database: MariaDB 10.5
* __Web Server: Apache 2.4
Comments
----------------------------------------
The problem appears to be in civicrm/CRM/report/form.php.
From what I read ...
The last three where clauses in the above are generated by the function buildPermissionClause() which uses a BAO call to generate a user-specific clause for each table in the query where the user does not have full access.
This relies on function selectedTables() to generate the list of tables. The last part of selectedTables function searches all the filters an adds them to the list of tables, however for filters using $filterop 'in' or 'notin', the tables referenced by these clauses may not exist in the main query. It would seem likely that the selected tables list should not include tables where the filter uses these two constructs.
I am not sure apart from 'group' filter (which has specific handling), if any report filters would use 'in/not in (select...)' rather than 'in/out (value list)' so I am not sure the best way to fix this as I have only investigated my usage.
The solution may be to explicitly excluding contact group table (cgroup_civireport), or by updating to selecttables to exclude all 'in' and 'notin' filters as there is no guarantee the table exists in the main query for these types of filters.
Change in function selecttables (line ~4388) with
```
$this->_selectedTables[] = $tableName;"
```
to:
```
if ( ! in_array($filterOp, ["in","notin"] )) $this->_selectedTables[] = $tableName;
```
If the intent is to restrict access to acl enabled groups this would need the same clause added in function joinGroupTempTable(). There may be other places where this should apply.
(On a side issue as I am new here - in my sql query, civicrm_address_address_odd_street_number is not a column that is selectable - it seems to be preset as required and hidden for some reason and limited to a 'Walking Report' template. Having this would cause an unnecessary join to the address table if no address fields are being reported - only a little performance thing but should this be another problem or improvement request?).5.59.0https://lab.civicrm.org/dev/core/-/issues/4065Upgrade Error 5.56.1 to 5.57.0 duplicate Search Kit UI_name2023-01-10T12:26:09ZkcristianoUpgrade Error 5.56.1 to 5.57.0 duplicate Search Kit UI_nameEnviornment:
WP 6.1.1
php 7.4
apache 2.4
Search Kit has a search created in 2021 called 'Top Donors'
on upgrade I get the error:
`[nativecode=1062 ** Duplicate entry 'Top_Donors' for key 'UI_name']`
```
[Error: Finish core DB update...Enviornment:
WP 6.1.1
php 7.4
apache 2.4
Search Kit has a search created in 2021 called 'Top Donors'
on upgrade I get the error:
`[nativecode=1062 ** Duplicate entry 'Top_Donors' for key 'UI_name']`
```
[Error: Finish core DB updates 5.57.0]
Error Field Error Value
Type DB_Error
Code -5
Message DB Error: already exists
Mode 16
UserInfo INSERT INTO `civicrm_saved_search` (`name` , `label` , `form_values` , `mapping_id` , `search_custom_id` , `api_entity` , `api_params` , `created_id` , `modified_id` , `expires_date` , `description` ) VALUES ('Top_Donors' , 'Top Donors' , NULL , NULL , NULL , 'Contribution' , '{\"version\":4,\"select\":[\"GROUP_CONCAT(DISTINCT Contribution_Contact_contact_id_01.display_name) AS GROUP_CONCAT_Contribution_Contact_contact_id_01_display_name\",\"SUM(total_amount) AS SUM_total_amount\",\"COUNT(id) AS COUNT_id\",\"AVG(total_amount) AS AVG_total_amount\"],\"orderBy\":[],\"where\":[[\"contribution_status_id:name\",\"=\",\"Completed\"]],\"groupBy\":[\"contact_id.display_name\"],\"join\":[[\"Contact AS Contribution_Contact_contact_id_01\",\"LEFT\",[\"contact_id\",\"=\",\"Contribution_Contact_contact_id_01.id\"]]],\"having\":[]}' , 202 , 202 , NULL , NULL ) [nativecode=1062 ** Duplicate entry 'Top_Donors' for key 'UI_name']
DebugInfo INSERT INTO `civicrm_saved_search` (`name` , `label` , `form_values` , `mapping_id` , `search_custom_id` , `api_entity` , `api_params` , `created_id` , `modified_id` , `expires_date` , `description` ) VALUES ('Top_Donors' , 'Top Donors' , NULL , NULL , NULL , 'Contribution' , '{\"version\":4,\"select\":[\"GROUP_CONCAT(DISTINCT Contribution_Contact_contact_id_01.display_name) AS GROUP_CONCAT_Contribution_Contact_contact_id_01_display_name\",\"SUM(total_amount) AS SUM_total_amount\",\"COUNT(id) AS COUNT_id\",\"AVG(total_amount) AS AVG_total_amount\"],\"orderBy\":[],\"where\":[[\"contribution_status_id:name\",\"=\",\"Completed\"]],\"groupBy\":[\"contact_id.display_name\"],\"join\":[[\"Contact AS Contribution_Contact_contact_id_01\",\"LEFT\",[\"contact_id\",\"=\",\"Contribution_Contact_contact_id_01.id\"]]],\"having\":[]}' , 202 , 202 , NULL , NULL ) [nativecode=1062 ** Duplicate entry 'Top_Donors' for key 'UI_name']
PEAR_Exception: DB Error: already exists in /home/wpmaybe/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 945
DB_Error: DB Error: already exists in unknown on line unknown
```
I edited the label and name in DB and re-ran the upgrade:
Success
I also now have a packaged Search with the same label and name as one that was created previously. Perhaps we should have a more unique name (not label) to indicated it's a core/packaged search?
EDIT: The affected sites all have the extension 'SearchKit Reports' enabled.https://lab.civicrm.org/dev/core/-/issues/4060On 5.57.0 Joomla3, cv fails with 'Failed to start application'2023-01-11T13:56:44Zaydunsaidan.saunders@squiffle.ukOn 5.57.0 Joomla3, cv fails with 'Failed to start application'Overview
----------------------------------------
On a 5.57.0 Joomla 3.10.9 system, the `cv` command fails with 'Failed to start application'
(Logging against core rather than cv since the problem appears to be here)
Reproduction steps...Overview
----------------------------------------
On a 5.57.0 Joomla 3.10.9 system, the `cv` command fails with 'Failed to start application'
(Logging against core rather than cv since the problem appears to be here)
Reproduction steps
----------------------------------------
1. Try running various commands such as `cv vars:show`, `cv api Contact.get`
Current behaviour
----------------------------------------
```
In Factory.php line 137:
Failed to start application
vars:show [--out OUT] [--flat [FLAT]] [--level LEVEL] [--hostname HOSTNAME] [-t|--test] [-U|--user USER]
```
Expected behaviour
----------------------------------------
No error!
Environment information
----------------------------------------
* __CiviCRM:__ _5.57.0_ <!-- If this problem relates to an upgrade, then specify both old and new versions -->
* __PHP:__ _7.3__
* __CMS:__ _Joomla 3.10.9._5.57.1aydunsaidan.saunders@squiffle.ukaydunsaidan.saunders@squiffle.ukhttps://lab.civicrm.org/dev/core/-/issues/4056Replace hard-coded call to legacyCustomSearch framework with a hook2023-06-25T18:31:24ZeileenReplace hard-coded call to legacyCustomSearch framework with a hookWe should get the legacy custom search frame work out of our `GroupContactCache` BAO and eventually out of core code (and unhide the extension, with a view to not shipping enabled).
In order to do this I think we need a hook to get the ...We should get the legacy custom search frame work out of our `GroupContactCache` BAO and eventually out of core code (and unhide the extension, with a view to not shipping enabled).
In order to do this I think we need a hook to get the sql when loading a contact group
![image](/uploads/9ca4de13d7127a957e988ccea1a5c43b/image.png)
It might potentially wind up like this
![image](/uploads/6eebfb49b84cb35210c17de5a7eaf5e2/image.png)
I see there is handling for the sql being empty - which seems weird - but we could probably assume that if anything ever needs no sql it is not a custom search
Note that `CRM_Contact_BAO_SearchCustom` could be moved to the extension with the hook once as part of this as nothing else calls it
The other place where the legacy custom search framework returns sql is
![image](/uploads/e99dfdf4ba2fb66ac6e78c9f1cffc3b6/image.png)
Internally the first query calls the same `contactIDs`
![image](/uploads/88c6ff1481188c0f666b6309cb01b25b/image.png)
@colemanw @seamuslee @DaveDhttps://lab.civicrm.org/dev/core/-/issues/4055Extension cannot found its own classes during install when opcache is enabled2023-03-16T13:12:50ZkainukExtension cannot found its own classes during install when opcache is enabledI start with the following configuration:
* PHP 8.1.7 _Using the docker image FROM php:8.1.7-apache-buster_
* OPCache enabled _standard configuration_
* Buildkit _CiviCRM install for Drupal 9_ see below:
````
civibuild create patch \
...I start with the following configuration:
* PHP 8.1.7 _Using the docker image FROM php:8.1.7-apache-buster_
* OPCache enabled _standard configuration_
* Buildkit _CiviCRM install for Drupal 9_ see below:
````
civibuild create patch \
--type drupal9-demo \
--civi-ver master \
--url http://patch.kainuk \
--cms-ver 9.5
````
Now, when I enable the Action Provider extension (just from the extension screen), the following error is thrown.
````
Error: Class "Civi\ActionProvider\Symfony\Component\DependencyInjection\DefinitionAdapter" not found in action_provider_civicrm_container() (line 15 of /buildkit/build/patch/web/sites/default/files/civicrm/ext/action-provider/action_provider.php)
````
`cv flush` lets the problem disappear, and for the Action Provider that is no problem because only code is installed (it does not change the database). However, other extensions can have more problems because the installation is interrupted, and possible incomplete.
The problem is, however, reproducible. When I disable the extension, and uninstall it, the error reappears after installing.
I did some duty time in the debugger and found the following code in the extension class loader (CRM_Extension_ClassLoader)
````php
$file = $this->getCacheFile();
if (file_exists($file)) {
$this->loader = require $file;
}
else {
$this->loader = $this->buildClassLoader();
$ser = serialize($this->loader);
file_put_contents($file,
sprintf("<?php\nreturn unserialize(%s);", var_export($ser, 1))
);
}
````
`$this->buildClassLoader()` is an expensive procedure, so after calculation the result is saved for reuse. When a new extension is installed, the saved file is removed because it does not contain the new extension configuration. A new classloader with all the extension stuff is calculated and an updated file is written.
For loading the class, the PHP construct `require` is used. This construct was designed for loading PHP code. The assumption is that PHP code does not change much, and OPCache used this assumption, to store the file in memory. The risk is here is that not the newly written configuration is used, but an old one from memory. On my configuration, I observed with the PHP debugger, that when the `hook_civicrm_container` the old classloader is loaded with require. Just put a breakpoint before the `$this->loader = require $file` line.
When the OPCache is disabled, the problem does not appear.5.59.0https://lab.civicrm.org/dev/core/-/issues/4052Problem with custom group fields when cache get returns NULL from 'CRM_Core_D...2024-03-18T23:41:32ZLeanderJCCProblem with custom group fields when cache get returns NULL from 'CRM_Core_DAO_CustomGroup_QueryMultipleFields *' cache keyOverview
----------------------------------------
We had a problem where we did an APIv3 call on participants where it would cause an error resulting in a 500 response.
Some stack tracing showed us that in CRM/Core/BAO/CustomGroup.php t...Overview
----------------------------------------
We had a problem where we did an APIv3 call on participants where it would cause an error resulting in a 500 response.
Some stack tracing showed us that in CRM/Core/BAO/CustomGroup.php the code `$multipleFieldGroups = $cache->get($multipleFieldGroupCacheKey);` returned NULL (line 576). Since there is no check that says that it should not be NULL the code continues and errors on `if (in_array($table, $multipleFieldGroups) &&` because
> Argument #2 ($haystack) must be of type array, null given in in_array().
Reproduction steps
----------------------------------------
Could not specifically reproduce this with a clean install.
Current behaviour
----------------------------------------
Our page where the APIv3 Participant call was made would return a 500.
```
TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 611 of /var/www/html/vendor/civicrm/civicrm-core/CRM/Core/BAO/CustomGroup.php)
#0 /var/www/html/vendor/civicrm/civicrm-core/CRM/Core/BAO/CustomGroup.php(611): in_array('civicrm_value_r...', NULL)
#1 /var/www/html/vendor/civicrm/civicrm-core/api/v3/utils.php(1449): CRM_Core_BAO_CustomGroup::getTree('Participant', Array, 1982, NULL, Array, NULL, true, NULL, true, false)
#2 /var/www/html/vendor/civicrm/civicrm-core/api/v3/Participant.php(154): _civicrm_api3_custom_data_get(Array, NULL, 'Participant', '1982', NULL)
#3 /var/www/html/vendor/civicrm/civicrm-core/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_participant_get(Array)
#4 /var/www/html/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider->invoke(Array)
#5 /var/www/html/vendor/civicrm/civicrm-core/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest(Array)
#6 /var/www/html/vendor/civicrm/civicrm-core/api/api.php(133): Civi\API\Kernel->runSafe('Participant', 'get', Array)
```
Expected behaviour
----------------------------------------
The page should load as normal.
Environment information
----------------------------------------
* __CiviCRM:__ _5.55.1_
* __PHP:__ _8.0.24_
* __CMS:__ _Drupal 9.4.8_
* __Database:__ _8.0.26_
* __Web Server:__ _nginx/1.20.2_
Comments
----------------------------------------
We fixed this issue by switching to APIv4 so it would no longer automatically get the custom groups and fields for the participant, but this still seemed a general issue to report.
I believe an if, at line 578 after settings the variable, would fix this issue.
```
if ($multipleFieldGroups === NULL) {
$multipleFieldGroups = [];
}
```https://lab.civicrm.org/dev/core/-/issues/4038Import contribution fails in update mode even if contribution id is provided.2023-11-08T01:41:46ZKurund JalmiImport contribution fails in update mode even if contribution id is provided.Here is the error:
![Screenshot_from_2022-12-18_14-06-52](/uploads/f55f363f6c213e0280815a7d69321e44/Screenshot_from_2022-12-18_14-06-52.png)Here is the error:
![Screenshot_from_2022-12-18_14-06-52](/uploads/f55f363f6c213e0280815a7d69321e44/Screenshot_from_2022-12-18_14-06-52.png)Kurund JalmiKurund Jalmihttps://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).