Development issueshttps://lab.civicrm.org/groups/dev/-/issues2024-01-15T11:38:54Zhttps://lab.civicrm.org/dev/core/-/issues/4895Can't delete unused financial types2024-01-15T11:38:54ZJonGoldCan't delete unused financial typesOverview
----------------------------------------
Not a regression!
Financial types associated with quick config price sets can never be deleted.
Reproduction steps
----------------------------------------
1. Create a new financial typ...Overview
----------------------------------------
Not a regression!
Financial types associated with quick config price sets can never be deleted.
Reproduction steps
----------------------------------------
1. Create a new financial type.
1. Create a new event.
1. Select the financial type as the default for the event and save.
1. Delete the event.
1. Delete the financial type.
Current behaviour
----------------------------------------
Obtuse error.
```
The following tables have an entry for this financial type: CRM_Price_DAO_PriceSet, CRM_Price_DAO_PriceFieldValue
```
Expected behaviour
----------------------------------------
Financial type should be deletable.
When the warning `Deleting this event will also delete associated Event Registration Page and Event Fee configurations. This action cannot be undone. Do you want to continue?` appears - continuing should delete the price set if it's a quick-config. But since I hope quick config dies a painful death, let's generalize to "deleting an event
Comments
----------------------------------------
Tangentially - you can't delete a price set that has any payments associated with it. This should be doable IMO and I believe is an artifact of pre-CiviAccounts (Civi 4.3) behavior when line items didn't exist.https://lab.civicrm.org/dev/core/-/issues/4894Fatal error when searching a contact2024-01-10T14:07:35ZGuillaumeSorelFatal error when searching a contactOn CiviCRM 5.69.1 when I do a simple contact search I get this error and can't see the contact
```[error]
$Fatal Error Details = array:3 [
"message" => """
Unexpected result from getcountArray\n
(\n
[error_code] => -2...On CiviCRM 5.69.1 when I do a simple contact search I get this error and can't see the contact
```[error]
$Fatal Error Details = array:3 [
"message" => """
Unexpected result from getcountArray\n
(\n
[error_code] => -2\n
[sql] => \n
[debug_info] => SELECT count(*) as c\n
FROM civicrm_activity a\n
LEFT JOIN civicrm_case_activity actjoin_case_id ON (actjoin_case_id.activity_id = a.id)\n
WHERE (((`a`.`activity_type_id` Array)))\n
AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE contact_id = "27478"))\n
AND (actjoin_case_id.case_id IS NULL)\n
AND (a.is_current_revision = "1")\n
AND (a.activity_type_id IN ("1", "55", "56", "57", "58", "59", "70", "71", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "72", "73", "74", "75", "76", "77", "78", "80", "82", "84", "86", "88", "89"))\n
AND (a.is_test = "0")\n
AND (a.is_deleted = "0")\n
[nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Array)))\n
AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHE...' at line 4]\n
[entity] => Activity\n
[action] => get\n
[is_error] => 1\n
[error_message] => case_id is not valid : 1\n
[debug_information] => \n
)\n
"""
"code" => null
"exception" => CRM_Core_Exception {#36862
-errorData: array:5 [
"error_code" => 0
"entity" => "Activity"
"action" => "getcount"
"is_error" => 1
"error_message" => """
Unexpected result from getcountArray\n
(\n
[error_code] => -2\n
[sql] => \n
[debug_info] => SELECT count(*) as c\n
FROM civicrm_activity a\n
LEFT JOIN civicrm_case_activity actjoin_case_id ON (actjoin_case_id.activity_id = a.id)\n
WHERE (((`a`.`activity_type_id` Array)))\n
AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE contact_id = "27478"))\n
AND (actjoin_case_id.case_id IS NULL)\n
AND (a.is_current_revision = "1")\n
AND (a.activity_type_id IN ("1", "55", "56", "57", "58", "59", "70", "71", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "72", "73", "74", "75", "76", "77", "78", "80", "82", "84", "86", "88", "89"))\n
AND (a.is_test = "0")\n
AND (a.is_deleted = "0")\n
[nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Array)))\n
AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHE...' at line 4]\n
[entity] => Activity\n
[action] => get\n
[is_error] => 1\n
[error_message] => case_id is not valid : 1\n
[debug_information] => \n
)\n
"""
]
#cause: null
-_trace: null
#message: """
Unexpected result from getcountArray\n
(\n
[error_code] => -2\n
[sql] => \n
[debug_info] => SELECT count(*) as c\n
FROM civicrm_activity a\n
LEFT JOIN civicrm_case_activity actjoin_case_id ON (actjoin_case_id.activity_id = a.id)\n
WHERE (((`a`.`activity_type_id` Array)))\n
AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE contact_id = "27478"))\n
AND (actjoin_case_id.case_id IS NULL)\n
AND (a.is_current_revision = "1")\n
AND (a.activity_type_id IN ("1", "55", "56", "57", "58", "59", "70", "71", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "72", "73", "74", "75", "76", "77", "78", "80", "82", "84", "86", "88", "89"))\n
AND (a.is_test = "0")\n
AND (a.is_deleted = "0")\n
[nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Array)))\n
AND (a.id IN (SELECT activity_id FROM civicrm_activity_contact WHE...' at line 4]\n
[entity] => Activity\n
[action] => get\n
[is_error] => 1\n
[error_message] => case_id is not valid : 1\n
[debug_information] => \n
)\n
"""
#code: 0
#file: "/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/api/api.php"
#line: 138
trace: {
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/api/api.php:138 {
civicrm_api3(string $entity, string $action, array $params = [])
› if (is_array($result) && !empty($result['is_error'])) {
› throw new CRM_Core_Exception($result['error_message'], $result['error_code'] ?? 'undefined', $result);
› }
}
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Activity/BAO/Activity.php:898 { …}
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact.php:2641 { …}
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php:434 { …}
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php:255 { …}
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php:83 { …}
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:322 { …}
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
/var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm.php:1231 { …}
/var/www/vhosts/domain/httpdocs/wp-includes/class-wp-hook.php:308 { …}
/var/www/vhosts/domain/httpdocs/wp-includes/class-wp-hook.php:332 { …}
/var/www/vhosts/domain/httpdocs/wp-includes/plugin.php:517 { …}
/var/www/vhosts/domain/httpdocs/wp-admin/admin.php:259 { …}
}
}
]
2024-01-08 13:30:57+0100 [debug] $backTrace = #0 /var/www/vhosts/smc-cse.fr/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(443): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/vhosts/smc-cse.fr/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CRM_Core_Exception))
#2 /var/www/vhosts/domain/httpdocs/wp-content/plugins/civicrm/civicrm.php(1231): CRM_Core_Invoke::invoke((Array:3))
#3 /var/www/vhosts/domain/httpdocs/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress->invoke("")
#4 /var/www/vhosts/domain/httpdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters("", (Array:1))
#5 /var/www/vhosts/domain/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action((Array:1))
#6 /var/www/vhosts/domain/httpdocs/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")
#7 {main}```https://lab.civicrm.org/dev/user-interface/-/issues/65Button row overlaps the table on view contribution2024-02-02T06:01:54ZDaveDButton row overlaps the table on view contributionStarted in 5.70. Turn on tax+invoicing to see all the buttons.
There's some discussion at https://github.com/civicrm/civicrm-core/pull/28907
![untitled3](/uploads/4f99d9d8bccdcd9a0aca2aaa51ba37df/untitled3.png)Started in 5.70. Turn on tax+invoicing to see all the buttons.
There's some discussion at https://github.com/civicrm/civicrm-core/pull/28907
![untitled3](/uploads/4f99d9d8bccdcd9a0aca2aaa51ba37df/untitled3.png)5.70.0seamusleeseamusleehttps://lab.civicrm.org/dev/core/-/issues/4893No event registration confirmation email sent for free events2024-01-12T04:49:21ZBobSNo event registration confirmation email sent for free events## Overview
Upon registering for a free event, no confirmation email is sent.
## Reproduction steps
1. Register for an event configured with `Paid Event` = No and `Send Confirmation Email` = Yes.
## Current behaviour
No confirmation...## Overview
Upon registering for a free event, no confirmation email is sent.
## Reproduction steps
1. Register for an event configured with `Paid Event` = No and `Send Confirmation Email` = Yes.
## Current behaviour
No confirmation email is sent.
## Expected behaviour
A confirmation email is sent.
## Environment information
**CiviCRM:** _5.69.1_
## Comments
Regression introduced by https://github.com/civicrm/civicrm-core/commit/36723fe908973f72dc5cd57a249ee236fcfec868
Specifically, the Issue is caused by a change to CRM_Event_Form_Registration::processRegistration:
* From: `if ($this->_contributeMode != 'checkout' || $this->_contributeMode != 'notify')`
* To: `if ($this->getPaymentProcessorObject()->supports('noReturn'))`
This returns FALSE if there is no payment processor, causing the email to not be sent.5.69.2https://lab.civicrm.org/dev/core/-/issues/4892[PHP 8.1] Weight notices @ Import/Export Mappings2024-01-12T04:49:22Zjofranzfranz@systopia.de[PHP 8.1] Weight notices @ Import/Export MappingsSame as #4891
Here needs to be data to see it: https://dmaster.demo.civicrm.org/civicrm/admin/mapping?reset=1
_systopia reference: 23444_Same as #4891
Here needs to be data to see it: https://dmaster.demo.civicrm.org/civicrm/admin/mapping?reset=1
_systopia reference: 23444_5.69.2https://lab.civicrm.org/dev/core/-/issues/4891[PHP 8.1] Weight notices @ trash contact folder2024-02-09T20:39:06Zjofranzfranz@systopia.de[PHP 8.1] Weight notices @ trash contact folderOverview
----------------------------------------
_Weight notices @ trash contact folder_
Reproduction steps
----------------------------------------
1. Delete a contact in a non-permanent way
2. Go to: https://dmaster.demo.civicrm.org/...Overview
----------------------------------------
_Weight notices @ trash contact folder_
Reproduction steps
----------------------------------------
1. Delete a contact in a non-permanent way
2. Go to: https://dmaster.demo.civicrm.org/civicrm/contact/search/advanced (user/pass: demo demo)
3. Select: "Search in Trash
(deleted contacts)" (Important!!!)
4. Hit "Search"
Current behaviour
----------------------------------------
Many weight notices:
```
Warning: Undefined array key "weight" in CRM_Core_Action::{closure}() (line 318 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Action.php).
Warning: Undefined array key "weight" in CRM_Core_Action::{closure}() (line 318 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Action.php).
Warning: Undefined array key "weight" in CRM_Core_Action::{closure}() (line 318 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Action.php).
Warning: Undefined array key "weight" in CRM_Core_Action::{closure}() (line 318 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Action.php).
```
Expected behaviour
----------------------------------------
No notices.
Environment information
----------------------------------------
* __Browser:__ _Firefox_
* __CiviCRM:__ _5.68.1 (guess also below and above)_
* __PHP:__ _8.1+_
* __CMS:__ _Drupal10_
* __Database:__ _WhateverDB_
* __Web Server:__ _An amazing one even!_
----------------------------------------
_systopia reference: 23444_eileeneileenhttps://lab.civicrm.org/dev/core/-/issues/4890CiviCRM could not create trigger2024-02-01T10:38:38ZktatgenhorstCiviCRM could not create triggerOverview
----------------------------------------
_Please describe your problem or bug in detail._
Installation of version 5.69.0 on a fresh Ubuntu install with WordPress.
1. I used this link to setup Wordpress on Ubuntu:
https://ub...Overview
----------------------------------------
_Please describe your problem or bug in detail._
Installation of version 5.69.0 on a fresh Ubuntu install with WordPress.
1. I used this link to setup Wordpress on Ubuntu:
https://ubuntu.com/tutorials/install-and-configure-wordpress#1-overview
2. I followed this set of instructions to install CiviCRM:
https://docs.civicrm.org/installation/en/latest/wordpress/
3. When I go to the installation/setup wizard I add the credentials for the database I created (separate from WP database and the user has grant all and specifically grant trigger on civicrm.*). I did destroy the VM and build a second time with same steps and results.
_If you have already posted on https://civicrm.stackexchange.com or https://chat.civicrm.org, please include the link to that conversation._
I have not posted there, but I see older posts regarding this on previous versions. None of those offer a valid solution for this present issue,
Reproduction steps
----------------------------------------
1. Click on **Contacts -> New Individual**.
1. Entered **First Name** and **Last Name** and clicked **Save**.
1. Got an error "**Fatal error: DB error**".
Current behaviour
The setup stops after DB connect and reports unable to create triggers.
----------------------------------------
_What happens currently. Please provide error messages, screenshots or gifs ([LICEcap](http://www.cockos.com/licecap/), [SilentCast](https://github.com/colinkeenan/silentcast)) where appropriate._
```
TIP: The best way to convey an error message is to copy it in here and use
three backtick ` symbols. You may edit the message to remove private
information (like passwords). The backticks will help to preserve any
special characters or spaces.
```
Expected behaviour
----------------------------------------
_What should happen._
I should pass through the setup screen and have a functioning CiviCRM install.
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. -->
Ubuntu 20.04
MySqlD 8.0.35
Php 8.2.4
Apache2 2.4.41
CiviCRM 5.69.0
* __Browser:__ _Firefox 59.0.1/Chrome 78.0.3904/Safari 13_
* __CiviCRM:__ _Master/5.20.0/5.19.1/5.18.2/..._ <!-- If this problem relates to an upgrade, then specify both old and new versions -->
* __PHP:__ _7.0/7.1/7.2/7.3/...__
* __CMS:__ _Backdrop 1.5/Drupal 7.30/Joomla 3.3/WordPress 4.5/..._
* __Database:__ _MySQL 5.7.7/MariaDB 10.4/..._
* __Web Server:__ _Apache 2.4/Nginx 1.16/..._
Comments
----------------------------------------
_Anything else you would like the reviewer to note._
Thank you,
Karl Tatgenhorsthttps://lab.civicrm.org/dev/release/-/issues/245.69.1 critical error: Undefined array key "crmSearchTasks" in "ext/search_ki...2024-02-01T22:42:39ZDmitry Smirnov5.69.1 critical error: Undefined array key "crmSearchTasks" in "ext/search_kit/search_kit.php" on line 61```
PHP Warning: Undefined array key "crmSearchTasks" in ext/search_kit/search_kit.php on line 61
PHP Warning: Trying to access array offset on value of type null in ext/search_kit/search_kit.php on line 61
PHP Fatal error: Uncaught T...```
PHP Warning: Undefined array key "crmSearchTasks" in ext/search_kit/search_kit.php on line 61
PHP Warning: Trying to access array offset on value of type null in ext/search_kit/search_kit.php on line 61
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in ext/search_kit/search_kit.php:61
```https://lab.civicrm.org/dev/core/-/issues/4889deleted-files-list needs some fine-tuning2024-02-21T03:00:39ZDaveDdeleted-files-list needs some fine-tuningI tried updating it after the case_activity [workflow PR](https://github.com/civicrm/civicrm-core/pull/28800) using the script, because the status check is now saying "old files", but the output seemed off. But it's because the 5.70 bran...I tried updating it after the case_activity [workflow PR](https://github.com/civicrm/civicrm-core/pull/28800) using the script, because the status check is now saying "old files", but the output seemed off. But it's because the 5.70 branching made some changes that don't make sense: https://github.com/civicrm/civicrm-core/commit/0524dba18c932062c431d3f337506c7ad2ca80a1#diff-41b67b01f75a3da4825936805e68a5ee46f7b883e7b2bfd85766a181a6562ea3R154
And we've seen before that the `tools/extensions/phpstorm/.phpstorm.meta.php` line is a false-positive if you don't have that extension installed, which I'm guessing only 2 people do.
As a general comment I'm not crazy about the concept behind the deleted-list file. I'm not familiar with joomla but can't joomla admins just delete the folder before upgrade the same way everyone else does? The docs even suggest it as a troubleshooting step, so it must be doable?
Technically a regression, but not the same as usual.
FYI @colemanw5.71.0https://lab.civicrm.org/dev/user-interface/-/issues/64"Done" buttons are misaligned2024-01-07T19:50:31ZDaveD"Done" buttons are misalignede.g. and it's especially weird on contribution since it overlaps part of the table:
![untitled3](/uploads/516138bc3656ab5c809d7e15c19c336e/untitled3.png)
Activity:
![untitled4](/uploads/fcd451588d051e6f8ab20d58cc3f62ae/untitled4.png)e.g. and it's especially weird on contribution since it overlaps part of the table:
![untitled3](/uploads/516138bc3656ab5c809d7e15c19c336e/untitled3.png)
Activity:
![untitled4](/uploads/fcd451588d051e6f8ab20d58cc3f62ae/untitled4.png)5.70.0https://lab.civicrm.org/dev/core/-/issues/4888Location field on case activity isn't aligned properly2024-01-10T17:48:56ZDaveDLocation field on case activity isn't aligned properly![untitled3](/uploads/7571ef6057725f323e355fda70c7cd1c/untitled3.png)![untitled3](/uploads/7571ef6057725f323e355fda70c7cd1c/untitled3.png)https://lab.civicrm.org/dev/core/-/issues/4887Discussion / clarification on Api4 permissions2024-01-05T13:49:04ZRichDiscussion / clarification on Api4 permissionsI've been trying to [grok](https://en.wikipedia.org/wiki/Grok) this while working on Standalone, and it's raised a few questions for me. It looks like there are several nuances/quirks/gotchas. This is my attempt to document these. I'd re...I've been trying to [grok](https://en.wikipedia.org/wiki/Grok) this while working on Standalone, and it's raised a few questions for me. It looks like there are several nuances/quirks/gotchas. This is my attempt to document these. I'd really appreciate anyone chipping in to improve this understanding. I'll close this issue off once I understand things, hopefully after having opened other issues/PRs including for the docs.
See: [Developer docs on security](https://docs.civicrm.org/dev/en/latest/security/permissions/#apiv4)
API access is split between Coarse and Fine grained levels.
- Coarse is: `action::permissions()`, `api::authorize`, `AuthorizeEvent`,
`PermissionCheckSubscriber`...
- Fine is: `CoreUtil::checkAccessRecord`, `_checkAccess`, `AuthorizeRecordEvent`
**Coarse** level control is at the entity.action level only is handled by the
`API\Kernel->authorize()` method, which dispatches an `AuthorizeEvent` over
`civi.api.authorize`.
- `Api4/Event/Subscriber/PermissionCheckSubscriber` subscribes `W_LATE` and
authorizes the event: where checkPermissions is false or where the action is
getLinks, or if `$apiRequest->isAuthorized()` returns true. This generally is
handled by code in `AbstractAction` which finds the permissions needed
(`getPermissions()`) finds a match for the action name in the array returned
by the Api Action classes’ `permissions()` method) and checks them with
`\CRM_Core_Permission::check();`
Gotcha: the `save` action, if unspecified in the action's `permissions()`
method gets defaults from `create` (if specified) rather than `default`.
- there are other listeners too, (e.g. `AdhocProvider` (api4) and
`API/Subscriber/PermissionCheck` which is mostly api3 but it also authorizes
requests for api4 where `checkPermissions` has been set false, duplicating the
same logic above.)
**Fine** level control (at least for DAO entites) is at an Action-and-Record
level control (termed ACLs) rely on a single method on the entity's **BAO**:
public static function _checkAccess(string $entityName, string $action, array $record, ?int $userID): bool
- These methods are used by `\Civi\Api4\Utils\CoreUtil::checkAccessRecord`
- This only calls the BAO's `_checkAccess()` for actions that do not extend
`AbstractGetAction`; intended to be write actions, but could be others.
When it is called it must return TRUE for OK. A FALSE value will cause an
exception.
- `_checkAccess` is **not** called if a listener to
`\Civi\Api4\Event\AuthorizeRecordEvent` authorizes or explicitly declares
the event unauthorized.
- `_checkAccess` must only check data as follows: entity and action name and nothing else from `$apiRequest`. Data in `$record` (see below for what this contains). It may identify the record's primary key ID and fetch data from the database to consider, too.
- `checkAccessRecord` is used:
- `AbstractUpdateAction::_run` calls it per row to be updated
- `DAODeleteAction::_run` calls it per row.
- `BasicBatchAction::_run` calls it per row.
- `AbstractCreateAction::validateValues` calls it. (before `ValidateValuesEvent`)
### `$record` for Delete
This is `[$idFieldName => $id]` only.
### `$record` for Create
validateValues calls `_checkAccess` with data that has been pre processed via: *formatWriteValues » fillDefaults*
### `$record` for Update
- formatWriteValues
- some special code to convert passing a primary key value in values to a WHERE
clause, and to rule out the possiblity of changing an existing primary key
- For single row updates:
- populate only the row's id field (from the where)
- calls `_checkAccess` with the id field + input (after formatWriteValues)
- For batch updates:
- getBatchRecords
- each row, we take the input (after formatWriteValues) and fill from
existing row data. Then call `_checkAccess`.
- *then* call validateValues() which dispatches a ValidateValuesEvent
over `civi.api4.validate`
### `$record` for Save
- Loops rows
- applies defaults passed in to this specific row
- `formatWriteValues`
- `matchExisting` (presumably sets PKs?)
- if a create, fills defaults
- calls `validateValues` which loops records and for each calls
`checkAccessDelegated` with either 'create' or 'update'
- `checkAccessDelegated` creates a new API request of the same type and calls
`authorize`, as a way to check permissions for the entity.action pair.
(inside loop!)
- it then calls `_checkAccess` for the record with this new empty api request
and the record as a separate array. i.e. the `$apiRequest` handled by
`_checkAccess` only contains the entity name and action name.
## Questions
- There's a couple of places where I think we could reduce work that is
unnecessarily repeated in a loop.
- `AbstractSaveAction::validateValues` calls `checkAccessDelegated` which in
turn calls `authorize()` on a blank API call every time. The answer to this
won't change during the loop; there may be one answer for 'create' and one
for 'update'.
- `Generic\BasicBatchAction` (minor): move if(checkPermissions) to outside
the loop and cache the logged in user outside the loop too.
- `_checkAccess` is only called for actions that don't extend the
AbstractGetAction. This could potentially be confusing for other reporting
actions that don't extend this (maybe they should?). I've seen quite a few
examples where specific cases return FALSE and at the end there's a default
return TRUE. I'm not suggesting there's a security problem, but this doesn't
feel "security-first", i.e. it's a blanket allow with some exceptions rather
than a blanket deny with allow being explicitly checked.
- It feels weird that we start from an entity-action-specific class, then call
a wider entity-specific method, passing in the name of the action, meaning that
the logic then needs to disaggregate the action-specifics. It also feels weird
that `_checkAccess` is in the BAO, though it's only called by Api4 code.
Wouldn't it be better to have `_checkAccess` in the action classes?
- `$record` passed as part of update actions is inconsistent. It contains full original
data with updated field values replaced for *batch* updates, but only the
updated field values and primary key for *single* updates. Later,
validateValues is called with a `CRM_Utils_LazyArray` that would *reload* this
data (in the case of a batch update). The `ValidateValuesEvent->records` *only*
contains the updated values. So three possible different sets of data.
- A comment in the `ValidateValuesEvent` notes that it's expensive to lookup the
original values (because it would be one query per record), so avoid if possible.
The lazy array returns only the update values as 'new', not the merged array
(this is the same as in its records property). There is duplication for an
*update action* since these are already present on the event under 'records'
and are shared between all rows. However for a *save action*, there could be
per-row specific updates.
Q. where we've loaded the data (e.g. batch update) couldn't we make that available
to save the lazy function doing a one-query-per-row?RichRichhttps://lab.civicrm.org/dev/release/-/issues/235.68.1 failed to upgrade DB from 5.53.0: DB Error: constraint violation2024-01-15T11:30:51ZDmitry Smirnov5.68.1 failed to upgrade DB from 5.53.0: DB Error: constraint violationAfter successfully upgrading our staging CiviCRM from 5.53.0 to 5.68.1, upgrade of production instance failed as follows:
```
[Error: Backfill civicrm_mailing_event_queue (6 => 500005)]
Error Field Error Value
Type DB_Error
Code -3
Mess...After successfully upgrading our staging CiviCRM from 5.53.0 to 5.68.1, upgrade of production instance failed as follows:
```
[Error: Backfill civicrm_mailing_event_queue (6 => 500005)]
Error Field Error Value
Type DB_Error
Code -3
Message DB Error: constraint violation
Mode 16
UserInfo UPDATE civicrm_mailing_event_queue q INNER JOIN civicrm_mailing_job job ON job.id = q.job_id SET q.mailing_id = job.mailing_id, q.is_test=job.is_test WHERE q.id >= 6 AND q.id <= 500005 AND q.mailing_id IS NULL [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`wordpress-civicrm`.`civicrm_mailing_event_queue`, CONSTRAINT `civicrm_mailing_event_queue_ibfk_1` FOREIGN KEY (`mailing_id`) REFERENCES `civicrm_mailing` (`id`) ON DELETE SET NULL)]
DebugInfo UPDATE civicrm_mailing_event_queue q INNER JOIN civicrm_mailing_job job ON job.id = q.job_id SET q.mailing_id = job.mailing_id, q.is_test=job.is_test WHERE q.id >= 6 AND q.id <= 500005 AND q.mailing_id IS NULL [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`wordpress-civicrm`.`civicrm_mailing_event_queue`, CONSTRAINT `civicrm_mailing_event_queue_ibfk_1` FOREIGN KEY (`mailing_id`) REFERENCES `civicrm_mailing` (`id`) ON DELETE SET NULL)]
Civi\Core\Exception\DBQueryException: DB Error: constraint violation in /usr/share/php/PEAR.php on line 944
- DB_Error: DB Error: constraint violation in unknown on line unknown
```
That's on PHP-8.2, Debian 12 "Bookworm", Mariadb 10.9.3.
Please advise.https://lab.civicrm.org/dev/release/-/issues/225.68.1 Bundled non-embeddable font in "ext/greenwich" ?2024-01-15T11:29:37ZDmitry Smirnov5.68.1 Bundled non-embeddable font in "ext/greenwich" ?Debian's __lintian__ (utility) raised the following warning:
> `truetype-font-prohibits-installable-embedding` (preview/print only) `[ext/greenwich/extern/bootstrap3/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf]`
> This pack...Debian's __lintian__ (utility) raised the following warning:
> `truetype-font-prohibits-installable-embedding` (preview/print only) `[ext/greenwich/extern/bootstrap3/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf]`
> This package installs a TrueType font with restrictive license terms. The font does not permit installable embedding, as defined by the TrueType standard.
> Please refer to https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html for details.
I don't fully understand implications, or whether this file is even being used. Please advise.https://lab.civicrm.org/dev/core/-/issues/4886[5.68.1] Smarty3 fails to render contacts import summary page2024-01-05T05:36:10ZDmitry Smirnov[5.68.1] Smarty3 fails to render contacts import summary pageOn 5.68.1, contact imports created new contacts successfully (as expected) but Smarty3 failed to render import summary page in the end (showing "critical error" after import progress):
```
PHP Deprecated: Creation of dynamic property S...On 5.68.1, contact imports created new contacts successfully (as expected) but Smarty3 failed to render import summary page in the end (showing "critical error" after import progress):
```
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$assignByRef is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$getTemplateVars is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 719
PHP Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 719
PHP Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 719
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$_foreach is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Variable::$do_else is deprecated in /var/lib/wordpress/wordpress.deblab/uploads/civicrm/templates_c/en_AU/ea/e9/36/eae936c43239450b358ccf951825467f837bd49a_0.file.CMSPrint.tpl.php on line 47
PHP Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 719
PHP Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 719
PHP Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 719
PHP Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 719
PHP Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiler is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 719
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$_codeFrame is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$_filterHandler is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$getLiterals is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$addLiterals is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$setLiterals is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$getTemplateVars is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Internal_Extension_Handler::$_writeFile is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php on line 182
PHP Deprecated: Creation of dynamic property Smarty_Internal_Template::$compiled is deprecated in /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 719
PHP Deprecated: Creation of dynamic property Smarty_Variable::$do_else is deprecated in /var/lib/wordpress/wordpress.deblab/uploads/civicrm/templates_c/en_AU/97/37/f0/9737f0315707fe307f61433aafb3cf128d36ad32_0.file.Summary.tpl.php on line 328
PHP Warning: Array to string conversion in /var/lib/wordpress/wordpress.deblab/uploads/civicrm/templates_c/en_AU/97/37/f0/9737f0315707fe307f61433aafb3cf128d36ad32_0.file.Summary.tpl.php on line 354
PHP Deprecated: Creation of dynamic property Smarty_Variable::$do_else is deprecated in /var/lib/wordpress/wordpress.deblab/uploads/civicrm/templates_c/en_AU/97/37/f0/9737f0315707fe307f61433aafb3cf128d36ad32_0.file.Summary.tpl.php on line 355
PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/lib/wordpress/wordpress.deblab/uploads/civicrm/templates_c/en_AU/97/37/f0/9737f0315707fe307f61433aafb3cf128d36ad32_0.file.Summary.tpl.php:359
Stack trace:
#0 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6596ac2030b090_68456159()
#1 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#2 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#3 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()
#4 /var/lib/wordpress/wordpress.deblab/uploads/civicrm/templates_c/en_AU/cf/b0/8e/cfb08ecadba5e8b29bf41e9aae04d99380f0a23d_0.file.default.tpl.php(53): Smarty_Internal_Template->_subTemplateRender()
#5 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6596abd7042ff2_38540251()
#6 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#7 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#8 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()
#9 /var/lib/wordpress/wordpress.deblab/uploads/civicrm/templates_c/en_AU/ea/e9/36/eae936c43239450b358ccf951825467f837bd49a_0.file.CMSPrint.tpl.php(100): Smarty_Internal_Template->_subTemplateRender()
#10 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6596abd701e460_46797449()
#11 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#12 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#13 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()
#14 /var/lib/wordpress/wordpress.deblab/uploads/civicrm/templates_c/en_AU/9c/3f/c1/9c3fc145555d7a857fab0827e120d82b83d12571_0.file.wordpress.tpl.php(31): Smarty_Internal_Template->_subTemplateRender()
#15 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6596abd7001831_48089199()
#16 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#17 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#18 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render()
#19 /usr/share/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()
#20 /usr/share/civicrm/CRM/Core/QuickForm/Action/Display.php(117): Smarty_Internal_TemplateBase->fetch()
#21 /usr/share/civicrm/CRM/Core/QuickForm/Action/Display.php(83): CRM_Core_QuickForm_Action_Display->renderForm()
#22 /usr/share/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform()
#23 /usr/share/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle()
#24 /usr/share/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle()
#25 /usr/share/civicrm/CRM/Utils/Wrapper.php(98): CRM_Core_Controller->run()
#26 /usr/share/civicrm/CRM/Core/Invoke.php(292): CRM_Utils_Wrapper->run()
#27 /usr/share/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem()
#28 /usr/share/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke()
#29 /usr/share/wordpress/wp-content/plugins/civicrm/civicrm.php(1201): CRM_Core_Invoke::invoke()
#30 /usr/share/wordpress/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress->invoke()
#31 /usr/share/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#32 /usr/share/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
#33 /usr/share/wordpress/wp-admin/admin.php(259): do_action()
#34 {main}
thrown in /var/lib/wordpress/wordpress.deblab/uploads/civicrm/templates_c/en_AU/97/37/f0/9737f0315707fe307f61433aafb3cf128d36ad32_0.file.Summary.tpl.php on line 359
```
This is on Debian 12 "Bookworm" with PHP-8.2. (CiviCRM caches cleared before reproducing.)
There is no error with Smarty2.5.69.0https://lab.civicrm.org/dev/core/-/issues/4885[5.68.1] Missing Relationship Cache Trigger2024-01-15T11:28:29ZDmitry Smirnov[5.68.1] Missing Relationship Cache TriggerAfter upgrade from 5.53.0 to 5.68.1, _System Status_ page shows "Missing Relationship Cache Trigger" warning.
Attempt to "Rebuild triggers" using the provided button yields no effect.
`civicrm.civicrm_relationship_cache` table have ple...After upgrade from 5.53.0 to 5.68.1, _System Status_ page shows "Missing Relationship Cache Trigger" warning.
Attempt to "Rebuild triggers" using the provided button yields no effect.
`civicrm.civicrm_relationship_cache` table have plenty of records but no triggers.
Debug log is enabled but I could not spot any errors so "rebuilding triggers" appears to fail silently...https://lab.civicrm.org/dev/core/-/issues/4884"CiviCRM News" on Backdrop has awkward accordions on default themes2024-01-04T22:21:56Ztotten"CiviCRM News" on Backdrop has awkward accordions on default themesOn Backdrop (eg https://bmaster.demo.civicrm.org/civicrm/ ; user: `demo`; pass: `demo`) with default themes, the "CiviCRM News" dashlet is looking weird:
![Screenshot_2024-01-03_at_9.08.21_PM](/uploads/8d22ff7703e5f9eaf856a9e413be66dd/...On Backdrop (eg https://bmaster.demo.civicrm.org/civicrm/ ; user: `demo`; pass: `demo`) with default themes, the "CiviCRM News" dashlet is looking weird:
![Screenshot_2024-01-03_at_9.08.21_PM](/uploads/8d22ff7703e5f9eaf856a9e413be66dd/Screenshot_2024-01-03_at_9.08.21_PM.png)
Theories:
* At first blush, it feels like it would be a regression related to the accordion updates circa 5.69.x (eg https://lab.civicrm.org/dev/user-interface/-/issues/60). However, there's a similar problem in 5.68. This suggests that it's not a simple regression:
![Screenshot_2024-01-03_at_10.21.14_PM](/uploads/ebe6ad88b770ba5337a965cc887d194b/Screenshot_2024-01-03_at_10.21.14_PM.png)
(Note: Slightly different visual appearance with double arrows)
* Could it be that there's always been a bug like this.
* Could it be that the accordion cleanup led to changes in the news feed? In which case, maybe the question is about infra: How to make the feed(s) work with different versions of Civi?
* Interestingly, I went to an old/local copy of `bcmaster`, updated to 5.68+5.69+master, and... it seemed to display fine. But on clean builds of 5.68 and master, it didn't. (This suggests that it might still be some kind of regression.)
* (*It could be that I have a cache of an older feed? This might support the idea of an issue in how the feed works with different client environments?*)5.69.0https://lab.civicrm.org/dev/core/-/issues/4883[5.68.1] pre-minified source-less file: "bower_components/es-module-shims/dis...2024-01-29T10:13:51ZDmitry Smirnov[5.68.1] pre-minified source-less file: "bower_components/es-module-shims/dist/es-module-shims.js"`bower_components/es-module-shims/dist/es-module-shims.js` is bundled in pre-minified source-less form, which is bad practice.
Please bundle original un-compressed/un-obfuscated source, readable and modifiable by humans.
It looks like ...`bower_components/es-module-shims/dist/es-module-shims.js` is bundled in pre-minified source-less form, which is bad practice.
Please bundle original un-compressed/un-obfuscated source, readable and modifiable by humans.
It looks like bundling the following file should suffice: https://github.com/guybedford/es-module-shims/blob/1.7.2/src/es-module-shims.js
Thanks.5.70.0https://lab.civicrm.org/dev/core/-/issues/4882Fatal error / incomplete form validation: Batch Data Entry for Contributions2024-01-15T11:27:43ZAllenShawFatal error / incomplete form validation: Batch Data Entry for Contributions**Summary:**
For Batch Data Entry of contributions, incomplete validation of the "Received" column value can lead to a fatal error and import of only a subset of batch entries.
**Repro:**
To reproduce on dmaster (currently "Powered b...**Summary:**
For Batch Data Entry of contributions, incomplete validation of the "Received" column value can lead to a fatal error and import of only a subset of batch entries.
**Repro:**
To reproduce on dmaster (currently "Powered by CiviCRM 5.70.alpha1"):
1. Create a new Batch (Contributions \> Batch Data Entry : New Data Entry Batch) containing 2 or more entries.
2. For the first entry, fill all relevant fields with sensible data; important for repro: leave the Contribution Date date/time at its default value (or enter any other date/time value)
3. For the second entry, fill all relevant fields with sensible data; important for repro: delete the date portion of the Contribution Date date/time value (but ensure there is a time component. E.g. NULL date, 10:20AM)
![received.png](/uploads/f7758c48d66461ea0d77c3dc2ae63d2e/received.png)
4. Submit the form with "Validate and Process the Batch"
**Expected (good) behavior:**
* Form validation should notice that date component is empty in the second entry and alert the user that this is required.
* No entries are processed (no new contributions are created)
**Actual (bad) behavior:**
* Form is submitted without any validation errors.
* User observes fatal error: "Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. DB Error: unknown error"
* The first entry is fully processed (a new contribution is created), but no subsequent entries are processed.
* The SQL error here is:
```
"INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `payment_instrument_id` , `receive_date` , `total_amount` , `fee_amount` , `net_amount` , `invoice_id` , `invoice_number` , `currency` , `source` , `contribution_status_id` , `check_number` , `campaign_id` , `tax_amount` ) VALUES ( 45968 , 48 , 4 , 10 , 200 , 0 , 200 , NULL , 'INV_11998' , 'USD' , '2023 EOY gift' , 1 , '297' , 95 , 0 ) [nativecode=1292 ** Incorrect datetime value: '10' for column `hft_civicrm`.`civicrm_contribution`.`receive_date` at row 1]"
```
(Note that the '10' in `Incorrect datetime value: '10'` is the Hour part of the time component as submitted for the second entry.)
**Proposed fix:**
Form validation should ensure that a Date component is entered; a Time component without a Date component will result in the above misbehavior.https://lab.civicrm.org/dev/core/-/issues/4881A contribution "Pay Later" option results in PHP Fatal error: Uncaught TypeE...2024-01-05T03:42:45ZyurgA contribution "Pay Later" option results in PHP Fatal error: Uncaught TypeError: array_key_exists() ..BAO/ContributionSoft.php:506Overview
----------------------------------------
WSOD on Contribution page ( confirmed on https://wpmaster.demo.civicrm.org/contribution-page/ ) if "Pay Later" enabled - possible it is a combination of options though, see below the for...Overview
----------------------------------------
WSOD on Contribution page ( confirmed on https://wpmaster.demo.civicrm.org/contribution-page/ ) if "Pay Later" enabled - possible it is a combination of options though, see below the form configuration
Form Configuration
----------------------------------------
"Amounts" tab:
1. "Contribution Amounts" enabled
2 "Pay later option" enabled
3. **No** "Price set", fixed contribution options
4. "Allow other amounts" enabled with the "Minimum Amount" set as 0
"Membership" tab
1. "General" membership type selected, default
2. Require Membership Signup enabled
3. Separate Membership Payment enabled
4. Display Membership Fee enabled
Current behaviour
----------------------------------------
WSOD on https://wpmaster.demo.civicrm.org/civicrm/contribute/transact/?_qf_Confirm_display=true&qfKey=CRMContributeControllerContribution2dtfiluw56xww48w88wk88k4cgsg44ws8cg4o4owwkoc8s8wow_9990
PHP error log ( from the other server, obviously, since we have no access to wpmaster.demo.civicrm.org internals ):
```
PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionSoft.php:506
Stack trace:
#0 /wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionPage.php(327): CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields(Object(CRM_Core_Smarty), NULL, NULL)
#1 /wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1717): CRM_Contribute_BAO_ContributionPage::sendMail(30350, Array, false, false, Array)
#2 /wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1403): CRM_Contribute_Form_Contribution_Confirm->postProcessMembership(Array, 30350, Array, Array, Array, Array, true, NULL, false, '2', Array)
#3 /wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(2489): CRM_Contribute_Form_Contribution_Confirm->processMembership(Array, 30350, Array, Array, Array)
#4 /wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(2294): CRM_Contribute_Form_Contribution_Confirm->doMembershipProcessing(30350, Array, Array, Array)
#5 /wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(817): CRM_Contribute_Form_Contribution_Confirm->processFormSubmission(30350)
#6 /wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(622): CRM_Contribute_Form_Contribution_Confirm->postProcess()
#7 /wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php(1430): CRM_Core_Form->mainProcess()
#8 /wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php(1188): CRM_Contribute_Form_Contribution_Main->skipToThankYouPage()
#9 /wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(622): CRM_Contribute_Form_Contribution_Main->postProcess()
#10 /wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(153): CRM_Core_Form->mainProcess()
#11 /wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(120): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Contribute_Form_Contribution_Main), 'upload')
#12 /wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Contribute_Form_Contribution_Main), 'upload')
#13 /wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Main), 'upload')
#14 /wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle('upload')
#15 /wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(322): CRM_Core_Controller->run(Array, NULL)
#16 /wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem(Array)
#17 /wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke(Array)
#18 /wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke(Array)
```
Environment information
----------------------------------------
* CiviCRM: 5.68.0, CiviCRM 5.70.alpha1 (via https://wpmaster.demo.civicrm.org)
* PHP version 8.1.26
* CMS:WordPress 6.4.2
Comments
----------------------------------------
Line 506 of /wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionSoft.php:506 reads:
```
switch ($profileContactType) {
case 'Individual':
/* 506 -> */ if (array_key_exists('prefix_id', $params)) {
$honorName = CRM_Utils_Array::value($params['prefix_id'],
```
so it looks like $params are NULL at this point. Should they be or we just add _if(!empty($params_ here and let it go?5.69.0