CiviCRM Core issueshttps://lab.civicrm.org/dev/core/-/issues2024-03-19T07:32:11Zhttps://lab.civicrm.org/dev/core/-/issues/5077civicrm.css loaded on front end when frontend theme set to 'None - Unstyled'2024-03-19T07:32:11ZMichael McAndrewcivicrm.css loaded on front end when frontend theme set to 'None - Unstyled'Wondering if I have found a bug or am just misunderstanding/mistaken or I have missed a decision to change things but I have reproduced this on 5.70 and 5.71. It was not happening in 5.64.4
Steps to reproduce:
1. Clean CiviCRM on WordP...Wondering if I have found a bug or am just misunderstanding/mistaken or I have missed a decision to change things but I have reproduced this on 5.70 and 5.71. It was not happening in 5.64.4
Steps to reproduce:
1. Clean CiviCRM on WordPress install
2. Set front end theme to **automatic**
3. Go to a front end page, e.g. /civicrm/mailing/subscribe
4. Notice that /wp-content/plugins/civicrm/civicrm/css/civicrm.css has been loaded - **good!**
5. Set front end theme **none - unstyled**
6. Go to a front end page, e.g. /civicrm/mailing/subscribe
7. Notice that /wp-content/plugins/civicrm/civicrm/css/civicrm.css has been loaded **- bad!**https://lab.civicrm.org/dev/core/-/issues/5036Database Error Using Include/Exclude Search With Long Group Names2024-03-02T03:28:20ZLKuttnerDatabase Error Using Include/Exclude Search With Long Group NamesA database error occurs when attempting to do an Include/Exclude search with a group name over 64 characters in length.
[error]
$Fatal Error Details = array:3 [
"message" => "DB Error: unknown error"
"code" => null
"exception...A database error occurs when attempting to do an Include/Exclude search with a group name over 64 characters in length.
[error]
$Fatal Error Details = array:3 [
"message" => "DB Error: unknown error"
"code" => null
"exception" => Civi\Core\Exception\DBQueryException {
-errorData: array:2 [
"exception" => DB_Error {
+error_message_prefix: ""
+mode: 16
+level: 1024
+code: -1
+message: "DB Error: unknown error"
+userinfo: """
INSERT INTO civicrm_tmp_e_iggroup_1d303da385fcd81408e677514935ea99 (contact_id, group_names)
SELECT civicrm_contact.id as contact_id, civicrm_group.title as group_name
FROM civicrm_contact
INNER JOIN civicrm_group_contact
ON civicrm_group_contact.contact_id = civicrm_contact.id
LEFT JOIN civicrm_group
ON civicrm_group_contact.group_id = civicrm_group.id WHERE
civicrm_group_contact.status = 'Added' AND
civicrm_group_contact.group_id IN(3058) [nativecode=1406 ** **Data too long for column** 'group_names' at row 1]
"""
+backtrace: array:29 [
0 => array:6 [
"file" => ".../modules/civicrm/vendor/pear/db/DB.php"
"line" => 997
"function" => "__construct"
"class" => "PEAR_Error"
"type" => "->"
"args" => array:5 [
0 => "DB Error: unknown error"
1 => -1
2 => 16
3 => array:2 [
0 => "CRM_Core_Error"
1 => "exceptionHandler"
]
4 => """
INSERT INTO civicrm_tmp_e_iggroup_1d303da385fcd81408e677514935ea99 (contact_id, group_names)
SELECT civicrm_contact.id as contact_id, civicrm_group.title as group_name
FROM civicrm_contact
INNER JOIN civicrm_group_contact
ON civicrm_group_contact.contact_id = civicrm_contact.id
LEFT JOIN civicrm_group
ON civicrm_group_contact.group_id = civicrm_group.id WHERE
civicrm_group_contact.status = 'Added' AND
civicrm_group_contact.group_id IN(3058) [nativecode=1406 ** **Data too long for column** 'group_names' at row 1]
"""
]
]https://lab.civicrm.org/dev/core/-/issues/5026Price Sets: total calculation wrong it decimal separator is different than "."2024-02-26T20:12:20ZmasettoPrice Sets: total calculation wrong it decimal separator is different than "."If I use price sets, when the decimal separator is "," and not "." the calculation of the total does not consider decimals.
Tested on dmaster:
![image](/uploads/beefe52fdfaeb4ff4ec06729528cfd25/image.png)
![image](/uploads/72de7f9df4...If I use price sets, when the decimal separator is "," and not "." the calculation of the total does not consider decimals.
Tested on dmaster:
![image](/uploads/beefe52fdfaeb4ff4ec06729528cfd25/image.png)
![image](/uploads/72de7f9df42afb6097e0e287c817c496/image.png)5.72.0https://lab.civicrm.org/dev/core/-/issues/5021Edit message templates permission not working as expected2024-03-15T20:38:58Za.valllloveraEdit message templates permission not working as expected## Overview
Users without the `CiviCRM: edit message templates` permision, can update Templates via the `Print/Merge Document`.
## Reproduction steps
1. Assign a role without the `CiviCRM: edit message templates` permision to an **Use...## Overview
Users without the `CiviCRM: edit message templates` permision, can update Templates via the `Print/Merge Document`.
## Reproduction steps
1. Assign a role without the `CiviCRM: edit message templates` permision to an **User**
2. Log in with that **User** and get to any **Contact**.
3. Create a **Print/Merge Document** Activity.
4. Use an already created **Template**.
5. Modify it in the Document Body
6. It will appear the Check box Update and if the User select it, it will **Update** the Template
![image.png](/uploads/4c57e46478fd7ad9df9de98cd3b4104b/image.png)
## Expected behaviour
The checkbox that let you Update a Template shouldn't appear if the User doesn't have the `CiviCRM: edit message templates` permision.
## Environment information
* **CiviCRM:** _5.69.1_
* **CMS:** _Drupal 10_5.73.0https://lab.civicrm.org/dev/core/-/issues/4954Upgrade to Smarty4....2024-03-15T21:05:34ZeileenUpgrade to Smarty4....Now that we have upgraded many sites to Smarty3 & seem close to ironing out the issues I had a go at Smarty4 and was able to get it working. The extra fixes were entirely in our core compatibility layer so the challenges of moving a site...Now that we have upgraded many sites to Smarty3 & seem close to ironing out the issues I had a go at Smarty4 and was able to get it working. The extra fixes were entirely in our core compatibility layer so the challenges of moving a site from Smarty2 to Smarty4 are now equivalent to moving to Smarty3.
https://smarty-php.github.io/smarty/5.x/upgrading/#removed-php-constants
One annoying thing we did was name our Smarty mixin & the define in a version specific way. In fact there is nothing v2 specific about our mixin and the methodology of defining ` CIVICRM_SMARTY3_AUTOLOAD_PATH` works for Smarty4 as well as it does for Smarty3. If it wasn't for those naming issues I would recommend we simply replace the contents of packages/smarty3 with the Smarty 4 library.
However, given where we are I recommend we
1) merge Smarty4 into packages here https://github.com/civicrm/civicrm-packages/pull/380
2) add a new define `CIVICRM_SMARTY_AUTOLOAD_PATH` - respect it but fall back to `CIVICRM_SMARTY3_AUTOLOAD_PATH` if present
3) update our demo sites / build sites etc to Smarty4
4) update all our messaging to encourage people to use Smarty4 not 3 (but if they have already switched to 3 don't further message as being off Smarty2 is enough to flush out any extension or issues that would impede our medium term plans to put Smarty4 in vendor & stop shipping Smarty3
Note that Smarty4 hard-fails on `{php}` tags in tpls whereas Smarty3 has a backwards compatibility layer that would have supported it, had we chosen to enable it, which we didn't.5.72.0https://lab.civicrm.org/dev/core/-/issues/4941Number field input validation does not respect decimal separator setting (eve...2024-02-12T17:14:12ZDetlev SieberNumber field input validation does not respect decimal separator setting (event custom field)## Overview
This is a variant of https://lab.civicrm.org/dev/core/-/issues/4154, regarding custom fields for events of type _This iPlease describe your problem or bug in detail._
_If you have already posted on __https://civicrm.stackex...## Overview
This is a variant of https://lab.civicrm.org/dev/core/-/issues/4154, regarding custom fields for events of type _This iPlease describe your problem or bug in detail._
_If you have already posted on __https://civicrm.stackexchange.com__ or __https://chat.civicrm.org__, please include the link to that conversation._
## Reproduction steps
1. Under Administer \> Localization \> Languages, Currency, Locations, set "Thousands Separator" to "." (dot) and "Decimal Delimiter" to "," (comma).
2. Create a custom field extending Events. Data type: Number.
3. Edit an existing event (or: add a new event). In the number field, enter a number that includes a comma, such as "1,5".
4. Press Save: nothing happens
5. Reload page: Error message appears "**Error One of parameters (value: 1,5) is not of the type Float**"
## Current behaviour
Validation fails with the error message "**Error One of parameters (value: 1,5) is not of the type Float**"
## Expected behaviour
Validation should not fail for decimal numbers with decimal separator ","
## Environment information
* **CiviCRM:** 5.69.3
* **PHP:** 7,4, 8.1
* **CMS:** Drupal, WordPress
## Comments
This bug was fixed for some fields with #4154 (https://github.com/civicrm/civicrm-core/pull/28369)
Also, I believe this is some kind of regression, because in a system of one of my clients, this did work \~15 months ago. However, tbh I have no clear idea when it broke. (and still, it cannot completely excluded that the existing data was entered with decimal separator ".")5.71.0https://lab.civicrm.org/dev/core/-/issues/4913[PHP 8.2] mail wrongly formatted2024-01-18T02:51:14Zaydunsaidan.saunders@squiffle.uk[PHP 8.2] mail wrongly formattedOverview
----------------------------------------
When running CiviCRM on PHP8 on Linux, email can be badly formatted.
See https://civicrm.stackexchange.com/q/45782/225 for a description, analysis and fix.
Current behaviour
----------...Overview
----------------------------------------
When running CiviCRM on PHP8 on Linux, email can be badly formatted.
See https://civicrm.stackexchange.com/q/45782/225 for a description, analysis and fix.
Current behaviour
----------------------------------------
Some email headers are not correctly formatted, including the Content-Type boundary specifier. The boundary is ignored and the mail is displayed wrongly.
Solution
--------
The problem is in the Pear Mail library. ~~A [fix](https://github.com/pear/Mail/pull/24) was committed in November for the [2.0.0 release](https://github.com/pear/Mail/issues/33) but this has not yet been released.~~
Environment information
----------------------------------------
* __CiviCRM:__ _Master_ <!-- If this problem relates to an upgrade, then specify both old and new versions -->
* __PHP:__ _8.2_5.71.0https://lab.civicrm.org/dev/core/-/issues/4870consider adding type info to cache interfaces that extend PSR-16 Simple Cache?2024-02-18T14:03:46Zcomposerjkconsider adding type info to cache interfaces that extend PSR-16 Simple Cache?It looks like in August 2021, the PHP-FIG [PSR-16 Simple Cache](https://github.com/php-fig/simple-cache) interface had parameter and return type info added to the method definitions.
Noticed when the 2.1+ update to the [Breeze](https://...It looks like in August 2021, the PHP-FIG [PSR-16 Simple Cache](https://github.com/php-fig/simple-cache) interface had parameter and return type info added to the method definitions.
Noticed when the 2.1+ update to the [Breeze](https://wordpress.org/plugins/breeze/) WordPress cache plugin referenced the updated cache interface definition via the included [Mobile Detect](https://github.com/serbanghita/Mobile-Detect/) package.
Maybe there's an adjustment to be made or maybe they (Mobile Detect folk) are including the PSR definitions incorrectly? Have not investigated.
Here's the error message that caused me to notice and track down the issue:
`An error of type E_COMPILE_ERROR was caused in line 43 of the file /…/wp-content/plugins/civicrm/civicrm/CRM/Utils/Cache/Interface.php. Error message: Declaration of CRM_Utils_Cache_Interface::get($key, $default = null) must be compatible with Psr\SimpleCache\CacheInterface::get(string $key, mixed $default = null): mixed`
Initial PSR-16 implementation inclusion was in issue #174.https://lab.civicrm.org/dev/core/-/issues/4869Mailing labels do not work with custom tokens anymore2024-01-06T00:51:57ZMariaVMailing labels do not work with custom tokens anymoreI thought I have seen this issue already but I could not find it. In case there is, feel free to close.
Since 5.64.4 or probably earlier, the mailing labels do not work with custom tokens anymore.
An update to 5.67.3 did not help. The p...I thought I have seen this issue already but I could not find it. In case there is, feel free to close.
Since 5.64.4 or probably earlier, the mailing labels do not work with custom tokens anymore.
An update to 5.67.3 did not help. The page is just blank with no labels at all.
My colleague and I were trying to analyze this problem a bit further but could not find a solution.
The custom token itself works when creating a document.
In case it would be interesting to have a look on the code, I have attached the files.
The custom token produces also warnings for non-existent array indices:
```
PHP Warning: Undefined array key "County" in /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Preferences/Address.php on line 83
PHP Warning: Undefined array key "Street Address Parsing" in /html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Preferences/Address.php on line 95
PHP Warning: Undefined array key "county" in /html/wordpress/wp-content/uploads/civicrm/templates_c/de_DE/%%B0/B09/B09DCA78%%Location.tpl.php on line 78
PHP Warning: Trying to access array offset on value of type null in /html/wordpress/wp-content/uploads/civicrm/templates_c/de_DE/%%B0/B09/B09DCA78%%Location.tpl.php on line 78
```
Does anybody have an idea what could be a problem? Could it be an incompatibility with PHP8?
[csaddressemployer.inc](/uploads/7602180cf302b3fc9e2d67d49b62f61e/csaddressemployer.inc)
[tokenhelpers.inc](/uploads/9702807fed78d384f2226aadf99a173c/tokenhelpers.inc)5.69.0https://lab.civicrm.org/dev/core/-/issues/4851unable to install social_auth_google 4.02024-01-05T14:48:48Zolivierunable to install social_auth_google 4.0Overview
----------------------------------------
After upgrading Drupal from 9 to 10 it is not possible to update social_auth_google. Version conflict.
Reproduction steps
----------------------------------------
- uninstall drupal/soci...Overview
----------------------------------------
After upgrading Drupal from 9 to 10 it is not possible to update social_auth_google. Version conflict.
Reproduction steps
----------------------------------------
- uninstall drupal/social_auth_google (otherwise, upgrade is not possible if civicrm is installed)
- upgrade site to drupal 10
- install drupal/social_auth_google : composer require drupal/social_auth_google
Current behaviour
----------------------------------------
composer require 'drupal/social_auth_google:^4.0'
./composer.json has been updated
Running composer update drupal/social_auth_google
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires drupal/social_auth_google ^4.0 -> satisfiable by drupal/social_auth_google[4.0.0-beta1, 4.0.0, 4.0.1, 4.0.x-dev].
- drupal/social_auth_google[4.0.0-beta1, ..., 4.0.x-dev] require league/oauth2-google ^4.0 -> found league/oauth2-google[4.0.0, 4.0.1] but the package is fixed to 3.0.4 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
```
Expected behaviour
----------------------------------------
Installation without error
Environment information
----------------------------------------
* __CiviCRM:__ _5.68.0_
* __PHP:__ _8.1.18__
* __CMS:__ _Drupal 10.1.7_
* __Database:__ _10.5.21-MariaDB_
* __Web Server:__ _Apache_
Comments
----------------------------------------
league/oauth2-google version is fixed in civicrm-core
composer why league/oauth2-google
civicrm/civicrm-core 5.68.0 requires league/oauth2-google (^3.0)5.70.0https://lab.civicrm.org/dev/core/-/issues/4794Premiums notices on Contribution Page2023-11-30T04:28:06ZJoeMurrayPremiums notices on Contribution PageOn dmaster just now (5.69.alpha1) on Help Support CiviCRM! which has a mug Premium on live page (https://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=1) I get:
Warning: Undefined array key "thumbnail" in include() (li...On dmaster just now (5.69.alpha1) on Help Support CiviCRM! which has a mug Premium on live page (https://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=1) I get:
Warning: Undefined array key "thumbnail" in include() (line 39 of /srv/buildkit/app/private/dmaster/default/civicrm/templates_c/en_US/%%DF/DF4/DF4B6A64%%PremiumBlock.tpl.php).
Warning: Undefined array key "image" in include() (line 39 of /srv/buildkit/app/private/dmaster/default/civicrm/templates_c/en_US/%%DF/DF4/DF4B6A64%%PremiumBlock.tpl.php).
Warning: Undefined array key "allowAutoRenewMembership" in include() (line 420 of /srv/buildkit/app/private/dmaster/default/civicrm/templates_c/en_US/%%3D/3D1/3D13F2BA%%Main.tpl.php).
First two appear to be related to Mug premium.5.68.0https://lab.civicrm.org/dev/core/-/issues/4793Manage Premiums notices2024-03-08T20:20:54ZJoeMurrayManage Premiums noticesOn dmaster just now (5.69.alpha1), navigating to Administer > CiviContribute > Premiums (Thank-you gifts) https://dmaster.demo.civicrm.org/civicrm/admin/contribute/managePremiums?reset=1 titled Manage Premiums, I get notices:
Warning: U...On dmaster just now (5.69.alpha1), navigating to Administer > CiviContribute > Premiums (Thank-you gifts) https://dmaster.demo.civicrm.org/civicrm/admin/contribute/managePremiums?reset=1 titled Manage Premiums, I get notices:
Warning: Undefined array key "cost" in include() (line 38 of /srv/buildkit/app/private/dmaster/default/civicrm/templates_c/en_US/%%3F/3F3/3F34E079%%ManagePremiums.tpl.php).
Warning: Undefined array key "financial_type" in include() (line 38 of /srv/buildkit/app/private/dmaster/default/civicrm/templates_c/en_US/%%3F/3F3/3F34E079%%ManagePremiums.tpl.php).5.69.0https://lab.civicrm.org/dev/core/-/issues/4791Set cache folder for dompdf2023-11-23T03:24:45ZwmortadaSet cache folder for dompdfOverview
----------------------------------------
The cache folder for dompdf isn't set so cache files are created in the font folder (`vendor/dompdf/dompdf/lib/fonts`). This is messy and can cause issues if you deploy the codebase via ...Overview
----------------------------------------
The cache folder for dompdf isn't set so cache files are created in the font folder (`vendor/dompdf/dompdf/lib/fonts`). This is messy and can cause issues if you deploy the codebase via git or if you mount the codebase in a read only volume.
For example after creating a PDF letter via the UI, you will see the following untracked files in git:
```
Untracked files:
(use "git add <file>..." to include in what will be committed)
src/drupal/sites/all/modules/civicrm/vendor/dompdf/dompdf/lib/fonts/Helvetica-Bold.afm.json
src/drupal/sites/all/modules/civicrm/vendor/dompdf/dompdf/lib/fonts/Helvetica-Bold.afm.php
src/drupal/sites/all/modules/civicrm/vendor/dompdf/dompdf/lib/fonts/Helvetica.afm.json
src/drupal/sites/all/modules/civicrm/vendor/dompdf/dompdf/lib/fonts/Helvetica.afm.php
src/drupal/sites/all/modules/civicrm/vendor/dompdf/dompdf/lib/fonts/Times-Bold.afm.json
src/drupal/sites/all/modules/civicrm/vendor/dompdf/dompdf/lib/fonts/Times-Roman.afm.json
src/drupal/sites/all/modules/civicrm/vendor/dompdf/dompdf/lib/fonts/Times-Roman.afm.php
```
Current behaviour
----------------------------------------
The cache folder for dompdf isn't set so cache files are created in the font folder.
Proposed behaviour
----------------------------------------
CiviCRM defines the cache folder for dompdf that is outside of the codebase. Files are not generated within the codebase which keeps the codebase tidier and means that the codebase can be mounted read only.5.69.0https://lab.civicrm.org/dev/core/-/issues/4785Note 'View' not displaying data for a valid contact Note2024-01-08T00:23:25Zct_itsupportNote 'View' not displaying data for a valid contact Note## Overview
Upgrading to 5.67.1 from 5.66 has caused the View link to display a blank form for a previously populated note. If you click on 'Edit', you can see the note data.
Using Drupal 10.1.6 as the CMS
## Reproduction steps
1. Do...## Overview
Upgrading to 5.67.1 from 5.66 has caused the View link to display a blank form for a previously populated note. If you click on 'Edit', you can see the note data.
Using Drupal 10.1.6 as the CMS
## Reproduction steps
1. Do a fresh installation for Drupal 10.1.x with CiviCRM 5.67.1, with the loadGenerated=1 to create some dummy contact data
2. Search on all Individuals and chose a contact
3. Add a note to the contact
4. Click on 'View' on the newly created note - no data is displayed, the form is blank
5. Click on 'Edit' on the newly created note and the correct data is present
## Expected behaviour
I would expect the note data to populate the form as it has done in 5.66.x and before
## Environment information
* **Browser:** _Chrome, Edge_
* **CiviCRM:** _5.67.1_
* **PHP:** _8.1.x_
* **CMS:** _Drupal 10.1.6_
* **Database:** _MySQL 8.0.x_
* **Web Server:** _Apache 2.4.x_
## Comments
I did check recent log messages in Drupal Watchdog. There are a very large number of 'Undefined array Key 2...' generated just by opening the contact and clicking on the Note tab. It is so easy to reproduce that I have not included any of the message here.5.68.1https://lab.civicrm.org/dev/core/-/issues/4772unable to authenticate in Joomla using Authx2023-11-15T13:43:10Zlcdwebunable to authenticate in Joomla using AuthxWhen using Authx to authenticate external CURL API calls in Joomla, we receive the error:
`Class "CRM_Utils_FakeJoomlaSession" not found.`When using Authx to authenticate external CURL API calls in Joomla, we receive the error:
`Class "CRM_Utils_FakeJoomlaSession" not found.`5.69.0lcdweblcdwebhttps://lab.civicrm.org/dev/core/-/issues/4767Clean install of 5.68-RC fails on WP2023-12-02T16:06:41ZkcristianoClean install of 5.68-RC fails on WPClean install of CiviCRM 5.68.beta1-202311110239 on WP (both 6.3.2 and 6.4.1) using php 8.1 fails:
php log:
```
[11-Nov-2023 14:09:40 UTC] PHP Fatal error: Uncaught CRM_Core_Exception: [-5: DB Error: already exists
thrown in /home/...Clean install of CiviCRM 5.68.beta1-202311110239 on WP (both 6.3.2 and 6.4.1) using php 8.1 fails:
php log:
```
[11-Nov-2023 14:09:40 UTC] PHP Fatal error: Uncaught CRM_Core_Exception: [-5: DB Error: already exists
thrown in /home/cividev/buildkit/build/wpempty/web/wp-content/plugins/civicrm/civicrm/api/api.php on line 138
```
Nothing in the ConfigAndLog files.
I also logged this issue - https://github.com/civicrm/civicrm-buildkit/issues/825 as I thought it was a buildkit issue.
Same issue with 5.69-alpha.https://lab.civicrm.org/dev/core/-/issues/4761Copy event fails with DB Error: already exists; Saving new reminder hangs2023-11-29T07:35:34ZBobSCopy event fails with DB Error: already exists; Saving new reminder hangsOverview
----------------------------------------
Copying an event fails with "DB Error: already exists" if a reminder with the same name (but different case) exists in civicrm_action_schedule.
Also, while editing an event, saving a new...Overview
----------------------------------------
Copying an event fails with "DB Error: already exists" if a reminder with the same name (but different case) exists in civicrm_action_schedule.
Also, while editing an event, saving a new event reminder hangs if a reminder with the same name (but different case) exists in civicrm_action_schedule.
Reproduction steps
----------------------------------------
1. Edit an event and create an reminder with name "reminder".
2. Then create a reminder with the name "Reminder".
Current behaviour
----------------------------------------
Infinite spinner.
Environment information
----------------------------------------
* __CiviCRM:__ _5.67_
* __Database:__ _MariaDB 10.4_
* __CMS:__ _Drupal 9.5_
Comments
----------------------------------------
Both issues are due to the 5.66-alpha1 addition of the index `civicrm_action_schedule.UI_name`.
While CRM_Core_DAO::makeNameFromLabel() ensures that the new name is unique in a case-sensitive context, the `name` column has the default ci collation, making the index case insensitive. As a result, violations of the 'unique' constraint can occur.5.68.0https://lab.civicrm.org/dev/core/-/issues/4752Notice: Undefined index: weight in CRM_Core_Action::{closure}()2023-11-10T13:56:37ZRobert J. LangNotice: Undefined index: weight in CRM_Core_Action::{closure}()Overview
----------------------------------------
The dblog is filling up with errors with this message:
Notice: Undefined index: weight in CRM_Core_Action::{closure}() (line 317 of /mysite/modules/contrib/civicrm/CRM/Core/Action.php).
...Overview
----------------------------------------
The dblog is filling up with errors with this message:
Notice: Undefined index: weight in CRM_Core_Action::{closure}() (line 317 of /mysite/modules/contrib/civicrm/CRM/Core/Action.php).
Reproduction steps
----------------------------------------
I can reproduce this on my site by visiting any contact tab (not just 1195):
https://mysite.org/civicrm/contact/view?reset=1&cid=1195&selectedChild=mailing
Current behaviour
----------------------------------------
The dblog fills up with something like 20 (the number varies) instances of a PHP notice:
Message: Notice: Undefined index: weight in CRM_Core_Action::{closure}() (line 317 of /mysite/modules/contrib/civicrm/CRM/Core/Action.php).
Location: https://mysite.org/civicrm/ajax/contactmailing?contact_id=1195&draw=1&columns%5B0%5D%5Bdata%5D=subject&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=creator_name&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=recipients&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=false&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=start_date&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=openstats&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=false&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=links&columns%5B5%5D%5Bname%5D=&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=false&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&start=0&length=25&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1699213951856
Referrer: https://mysite.org/civicrm/contact/view?reset=1&cid=1195&selectedChild=mailing
Expected behaviour
----------------------------------------
No dblog entries.
Environment information
----------------------------------------
* __Browser:__ Safari (Desktop)
* __CiviCRM:__ 5.67.0
* __PHP:__ 7.4.31
* __CMS:__ Backdrop 1.26.1
Comments
----------------------------------------
The relevant code is:
```
usort($seqLinks, static function ($a, $b) {
return (int) ((int) ($a['weight']) > (int) ($b['weight']));
});
```
Seems like it should perhaps be
```
usort($seqLinks, static function ($a, $b) {
return (int) ((int) ($a['weight'] ?? 0) > (int) ($b['weight'] ?? 0));
});
```5.67.1https://lab.civicrm.org/dev/core/-/issues/4751Call to civicrm_api3_create_error from civicrm/Civi/API/Kernel.php fails2023-11-10T13:53:14ZchriscantCall to civicrm_api3_create_error from civicrm/Civi/API/Kernel.php failsAn overnight geocode Scheduled Job started generating an error on 2023-11-03 because the Parameters had a blank line at the end. I'd updated to CiviCRM 5.67.0 the day before.
```plaintext
Parameters raw (from db settings):
geocoding=1
...An overnight geocode Scheduled Job started generating an error on 2023-11-03 because the Parameters had a blank line at the end. I'd updated to CiviCRM 5.67.0 the day before.
```plaintext
Parameters raw (from db settings):
geocoding=1
parse=0
```
Parameters parsed (and passed to API method): `a:0:{}`
When previously the parameters passed to the API `a:3:{s:7:"version";i:3;s:9:"geocoding";s:1:"1";s:5:"parse";s:1:"0";}`
I fixed that problem by removing the blank line.
However, the error was being reported through civicrm/Civi/API/Kernel.php line 407 it seems, ie here: https://github.com/civicrm/civicrm-core/blob/master/Civi/API/Kernel.php#L407
This threw an exception as shown below.
I fixed that problem adding this line before
`require_once "api/v3/utils.php";`
Hope this helps, Chris
When seeking help with this issue, you may be asked for some of the following information:
```plaintext
WordPress version 6.3.2
Active theme: Avada (version 7.11.2)
Current plugin: CiviCRM (version 5.67.0) PHP version 8.1.25
Error Details
=============
An error of type E_ERROR was caused in line 407 of the file /var/.../wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php. Error message: Uncaught Error: Call to undefined function civicrm_api3_create_error() in /var/.../wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php:407
Stack trace:
#0 /var/.../wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(348): Civi\API\Kernel->createError()
#1 /var/.../wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(88): Civi\API\Kernel->formatApiException()
#2 /var/.../wp-content/plugins/civicrm/civicrm/api/api.php(28): Civi\API\Kernel->runSafe()
#3 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(125): civicrm_api()
#4 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(92): CRM_Core_JobManager->executeJob()
#5 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Job.php(218): CRM_Core_JobManager->executeJobById()
#6 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(614): CRM_Admin_Form_Job->postProcess()
#7 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Submit.php(56): CRM_Core_Form->mainProcess()
#8 /var/.../wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform()
#9 /var/.../wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle()
#10 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle()
#11 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(364): CRM_Core_Controller->run()
#12 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(170): CRM_Core_Page_Basic->edit()
#13 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php(140): CRM_Core_Page_Basic->run()
#14 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(322): CRM_Admin_Page_Job->run()
#15 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem()
#16 /var/.../wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke()
#17 /var/.../wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke()
#18 /var/.../wp-includes/class-wp-hook.php(310): CiviCRM_For_WordPress->invoke()
#19 /var/.../wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#20 /var/.../wp-includes/plugin.php(517): WP_Hook->do_action()
#21 /var/.../wp-admin/admin.php(259): do_action()
#22 {main}
```5.67.1https://lab.civicrm.org/dev/core/-/issues/4722[PHP 8.1] fseek deprecation in PHPgettext2023-12-04T21:08:50Zjofranzfranz@systopia.de[PHP 8.1] fseek deprecation in PHPgettextOverview
----------------------------------------
Noisy error on cli
Reproduction steps
----------------------------------------
Performing a cache clear on cli
Current behaviour
----------------------------------------
```[PHP Depre...Overview
----------------------------------------
Noisy error on cli
Reproduction steps
----------------------------------------
Performing a cache clear on cli
Current behaviour
----------------------------------------
```[PHP Deprecation] fseek(): Passing null to parameter #2 ($offset) of type int is deprecated at .../drupal/vendor/civicrm/civicrm-packages/PHPgettext/streams.php:125```
Expected behaviour
----------------------------------------
There should be no deprecation warnings.
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.66.0_ <!-- If this problem relates to an upgrade, then specify both old and new versions -->
* __PHP:__ _8.1_
* __CMS:__ _Drupal 9.5.11_