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

civicrm release-5.64.3

parent fd6c0826
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 50 deletions
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* Plugin Name: CiviCRM * Plugin Name: CiviCRM
* Description: CiviCRM - Growing and Sustaining Relationships * Description: CiviCRM - Growing and Sustaining Relationships
* Version: 5.64.2 * Version: 5.64.3
* Requires at least: 4.9 * Requires at least: 4.9
* Requires PHP: 7.3 * Requires PHP: 7.3
* Author: CiviCRM LLC * Author: CiviCRM LLC
...@@ -36,7 +36,7 @@ if (!defined('ABSPATH')) { ...@@ -36,7 +36,7 @@ if (!defined('ABSPATH')) {
} }
// Set version here: changing it forces Javascript and CSS to reload. // Set version here: changing it forces Javascript and CSS to reload.
define('CIVICRM_PLUGIN_VERSION', '5.64.2'); define('CIVICRM_PLUGIN_VERSION', '5.64.3');
// Store reference to this file. // Store reference to this file.
if (!defined('CIVICRM_PLUGIN_FILE')) { if (!defined('CIVICRM_PLUGIN_FILE')) {
......
...@@ -67,6 +67,10 @@ trait CRM_Event_WorkflowMessage_ParticipantTrait { ...@@ -67,6 +67,10 @@ trait CRM_Event_WorkflowMessage_ParticipantTrait {
*/ */
protected $participantContacts; protected $participantContacts;
private function isCiviContributeEnabled(): bool {
return array_key_exists('Contribution', \Civi::service('action_object_provider')->getEntities());
}
/** /**
* @param array $participantContacts * @param array $participantContacts
* *
...@@ -93,7 +97,7 @@ trait CRM_Event_WorkflowMessage_ParticipantTrait { ...@@ -93,7 +97,7 @@ trait CRM_Event_WorkflowMessage_ParticipantTrait {
*/ */
public function setParticipantID(int $participantID) { public function setParticipantID(int $participantID) {
$this->participantID = $participantID; $this->participantID = $participantID;
if (!$this->getContributionID()) { if (!$this->getContributionID() && $this->isCiviContributeEnabled()) {
$lineItem = LineItem::get(FALSE) $lineItem = LineItem::get(FALSE)
->addWhere('entity_table', '=', 'civicrm_participant') ->addWhere('entity_table', '=', 'civicrm_participant')
->addWhere('entity_id', '=', $participantID) ->addWhere('entity_id', '=', $participantID)
...@@ -103,13 +107,14 @@ trait CRM_Event_WorkflowMessage_ParticipantTrait { ...@@ -103,13 +107,14 @@ trait CRM_Event_WorkflowMessage_ParticipantTrait {
$this->setContributionID($lineItem['contribution_id']); $this->setContributionID($lineItem['contribution_id']);
} }
else { else {
// no ts() since this should be rare
CRM_Core_Session::setStatus('There might be a data problem, contribution id could not be loaded from the line item');
// It might be bad data on the site - let's do a noisy fall back to participant payment // It might be bad data on the site - let's do a noisy fall back to participant payment
// (the relationship between contribution & participant should be in the line item but // (the relationship between contribution & participant should be in the line item but
// some integrations might mess this up - if they are not using the order api). // some integrations might mess this up - if they are not using the order api).
// Note that for free events there won't be a participant payment either hence moving the status message into the if statement.
$participantPayment = civicrm_api3('ParticipantPayment', 'get', ['participant_id' => $participantID])['values']; $participantPayment = civicrm_api3('ParticipantPayment', 'get', ['participant_id' => $participantID])['values'];
if (!empty($participantPayment)) { if (!empty($participantPayment)) {
// no ts() since this should be rare
CRM_Core_Session::setStatus('There might be a data problem, contribution id could not be loaded from the line item');
$participantPayment = reset($participantPayment); $participantPayment = reset($participantPayment);
$this->setContributionID((int) $participantPayment['contribution_id']); $this->setContributionID((int) $participantPayment['contribution_id']);
} }
...@@ -185,34 +190,36 @@ trait CRM_Event_WorkflowMessage_ParticipantTrait { ...@@ -185,34 +190,36 @@ trait CRM_Event_WorkflowMessage_ParticipantTrait {
} }
// Initiate with the current participant to ensure they are first. // Initiate with the current participant to ensure they are first.
$participants = [$this->participantID => ['id' => $this->participantID, 'tax_rate_breakdown' => []]]; $participants = [$this->participantID => ['id' => $this->participantID, 'tax_rate_breakdown' => []]];
foreach ($this->getLineItems() as $lineItem) { if ($this->isCiviContributeEnabled()) {
if ($lineItem['entity_table'] === 'civicrm_participant') { foreach ($this->getLineItems() as $lineItem) {
$participantID = $lineItem['entity_id']; if ($lineItem['entity_table'] === 'civicrm_participant') {
} $participantID = $lineItem['entity_id'];
else { }
// It is not clear if this could ever be true - testing the CiviCRM event else {
// form shows all line items assigned to participants but we should // It is not clear if this could ever be true - testing the CiviCRM event
// assign to primary if this can occur. // form shows all line items assigned to participants but we should
$participantID = $this->getPrimaryParticipantID(); // assign to primary if this can occur.
} $participantID = $this->getPrimaryParticipantID();
$participants[$participantID]['line_items'][] = $lineItem; }
if (!isset($participants[$participantID]['totals'])) { $participants[$participantID]['line_items'][] = $lineItem;
$participants[$participantID]['totals'] = ['total_amount_exclusive' => 0, 'tax_amount' => 0, 'total_amount_inclusive' => 0]; if (!isset($participants[$participantID]['totals'])) {
} $participants[$participantID]['totals'] = ['total_amount_exclusive' => 0, 'tax_amount' => 0, 'total_amount_inclusive' => 0];
$participants[$participantID]['totals']['total_amount_exclusive'] += $lineItem['line_total']; }
$participants[$participantID]['totals']['tax_amount'] += $lineItem['tax_amount']; $participants[$participantID]['totals']['total_amount_exclusive'] += $lineItem['line_total'];
$participants[$participantID]['totals']['total_amount_inclusive'] += ($lineItem['line_total'] + $lineItem['tax_amount']); $participants[$participantID]['totals']['tax_amount'] += $lineItem['tax_amount'];
if (!isset($participants[$participantID]['tax_rate_breakdown'])) { $participants[$participantID]['totals']['total_amount_inclusive'] += ($lineItem['line_total'] + $lineItem['tax_amount']);
$participants[$participantID]['tax_rate_breakdown'] = []; if (!isset($participants[$participantID]['tax_rate_breakdown'])) {
} $participants[$participantID]['tax_rate_breakdown'] = [];
if (!isset($participants[$participantID]['tax_rate_breakdown'][$lineItem['tax_rate']])) { }
$participants[$participantID]['tax_rate_breakdown'][$lineItem['tax_rate']] = [ if (!isset($participants[$participantID]['tax_rate_breakdown'][$lineItem['tax_rate']])) {
'amount' => 0, $participants[$participantID]['tax_rate_breakdown'][$lineItem['tax_rate']] = [
'rate' => $lineItem['tax_rate'], 'amount' => 0,
'percentage' => sprintf('%.2f', $lineItem['tax_rate']), 'rate' => $lineItem['tax_rate'],
]; 'percentage' => sprintf('%.2f', $lineItem['tax_rate']),
];
}
$participants[$participantID]['tax_rate_breakdown'][$lineItem['tax_rate']]['amount'] += $lineItem['tax_amount'];
} }
$participants[$participantID]['tax_rate_breakdown'][$lineItem['tax_rate']]['amount'] += $lineItem['tax_amount'];
} }
$count = 1; $count = 1;
......
...@@ -78,7 +78,7 @@ trait EventTestTrait { ...@@ -78,7 +78,7 @@ trait EventTestTrait {
} }
/** /**
* Create a paid event. * Create an unpaid event.
* *
* @param array $eventParameters * @param array $eventParameters
* Values to * Values to
......
...@@ -56,7 +56,12 @@ class TokenCompatSubscriber implements EventSubscriberInterface { ...@@ -56,7 +56,12 @@ class TokenCompatSubscriber implements EventSubscriberInterface {
*/ */
public function onRender(TokenRenderEvent $e): void { public function onRender(TokenRenderEvent $e): void {
$useSmarty = !empty($e->context['smarty']); $useSmarty = !empty($e->context['smarty']);
$e->string = $e->getTokenProcessor()->visitTokens($e->string, function() { $e->string = $e->getTokenProcessor()->visitTokens($e->string, function($token = NULL, $entity = NULL, $field = NULL, $filterParams = NULL) {
if ($filterParams && $filterParams[0] === 'boolean') {
// This token was missed during primary rendering, and it's supposed to be coerced to boolean.
// Treat an unknown token as false-y.
return 0;
}
// For historical consistency, we filter out unrecognized tokens. // For historical consistency, we filter out unrecognized tokens.
return ''; return '';
}); });
......
<?php <?php
/** @deprecated */ /** @deprecated */
function civicrmVersion( ) { function civicrmVersion( ) {
return array( 'version' => '5.64.2', return array( 'version' => '5.64.3',
'cms' => 'Wordpress', 'cms' => 'Wordpress',
'revision' => '' ); 'revision' => '' );
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2020-01-09</releaseDate> <releaseDate>2020-01-09</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>beta</develStage> <develStage>beta</develStage>
<compatibility> <compatibility>
<ver>5.64</ver> <ver>5.64</ver>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2020-01-09</releaseDate> <releaseDate>2020-01-09</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>beta</develStage> <develStage>beta</develStage>
<compatibility> <compatibility>
<ver>5.64</ver> <ver>5.64</ver>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2020-01-09</releaseDate> <releaseDate>2020-01-09</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>alpha</develStage> <develStage>alpha</develStage>
<compatibility> <compatibility>
<ver>5.64</ver> <ver>5.64</ver>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2020-01-09</releaseDate> <releaseDate>2020-01-09</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<tags> <tags>
<tag>mgmt:hidden</tag> <tag>mgmt:hidden</tag>
</tags> </tags>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2021-02-11</releaseDate> <releaseDate>2021-02-11</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<compatibility> <compatibility>
<ver>5.64</ver> <ver>5.64</ver>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2023-04-08</releaseDate> <releaseDate>2023-04-08</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<tags> <tags>
<tag>component</tag> <tag>component</tag>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2023-04-08</releaseDate> <releaseDate>2023-04-08</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<tags> <tags>
<tag>component</tag> <tag>component</tag>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2023-04-08</releaseDate> <releaseDate>2023-04-08</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<tags> <tags>
<tag>component</tag> <tag>component</tag>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2023-04-08</releaseDate> <releaseDate>2023-04-08</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<tags> <tags>
<tag>component</tag> <tag>component</tag>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2023-04-08</releaseDate> <releaseDate>2023-04-08</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<tags> <tags>
<tag>component</tag> <tag>component</tag>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2023-04-08</releaseDate> <releaseDate>2023-04-08</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<tags> <tags>
<tag>component</tag> <tag>component</tag>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2023-04-08</releaseDate> <releaseDate>2023-04-08</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<tags> <tags>
<tag>component</tag> <tag>component</tag>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2023-04-08</releaseDate> <releaseDate>2023-04-08</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<tags> <tags>
<tag>component</tag> <tag>component</tag>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2022-01-02</releaseDate> <releaseDate>2022-01-02</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>alpha</develStage> <develStage>alpha</develStage>
<compatibility> <compatibility>
<ver>5.64</ver> <ver>5.64</ver>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2021-11-11</releaseDate> <releaseDate>2021-11-11</releaseDate>
<version>5.64.2</version> <version>5.64.3</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<compatibility> <compatibility>
<ver>5.64</ver> <ver>5.64</ver>
......
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