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

civicrm release-5.54.1

parent 9a37c279
No related branches found
No related tags found
No related merge requests found
Showing
with 74 additions and 32 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.54.0 * Version: 5.54.1
* Requires at least: 4.9 * Requires at least: 4.9
* Requires PHP: 7.2 * Requires PHP: 7.2
* 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.54.0'); define('CIVICRM_PLUGIN_VERSION', '5.54.1');
// Store reference to this file. // Store reference to this file.
if (!defined('CIVICRM_PLUGIN_FILE')) { if (!defined('CIVICRM_PLUGIN_FILE')) {
......
...@@ -78,7 +78,7 @@ class CRM_Badge_BAO_Badge { ...@@ -78,7 +78,7 @@ class CRM_Badge_BAO_Badge {
* @return array * @return array
* row with meta data * row with meta data
*/ */
public static function formatLabel(&$row, &$layout) { public static function formatLabel(array $row, array $layout): array {
$formattedRow = ['labelFormat' => $layout['label_format_name']]; $formattedRow = ['labelFormat' => $layout['label_format_name']];
$formattedRow['labelTitle'] = $layout['title']; $formattedRow['labelTitle'] = $layout['title'];
$formattedRow['labelId'] = $layout['id']; $formattedRow['labelId'] = $layout['id'];
...@@ -149,16 +149,16 @@ class CRM_Badge_BAO_Badge { ...@@ -149,16 +149,16 @@ class CRM_Badge_BAO_Badge {
/** /**
* @param array $formattedRow * @param array $formattedRow
*/ */
public function generateLabel($formattedRow) { public function generateLabel(array $formattedRow): void {
switch ($formattedRow['labelFormat']) { switch ($formattedRow['labelFormat']) {
case 'A6 Badge Portrait 150x106': case 'A6 Badge Portrait 150x106':
case 'Hanging Badge 3-3/4" x 4-3"/4': case 'Hanging Badge 3-3/4" x 4-3"/4':
self::labelCreator($formattedRow, 5); $this->labelCreator($formattedRow, 5);
break; break;
case 'Avery 5395': case 'Avery 5395':
default: default:
self::labelCreator($formattedRow); $this->labelCreator($formattedRow);
break; break;
} }
} }
...@@ -167,7 +167,7 @@ class CRM_Badge_BAO_Badge { ...@@ -167,7 +167,7 @@ class CRM_Badge_BAO_Badge {
* @param array $formattedRow * @param array $formattedRow
* @param int $cellspacing * @param int $cellspacing
*/ */
public function labelCreator(&$formattedRow, $cellspacing = 0) { public function labelCreator($formattedRow, $cellspacing = 0) {
$this->lMarginLogo = 18; $this->lMarginLogo = 18;
$this->tMarginName = 20; $this->tMarginName = 20;
...@@ -229,7 +229,7 @@ class CRM_Badge_BAO_Badge { ...@@ -229,7 +229,7 @@ class CRM_Badge_BAO_Badge {
for ($i = 1; $i <= $rowCount; $i++) { for ($i = 1; $i <= $rowCount; $i++) {
if (!empty($formattedRow['token'][$i]['token'])) { if (!empty($formattedRow['token'][$i]['token'])) {
$value = ''; $value = '';
if ($formattedRow['token'][$i]['token'] != 'spacer') { if ($formattedRow['token'][$i]['token'] !== 'spacer') {
$value = $formattedRow['token'][$i]['value']; $value = $formattedRow['token'][$i]['value'];
} }
...@@ -256,7 +256,7 @@ class CRM_Badge_BAO_Badge { ...@@ -256,7 +256,7 @@ class CRM_Badge_BAO_Badge {
if (!empty($formattedRow['barcode'])) { if (!empty($formattedRow['barcode'])) {
$data = $formattedRow['values']; $data = $formattedRow['values'];
if ($formattedRow['barcode']['type'] == 'barcode') { if ($formattedRow['barcode']['type'] === 'barcode') {
$data['current_value'] = $formattedRow['values']['contact_id'] . '-' . $formattedRow['values']['participant_id']; $data['current_value'] = $formattedRow['values']['contact_id'] . '-' . $formattedRow['values']['participant_id'];
} }
else { else {
...@@ -457,6 +457,8 @@ class CRM_Badge_BAO_Badge { ...@@ -457,6 +457,8 @@ class CRM_Badge_BAO_Badge {
} }
$tokenProcessor->evaluate(); $tokenProcessor->evaluate();
foreach ($tokenProcessor->getRows() as $row) { foreach ($tokenProcessor->getRows() as $row) {
$rows[$row->context['participantId']]['contact_id'] = $row->context['contactId'];
$rows[$row->context['participantId']]['participant_id'] = $row->context['participantId'];
foreach ($processorTokens as $processorToken) { foreach ($processorTokens as $processorToken) {
$rows[$row->context['participantId']][$processorToken] = $row->render($processorToken); $rows[$row->context['participantId']][$processorToken] = $row->render($processorToken);
} }
......
...@@ -25,12 +25,12 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { ...@@ -25,12 +25,12 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
/** /**
* Build the form object. * Build the form object.
*/ */
public function buildQuickForm() { public function buildQuickForm(): void {
if ($this->_action & CRM_Core_Action::DELETE) { if ($this->_action & CRM_Core_Action::DELETE) {
return parent::buildQuickForm(); parent::buildQuickForm();
return;
} }
$config = CRM_Core_Config::singleton();
$resources = CRM_Core_Resources::singleton(); $resources = CRM_Core_Resources::singleton();
$resources->addSetting( $resources->addSetting(
[ [
...@@ -140,8 +140,8 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { ...@@ -140,8 +140,8 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
*/ */
public function setDefaultValues() { public function setDefaultValues() {
if (isset($this->_id)) { if (isset($this->_id)) {
$defaults = array_merge($this->_values, $data = empty($this->_values['data']) ? '{}' : $this->_values['data'];
CRM_Badge_BAO_Layout::getDecodedData(CRM_Utils_Array::value('data', $this->_values, '[]'))); $defaults = array_merge($this->_values, json_decode($data, TRUE));
} }
else { else {
for ($i = 1; $i <= self::FIELD_ROWCOUNT; $i++) { for ($i = 1; $i <= self::FIELD_ROWCOUNT; $i++) {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
use Civi\Api4\Contact; use Civi\Api4\Contact;
use Civi\Api4\RelationshipType; use Civi\Api4\RelationshipType;
use Civi\Api4\StateProvince; use Civi\Api4\StateProvince;
use Civi\Api4\DedupeRuleGroup;
require_once 'api/v3/utils.php'; require_once 'api/v3/utils.php';
...@@ -1633,7 +1634,19 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { ...@@ -1633,7 +1634,19 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser {
if (isset($params['relationship'])) { if (isset($params['relationship'])) {
unset($params['relationship']); unset($params['relationship']);
} }
$id = $this->getPossibleContactMatch($params, $extIDMatch, $this->getSubmittedValue('dedupe_rule_id') ?: NULL); $ruleId = $this->getSubmittedValue('dedupe_rule_id') ?: NULL;
// if this is not the main contact and the contact types are not the same
$mainContactType = $this->getSubmittedValue('contactType');
if (!$isMainContact && $params['contact_type'] !== $mainContactType) {
// use the unsupervised dedupe rule for this contact type
$ruleId = DedupeRuleGroup::get(FALSE)
->addSelect('id')
->addWhere('contact_type', '=', $params['contact_type'])
->addWhere('used', '=', 'Unsupervised')
->execute()
->first()['id'];
}
$id = $this->getPossibleContactMatch($params, $extIDMatch, $ruleId);
if ($id && $isMainContact && $this->isSkipDuplicates()) { if ($id && $isMainContact && $this->isSkipDuplicates()) {
throw new CRM_Core_Exception(ts('Contact matched by dedupe rule already exists in the database.'), CRM_Import_Parser::DUPLICATE); throw new CRM_Core_Exception(ts('Contact matched by dedupe rule already exists in the database.'), CRM_Import_Parser::DUPLICATE);
} }
......
...@@ -65,7 +65,6 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { ...@@ -65,7 +65,6 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser {
* @param array $mapperKeys * @param array $mapperKeys
*/ */
public function __construct(&$mapperKeys = []) { public function __construct(&$mapperKeys = []) {
parent::__construct();
$this->_mapperKeys = &$mapperKeys; $this->_mapperKeys = &$mapperKeys;
} }
......
...@@ -225,6 +225,9 @@ class CRM_Extension_Manager { ...@@ -225,6 +225,9 @@ class CRM_Extension_Manager {
} }
$this->refresh(); $this->refresh();
// It might be useful to reset the container, but (given dev/core#3686) that's not likely to do much.
// \Civi::reset();
// \CRM_Core_Config::singleton(TRUE, TRUE);
CRM_Core_Invoke::rebuildMenuAndCaches(TRUE); CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
} }
...@@ -311,6 +314,8 @@ class CRM_Extension_Manager { ...@@ -311,6 +314,8 @@ class CRM_Extension_Manager {
$this->statuses = NULL; $this->statuses = NULL;
$this->mapper->refresh(); $this->mapper->refresh();
if (!CRM_Core_Config::isUpgradeMode()) { if (!CRM_Core_Config::isUpgradeMode()) {
\Civi::reset();
\CRM_Core_Config::singleton(TRUE, TRUE);
CRM_Core_Invoke::rebuildMenuAndCaches(TRUE); CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
$schema = new CRM_Logging_Schema(); $schema = new CRM_Logging_Schema();
...@@ -422,6 +427,8 @@ class CRM_Extension_Manager { ...@@ -422,6 +427,8 @@ class CRM_Extension_Manager {
$this->statuses = NULL; $this->statuses = NULL;
$this->mapper->refresh(); $this->mapper->refresh();
\Civi::reset();
\CRM_Core_Config::singleton(TRUE, TRUE);
CRM_Core_Invoke::rebuildMenuAndCaches(TRUE); CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
$this->popProcess($keys); $this->popProcess($keys);
...@@ -480,6 +487,8 @@ class CRM_Extension_Manager { ...@@ -480,6 +487,8 @@ class CRM_Extension_Manager {
$this->statuses = NULL; $this->statuses = NULL;
$this->mapper->refresh(); $this->mapper->refresh();
// At the analogous step of `install()` or `disable()`, it would reset the container.
// But here, the extension goes from "disabled=>uninstall". All we really need is to reconcile mgd's.
CRM_Core_Invoke::rebuildMenuAndCaches(TRUE); CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
$this->popProcess($keys); $this->popProcess($keys);
} }
......
...@@ -34,6 +34,10 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base { ...@@ -34,6 +34,10 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base {
$this->callHook($info, 'enable'); $this->callHook($info, 'enable');
} }
public function onPostInstall(CRM_Extension_Info $info) {
\Civi\Core\ClassScanner::cache('index')->flush();
}
/** /**
* @param CRM_Extension_Info $info * @param CRM_Extension_Info $info
*/ */
...@@ -80,6 +84,7 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base { ...@@ -80,6 +84,7 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base {
* @param CRM_Extension_Info $info * @param CRM_Extension_Info $info
*/ */
public function onPostUninstall(CRM_Extension_Info $info) { public function onPostUninstall(CRM_Extension_Info $info) {
\Civi\Core\ClassScanner::cache('index')->flush();
} }
/** /**
...@@ -89,6 +94,10 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base { ...@@ -89,6 +94,10 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base {
$this->callHook($info, 'disable'); $this->callHook($info, 'disable');
} }
public function onPostDisable(CRM_Extension_Info $info) {
\Civi\Core\ClassScanner::cache('index')->flush();
}
/** /**
* @param CRM_Extension_Info $info * @param CRM_Extension_Info $info
*/ */
...@@ -97,6 +106,10 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base { ...@@ -97,6 +106,10 @@ class CRM_Extension_Manager_Module extends CRM_Extension_Manager_Base {
$this->callHook($info, 'enable'); $this->callHook($info, 'enable');
} }
public function onPostEnable(CRM_Extension_Info $info) {
\Civi\Core\ClassScanner::cache('index')->flush();
}
public function onPostReplace(CRM_Extension_Info $oldInfo, CRM_Extension_Info $newInfo) { public function onPostReplace(CRM_Extension_Info $oldInfo, CRM_Extension_Info $newInfo) {
// Like everything, ClassScanner is probably affected by pre-existing/long-standing issue dev/core#3686. // Like everything, ClassScanner is probably affected by pre-existing/long-standing issue dev/core#3686.
// This may mitigate a couple edge-cases. But really #3686 needs a different+deeper fix. // This may mitigate a couple edge-cases. But really #3686 needs a different+deeper fix.
......
...@@ -671,7 +671,7 @@ abstract class CRM_Import_Parser implements UserJobInterface { ...@@ -671,7 +671,7 @@ abstract class CRM_Import_Parser implements UserJobInterface {
$queue = Civi::queue('user_job_' . $this->getUserJobID(), ['type' => 'Sql', 'error' => 'abort', 'runner' => 'task', 'user_job_id' => $this->getUserJobID()]); $queue = Civi::queue('user_job_' . $this->getUserJobID(), ['type' => 'Sql', 'error' => 'abort', 'runner' => 'task', 'user_job_id' => $this->getUserJobID()]);
UserJob::update(FALSE)->setValues(['queue_id.name' => 'user_job_' . $this->getUserJobID()])->addWhere('id', '=', $this->getUserJobID())->execute(); UserJob::update(FALSE)->setValues(['queue_id.name' => 'user_job_' . $this->getUserJobID()])->addWhere('id', '=', $this->getUserJobID())->execute();
$offset = 0; $offset = 0;
$batchSize = 5; $batchSize = 50;
while ($totalRows > 0) { while ($totalRows > 0) {
if ($totalRows < $batchSize) { if ($totalRows < $batchSize) {
$batchSize = $totalRows; $batchSize = $totalRows;
......
...@@ -65,21 +65,25 @@ class Container { ...@@ -65,21 +65,25 @@ class Container {
return $containerBuilder; return $containerBuilder;
} }
$envId = \CRM_Core_Config_Runtime::getId(); $envId = md5(implode(',', array_merge(
[\CRM_Core_Config_Runtime::getId()],
array_column(\CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles(), 'prefix')
)));
$file = \Civi::paths()->getPath("[civicrm.compile]/CachedCiviContainer.{$envId}.php"); $file = \Civi::paths()->getPath("[civicrm.compile]/CachedCiviContainer.{$envId}.php");
$containerCacheClass = "CachedCiviContainer_{$envId}";
$containerConfigCache = new ConfigCache($file, $cacheMode === 'auto'); $containerConfigCache = new ConfigCache($file, $cacheMode === 'auto');
if (!$containerConfigCache->isFresh()) { if (!$containerConfigCache->isFresh()) {
$containerBuilder = $this->createContainer(); $containerBuilder = $this->createContainer();
$containerBuilder->compile(); $containerBuilder->compile();
$dumper = new PhpDumper($containerBuilder); $dumper = new PhpDumper($containerBuilder);
$containerConfigCache->write( $containerConfigCache->write(
$dumper->dump(['class' => 'CachedCiviContainer']), $dumper->dump(['class' => $containerCacheClass]),
$containerBuilder->getResources() $containerBuilder->getResources()
); );
} }
require_once $file; require_once $file;
$c = new \CachedCiviContainer(); $c = new $containerCacheClass();
return $c; return $c;
} }
......
<?php <?php
/** @deprecated */ /** @deprecated */
function civicrmVersion( ) { function civicrmVersion( ) {
return array( 'version' => '5.54.0', return array( 'version' => '5.54.1',
'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.54.0</version> <version>5.54.1</version>
<develStage>beta</develStage> <develStage>beta</develStage>
<compatibility> <compatibility>
<ver>5.54</ver> <ver>5.54</ver>
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
</civix> </civix>
<classloader> <classloader>
<psr4 prefix="Civi\" path="Civi"/> <psr4 prefix="Civi\" path="Civi"/>
<psr0 prefix="CRM_" path="."/>
</classloader> </classloader>
<mixins> <mixins>
<mixin>ang-php@1.0.0</mixin> <mixin>ang-php@1.0.0</mixin>
......
...@@ -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.54.0</version> <version>5.54.1</version>
<develStage>beta</develStage> <develStage>beta</develStage>
<compatibility> <compatibility>
<ver>5.54</ver> <ver>5.54</ver>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
</civix> </civix>
<classloader> <classloader>
<psr4 prefix="Civi\" path="Civi"/> <psr4 prefix="Civi\" path="Civi"/>
<psr0 prefix="CRM_" path="."/>
</classloader> </classloader>
<requires> <requires>
<ext>authx</ext> <ext>authx</ext>
......
...@@ -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.54.0</version> <version>5.54.1</version>
<develStage>alpha</develStage> <develStage>alpha</develStage>
<compatibility> <compatibility>
<ver>5.54</ver> <ver>5.54</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.54.0</version> <version>5.54.1</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.54.0</version> <version>5.54.1</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<compatibility> <compatibility>
<ver>5.54</ver> <ver>5.54</ver>
......
...@@ -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.54.0</version> <version>5.54.1</version>
<develStage>alpha</develStage> <develStage>alpha</develStage>
<compatibility> <compatibility>
<ver>5.54</ver> <ver>5.54</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.54.0</version> <version>5.54.1</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<compatibility> <compatibility>
<ver>5.54</ver> <ver>5.54</ver>
......
...@@ -167,9 +167,9 @@ foreach ($importEntities as $importEntity) { ...@@ -167,9 +167,9 @@ foreach ($importEntities as $importEntity) {
], ],
[ [
'type' => 'field', 'type' => 'field',
'key' => 'COUNT__id', 'key' => 'COUNT_id',
'dataType' => 'Integer', 'dataType' => 'Integer',
'label' => '', 'label' => E::ts('Number of rows'),
'sortable' => TRUE, 'sortable' => TRUE,
], ],
], ],
......
...@@ -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-08-11</releaseDate> <releaseDate>2022-08-11</releaseDate>
<version>5.54.0</version> <version>5.54.1</version>
<develStage>alpha</develStage> <develStage>alpha</develStage>
<compatibility> <compatibility>
<ver>5.54</ver> <ver>5.54</ver>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<url desc="Licensing">https://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">https://www.gnu.org/licenses/agpl-3.0.html</url>
</urls> </urls>
<releaseDate>2021-05-23</releaseDate> <releaseDate>2021-05-23</releaseDate>
<version>5.54.0</version> <version>5.54.1</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<compatibility> <compatibility>
<ver>5.54</ver> <ver>5.54</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