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

civicrm release-5.49.2

parent c6607faf
No related branches found
No related tags found
No related merge requests found
Showing
with 94 additions and 23 deletions
......@@ -2,7 +2,7 @@
/**
* Plugin Name: CiviCRM
* Description: CiviCRM - Growing and Sustaining Relationships
* Version: 5.49.1
* Version: 5.49.2
* 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.1');
define('CIVICRM_PLUGIN_VERSION', '5.49.2');
// Store reference to this file.
if (!defined('CIVICRM_PLUGIN_FILE')) {
......
......@@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/ActionSchedule.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:444acdd7b222ed9f593b0b84aebfb763)
* (GenCodeChecksum:79492485b0099dc4a6a101f3191d64dd)
*/
/**
......@@ -67,7 +67,7 @@ class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
/**
* Is this the recipient criteria limited to OR in addition to?
*
* @var bool|string
* @var bool|string|null
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/
......@@ -512,9 +512,7 @@ class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
'type' => CRM_Utils_Type::T_BOOLEAN,
'title' => ts('Limit To'),
'description' => ts('Is this the recipient criteria limited to OR in addition to?'),
'required' => TRUE,
'where' => 'civicrm_action_schedule.limit_to',
'default' => '1',
'table_name' => 'civicrm_action_schedule',
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
......
......@@ -21,6 +21,38 @@
*/
class CRM_Upgrade_Incremental_php_FiveFortyNine extends CRM_Upgrade_Incremental_Base {
/**
* When executing 5.49.2 upgrade-step, it decides whether to fix limit-to. Remember that decision.
*
* Note: You cannot _generally_ use object-properties to communicate between functions in this class
* (because they reset in diff AJAX requests).
*
* However, you can _specifically_ communicate between `upgrade_N_N_N()` and `setPostUpgradeMessage()`.
* This is because they are guaranteed to run in the same call (as part of `doIncrementalUpgradeStep()`).
*
* @var bool|null
*/
private $executedLimitToFix;
public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) {
$willExecuteLimitToFix = (bool) version_compare(CRM_Core_BAO_Domain::version(), '5.49.beta1', '>=');
if ($rev == '5.49.2' && $willExecuteLimitToFix) {
$message = $this->createLimitToMessage();
if ($message) {
$preUpgradeMessage .= "<p>{$message}</p>";
}
}
}
public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
if ($rev == '5.49.2' && $this->executedLimitToFix === TRUE) {
$message = $this->createLimitToMessage();
if ($message) {
$postUpgradeMessage .= "<p><strong>" . ts('WARNING') . "</strong>: {$message}</p>";
}
}
}
public static function findBooleanColumns(): array {
$r = [];
$files = CRM_Utils_File::findFiles(__DIR__ . '/FiveFortyNine', '*.bool.php');
......@@ -60,6 +92,48 @@ class CRM_Upgrade_Incremental_php_FiveFortyNine extends CRM_Upgrade_Incremental_
}
}
/**
* Upgrade function.
*
* @param string $currentRev
* DB revision (which we are currently applying)
* @param string $startRev
* DB revision (when the upgrade started)
* @param string $finalRev
* DB revision (that we're aiming to reach, in the end)
*/
public function upgrade_5_49_2($currentRev, $startRev, $finalRev) {
if (empty($startRev)) {
throw new \RuntimeException("Error: Was somebody too clever about modifying the upgrader? We're missing a little-known but very-handy parameter!");
}
$this->executedLimitToFix = (bool) version_compare($startRev, '5.49.beta1', '>=');
if ($this->executedLimitToFix) {
$this->addTask('Update "civicrm_action_schedule.limit_to" to re-enable "NULL" values', 'changeBooleanColumnLimitTo');
}
}
public function createLimitToMessage(): ?string {
$suspectRecords = CRM_Core_DAO::singleValueQuery("SELECT GROUP_CONCAT(id SEPARATOR \", #\") FROM civicrm_action_schedule WHERE limit_to=0 AND (recipient_manual IS NOT NULL OR group_id IS NOT NULL)");
if (!empty($suspectRecords)) {
return ts('This site previously executed an early version of 5.49, which may have incorrectly modified some scheduled reminders. After upgrading, review these reminders (<code>%1</code>). <a %2>(Learn more...)</a>', [
1 => '#' . $suspectRecords,
2 => 'target="blank" href="https://civicrm.org/redirect/reminders-5.49"',
]);
}
else {
return NULL;
}
}
/**
* Revert boolean default civicrm_action_schedule.limit_to to be NULL
*/
public static function changeBooleanColumnLimitTo() {
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_action_schedule` CHANGE `limit_to` `limit_to` tinyint NULL COMMENT 'Is this the recipient criteria limited to OR in addition to?'", [], TRUE, NULL, FALSE, FALSE);
CRM_Core_DAO::executeQuery("UPDATE `civicrm_action_schedule` SET `limit_to` = NULL WHERE `limit_to` = 0 AND `group_id` IS NULL AND recipient_manual IS NULL", [], TRUE, NULL, FALSE, FALSE);
return TRUE;
}
/**
* Converts a boolean table column to be NOT NULL
* @param CRM_Queue_TaskContext $ctx
......
<?php
return [
'civicrm_action_schedule' => [
'limit_to' => "DEFAULT 1 COMMENT 'Is this the recipient criteria limited to OR in addition to?'",
'is_repeat' => "DEFAULT 0",
'is_active' => "DEFAULT 1 COMMENT 'Is this option active?'",
'record_activity' => "DEFAULT 0 COMMENT 'Record Activity for this reminder?'",
......
<?php
/** @deprecated */
function civicrmVersion( ) {
return array( 'version' => '5.49.1',
return array( 'version' => '5.49.2',
'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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</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.1</version>
<version>5.49.2</version>
<develStage>stable</develStage>
<tags>
<tag>mgmt:hidden</tag>
......
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