Skip to content
Snippets Groups Projects
Verified Commit cc5d3855 authored by Kevin Cristiano's avatar Kevin Cristiano :earth_americas:
Browse files

civicrm release-5.49.4

parent c8577579
No related branches found
No related tags found
No related merge requests found
Showing
with 46 additions and 38 deletions
......@@ -2,7 +2,7 @@
/**
* Plugin Name: CiviCRM
* Description: CiviCRM - Growing and Sustaining Relationships
* Version: 5.49.3
* Version: 5.49.4
* Requires at least: 4.9
* Requires PHP: 7.2
* Author: CiviCRM LLC
......@@ -36,7 +36,7 @@ if (!defined('ABSPATH')) {
}
// Set version here: changing it forces Javascript and CSS to reload.
define('CIVICRM_PLUGIN_VERSION', '5.49.3');
define('CIVICRM_PLUGIN_VERSION', '5.49.4');
// Store reference to this file.
if (!defined('CIVICRM_PLUGIN_FILE')) {
......
......@@ -244,7 +244,7 @@ class CRM_Utils_Recent {
}
elseif ($event->action === 'edit') {
if (isset($event->object->is_deleted)) {
\Civi\Api4\RecentItem::update()
\Civi\Api4\RecentItem::update(FALSE)
->addWhere('entity_type', '=', $entityType)
->addWhere('entity_id', '=', $event->id)
->addValue('is_deleted', (bool) $event->object->is_deleted)
......
......@@ -89,8 +89,11 @@ class ChainSubscriber implements EventSubscriberInterface {
$oldResult = $result;
$result = ['values' => [0 => $oldResult]];
}
// Scan the params for chain calls.
foreach ($params as $field => $newparams) {
if ((is_array($newparams) || $newparams === 1) && $field <> 'api.has_parent' && substr($field, 0, 3) == 'api') {
// This param is a chain call, e.g. api.<entity>.<action>
// 'api.participant.delete' => 1 is a valid options - handle 1
// instead of an array
......@@ -105,9 +108,13 @@ class ChainSubscriber implements EventSubscriberInterface {
$subAPI = explode($separator, $field);
$subaction = empty($subAPI[2]) ? $action : $subAPI[2];
$subParams = [
/** @var array of parameters that will be applied to every chained request. */
$enforcedSubParams = [
'debug' => $params['debug'] ?? NULL,
];
/** @var array of parameters that provide defaults to every chained request, but which may be overridden by parameters in the chained request. */
$defaultSubParams = [];
$subEntity = _civicrm_api_get_entity_name_from_camel($subAPI[1]);
// Hard coded list of entitys that have fields starting api_ and shouldn't be automatically
......@@ -131,8 +138,8 @@ class ChainSubscriber implements EventSubscriberInterface {
//from the parent call. in this case 'contact_id' will also be
//set to the parent's id
if (!($subEntity == 'line_item' && $lowercase_entity == 'contribution' && $action != 'create')) {
$subParams["entity_id"] = $parentAPIValues['id'];
$subParams['entity_table'] = 'civicrm_' . $lowercase_entity;
$defaultSubParams["entity_id"] = $parentAPIValues['id'];
$defaultSubParams['entity_table'] = 'civicrm_' . $lowercase_entity;
}
$addEntityId = TRUE;
......@@ -150,38 +157,39 @@ class ChainSubscriber implements EventSubscriberInterface {
}
}
if ($addEntityId) {
$subParams[$lowercase_entity . "_id"] = $parentAPIValues['id'];
$defaultSubParams[$lowercase_entity . "_id"] = $parentAPIValues['id'];
}
}
// @todo remove strtolower: $subEntity is already lower case
if ($entity != 'Contact' && \CRM_Utils_Array::value(strtolower($subEntity . "_id"), $parentAPIValues)) {
//e.g. if event_id is in the values returned & subentity is event
//then pass in event_id as 'id' don't do this for contact as it
//does some weird things like returning primary email &
//thus limiting the ability to chain email
//TODO - this might need the camel treatment
$subParams['id'] = $parentAPIValues[$subEntity . "_id"];
$defaultSubParams['id'] = $parentAPIValues[$subEntity . "_id"];
}
if (\CRM_Utils_Array::value('entity_table', $result['values'][$idIndex]) == $subEntity) {
$subParams['id'] = $result['values'][$idIndex]['entity_id'];
$defaultSubParams['id'] = $result['values'][$idIndex]['entity_id'];
}
// if we are dealing with the same entity pass 'id' through
// (useful for get + delete for example)
if ($lowercase_entity == $subEntity) {
$subParams['id'] = $result['values'][$idIndex]['id'];
$defaultSubParams['id'] = $result['values'][$idIndex]['id'];
}
$subParams['version'] = $version;
if (!empty($params['check_permissions'])) {
$subParams['check_permissions'] = $params['check_permissions'];
}
$subParams['sequential'] = 1;
$subParams['api.has_parent'] = 1;
$enforcedSubParams['version'] = $version;
// Copy check_permissions from parent.
$enforcedSubParams['check_permissions'] = $params['check_permissions'] ?? NULL;
$enforcedSubParams['sequential'] = 1;
$enforcedSubParams['api.has_parent'] = 1;
// Inspect $newparams, the passed in params for the chain call.
if (array_key_exists(0, $newparams)) {
$genericParams = $subParams;
// it is a numerically indexed array - ie. multiple creates
// It is a numerically indexed array - ie. multiple creates
foreach ($newparams as $entityparams) {
$subParams = array_merge($genericParams, $entityparams);
// Defaults, overridden by request params, overridden by enforced params.
$subParams = array_merge($defaultSubParams, $entityparams, $enforcedSubParams);
_civicrm_api_replace_variables($subParams, $result['values'][$idIndex], $separator);
$result['values'][$idIndex][$field][] = $apiKernel->runSafe($subEntity, $subaction, $subParams);
if ($result['is_error'] === 1) {
......@@ -190,8 +198,8 @@ class ChainSubscriber implements EventSubscriberInterface {
}
}
else {
$subParams = array_merge($subParams, $newparams);
// Defaults, overridden by request params, overridden by enforced params.
$subParams = array_merge($defaultSubParams, $newparams, $enforcedSubParams);
_civicrm_api_replace_variables($subParams, $result['values'][$idIndex], $separator);
$result['values'][$idIndex][$field] = $apiKernel->runSafe($subEntity, $subaction, $subParams);
if (!empty($result['is_error'])) {
......
<?php
/** @deprecated */
function civicrmVersion( ) {
return array( 'version' => '5.49.3',
return array( 'version' => '5.49.4',
'cms' => 'Wordpress',
'revision' => '' );
}
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-01-09</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>beta</develStage>
<compatibility>
<ver>5.23</ver>
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-01-09</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>beta</develStage>
<compatibility>
<ver>5.23</ver>
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-01-09</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>alpha</develStage>
<compatibility>
<ver>5.23</ver>
......
......@@ -12,7 +12,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-01-09</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<tags>
<tag>mgmt:hidden</tag>
</tags>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-02-11</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>alpha</develStage>
<compatibility>
<ver>5.0</ver>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2022-01-02</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>alpha</develStage>
<compatibility>
<ver>5.47</ver>
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-11-11</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.47</ver>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">https://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-05-23</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.39</ver>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-10-12</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.32</ver>
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-08-03</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<tags>
<tag>mgmt:hidden</tag>
</tags>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-10-07</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<tags>
<tag>mgmt:hidden</tag>
</tags>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-08-27</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.30</ver>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-08-05</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>stable</develStage>
<comments>
FlexMailer is an email delivery engine which replaces the internal guts
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-07-21</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<tags>
<tag>mgmt:hidden</tag>
</tags>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-07-25</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<develStage>stable</develStage>
<tags>
<tag>mgmt:hidden</tag>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-06-12</releaseDate>
<version>5.49.3</version>
<version>5.49.4</version>
<tags>
<tag>mgmt:hidden</tag>
</tags>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment