From 20b496c54b62716073e31cd1bf04dd2c8b4edd47 Mon Sep 17 00:00:00 2001
From: Kevin Cristiano <kcristiano@kcristiano.com>
Date: Thu, 26 Jan 2023 07:34:28 -0500
Subject: [PATCH] civicrm release-5.57.2

---
 civicrm.php                                   |  4 +-
 .../Event/Form/ManageEvent/Registration.php   | 20 +++++----
 .../Event/Form/ParticipantFeeSelection.php    |  2 +-
 .../Incremental/php/FiveFiftySeven.php        | 24 ++++++++--
 civicrm/CRM/Utils/Check/Component/Schema.php  | 35 +++++++++++++++
 civicrm/ang/crmUi.js                          |  2 +-
 civicrm/civicrm-version.php                   |  2 +-
 civicrm/ext/afform/admin/info.xml             |  2 +-
 civicrm/ext/afform/core/info.xml              |  2 +-
 civicrm/ext/afform/html/info.xml              |  2 +-
 civicrm/ext/afform/mock/info.xml              |  2 +-
 civicrm/ext/authx/info.xml                    |  2 +-
 civicrm/ext/civicrm_admin_ui/info.xml         |  2 +-
 civicrm/ext/civigrant/info.xml                |  2 +-
 civicrm/ext/civiimport/info.xml               |  2 +-
 civicrm/ext/ckeditor4/info.xml                |  2 +-
 .../ext/contributioncancelactions/info.xml    |  2 +-
 civicrm/ext/elavon/info.xml                   |  2 +-
 civicrm/ext/eventcart/info.xml                |  2 +-
 civicrm/ext/ewaysingle/info.xml               |  2 +-
 civicrm/ext/financialacls/info.xml            |  2 +-
 civicrm/ext/flexmailer/info.xml               |  2 +-
 civicrm/ext/greenwich/info.xml                |  2 +-
 civicrm/ext/legacycustomsearches/info.xml     |  2 +-
 civicrm/ext/message_admin/info.xml            |  2 +-
 civicrm/ext/oauth-client/info.xml             |  2 +-
 civicrm/ext/payflowpro/info.xml               |  2 +-
 civicrm/ext/recaptcha/info.xml                |  2 +-
 civicrm/ext/search_kit/info.xml               |  2 +-
 civicrm/ext/sequentialcreditnotes/info.xml    |  2 +-
 civicrm/release-notes.md                      |  9 ++++
 civicrm/release-notes/5.57.2.md               | 44 +++++++++++++++++++
 civicrm/sql/civicrm_data.mysql                |  2 +-
 civicrm/sql/civicrm_generated.mysql           |  2 +-
 .../Event/Form/ManageEvent/Registration.tpl   |  2 +-
 civicrm/vendor/autoload.php                   |  2 +-
 civicrm/vendor/composer/autoload_real.php     | 14 +++---
 civicrm/vendor/composer/autoload_static.php   | 12 ++---
 civicrm/vendor/composer/include_paths.php     |  2 +-
 civicrm/vendor/composer/installed.php         |  4 +-
 civicrm/xml/version.xml                       |  2 +-
 41 files changed, 169 insertions(+), 61 deletions(-)
 create mode 100644 civicrm/release-notes/5.57.2.md

diff --git a/civicrm.php b/civicrm.php
index a7b7be332b..ef6f04f1ec 100644
--- a/civicrm.php
+++ b/civicrm.php
@@ -2,7 +2,7 @@
 /**
  * Plugin Name: CiviCRM
  * Description: CiviCRM - Growing and Sustaining Relationships
- * Version: 5.57.1
+ * Version: 5.57.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.57.1');
+define('CIVICRM_PLUGIN_VERSION', '5.57.2');
 
 // Store reference to this file.
 if (!defined('CIVICRM_PLUGIN_FILE')) {
diff --git a/civicrm/CRM/Event/Form/ManageEvent/Registration.php b/civicrm/CRM/Event/Form/ManageEvent/Registration.php
index c2b186cddd..babb08cc9f 100644
--- a/civicrm/CRM/Event/Form/ManageEvent/Registration.php
+++ b/civicrm/CRM/Event/Form/ManageEvent/Registration.php
@@ -116,8 +116,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
           $defaults["custom_post_id_multiple[$key]"] = $value;
         }
       }
-
-      $this->assign('profilePostMultiple', CRM_Utils_Array::value('custom_post', $defaults));
+      $this->assign('profilePostMultiple', $defaults['custom_post'] ?? NULL);
 
       // CRM-17745: Make max additional participants configurable
       if (empty($defaults['max_additional_participants'])) {
@@ -149,7 +148,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
             $defaults["additional_custom_post_id_multiple[$key]"] = $value;
           }
         }
-        $this->assign('profilePostMultipleAdd', CRM_Utils_Array::value('additional_custom_post', $defaults, []));
+        $this->assign('profilePostMultipleAdd', $defaults['additional_custom_post'] ?? []);
       }
       else {
         // Avoid PHP notices in the template
@@ -161,10 +160,10 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
     }
 
     // provide defaults for required fields if empty (and as a 'hint' for approval message field)
-    $defaults['registration_link_text'] = CRM_Utils_Array::value('registration_link_text', $defaults, ts('Register Now'));
-    $defaults['confirm_title'] = CRM_Utils_Array::value('confirm_title', $defaults, ts('Confirm Your Registration Information'));
-    $defaults['thankyou_title'] = CRM_Utils_Array::value('thankyou_title', $defaults, ts('Thank You for Registering'));
-    $defaults['approval_req_text'] = CRM_Utils_Array::value('approval_req_text', $defaults, ts('Participation in this event requires approval. Submit your registration request here. Once approved, you will receive an email with a link to a web page where you can complete the registration process.'));
+    $defaults['registration_link_text'] = $defaults['registration_link_text'] ?? ts('Register Now');
+    $defaults['confirm_title'] = $defaults['confirm_title'] ?? ts('Confirm Your Registration Information');
+    $defaults['thankyou_title'] = $defaults['thankyou_title'] ?? ts('Thank You for Registering');
+    $defaults['approval_req_text'] = $defaults['approval_req_text'] ?? ts('Participation in this event requires approval. Submit your registration request here. Once approved, you will receive an email with a link to a web page where you can complete the registration process.');
 
     return $defaults;
   }
@@ -442,10 +441,13 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
   public static function formRule($values, $files, $form) {
     if (!empty($values['is_online_registration'])) {
 
-      if (!$values['confirm_title']) {
+      if (($values['registration_link_text'] ?? '') === '') {
+        $errorMsg['registration_link_text'] = ts('Please enter Registration Link Text');
+      }
+      if (($values['confirm_title'] ?? '') === '') {
         $errorMsg['confirm_title'] = ts('Please enter a Title for the registration Confirmation Page');
       }
-      if (!$values['thankyou_title']) {
+      if (($values['thankyou_title'] ?? '') === '') {
         $errorMsg['thankyou_title'] = ts('Please enter a Title for the registration Thank-you Page');
       }
       if ($values['is_email_confirm']) {
diff --git a/civicrm/CRM/Event/Form/ParticipantFeeSelection.php b/civicrm/CRM/Event/Form/ParticipantFeeSelection.php
index 6160faf18d..18941b4911 100644
--- a/civicrm/CRM/Event/Form/ParticipantFeeSelection.php
+++ b/civicrm/CRM/Event/Form/ParticipantFeeSelection.php
@@ -346,7 +346,7 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
     $this->_contributorDisplayName = ($this->_contributorDisplayName == ' ') ? $this->_contributorEmail : $this->_contributorDisplayName;
 
     $waitStatus = CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Waiting'");
-    $this->assign('isOnWaitlist', (bool) ($params['status_id'][$waitStatus] ?? FALSE));
+    $this->assign('isOnWaitlist', (bool) in_array($params['status_id'], $waitStatus));
     $this->assign('contactID', $this->_contactId);
 
     $sendTemplateParams = [
diff --git a/civicrm/CRM/Upgrade/Incremental/php/FiveFiftySeven.php b/civicrm/CRM/Upgrade/Incremental/php/FiveFiftySeven.php
index 08f80045a0..eb0464079d 100644
--- a/civicrm/CRM/Upgrade/Incremental/php/FiveFiftySeven.php
+++ b/civicrm/CRM/Upgrade/Incremental/php/FiveFiftySeven.php
@@ -21,10 +21,26 @@
  */
 class CRM_Upgrade_Incremental_php_FiveFiftySeven extends CRM_Upgrade_Incremental_Base {
 
+  /**
+   * How many activities before the queries used here are slow. Guessing.
+   */
+  const ACTIVITY_THRESHOLD = 1000000;
+
   public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) {
     if ($rev === '5.57.alpha1') {
-      if (CRM_Core_DAO::singleValueQuery('SELECT COUNT(id) FROM civicrm_activity WHERE is_current_revision = 0')) {
-        $preUpgradeMessage .= '<p>' . ts('Your database contains CiviCase activity revisions which are deprecated and will begin to appear as duplicates in SearchKit/api4/etc.<ul><li>For further instructions see this <a %1>Lab Snippet</a>.</li></ul>', [1 => 'target="_blank" href="https://lab.civicrm.org/-/snippets/85"']) . '</p>';
+      $docUrl = 'https://civicrm.org/redirect/activities-5.57';
+      $docAnchor = 'target="_blank" href="' . htmlentities($docUrl) . '"';
+
+      // The query on is_current_revision is slow if there's a lot of activities. So limit when it gets run.
+      $activityCount = CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_activity');
+      if ($activityCount < self::ACTIVITY_THRESHOLD && CRM_Core_DAO::singleValueQuery('SELECT COUNT(id) FROM civicrm_activity WHERE is_current_revision = 0')) {
+        $preUpgradeMessage .= '<p>' . ts('Your database contains CiviCase activity revisions which are deprecated and will begin to appear as duplicates in SearchKit/api4/etc.<ul><li>For further instructions see this <a %1>Lab Snippet</a>.</li></ul>', [1 => $docAnchor]) . '</p>';
+      }
+      // Similarly the original_id ON DELETE drop+recreate is slow, so if we
+      // don't add the task farther down below, then tell people what to do at
+      // their convenience.
+      elseif ($activityCount >= self::ACTIVITY_THRESHOLD) {
+        $preUpgradeMessage .= '<p>' . ts('The activity table <strong>will not update automatically</strong> because it contains too many records. You will need to apply a <strong>manual update</strong>. Please read about <a %1>how to clean data from the defunct "Embedded Activity Revisions" setting</a>.', [1 => $docAnchor]) . '</p>';
       }
     }
   }
@@ -37,7 +53,9 @@ class CRM_Upgrade_Incremental_php_FiveFiftySeven extends CRM_Upgrade_Incremental
    */
   public function upgrade_5_57_alpha1($rev): void {
     $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
-    $this->addTask('Fix dangerous delete cascade', 'fixDeleteCascade');
+    if (CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_activity') < self::ACTIVITY_THRESHOLD) {
+      $this->addTask('Fix dangerous delete cascade', 'fixDeleteCascade');
+    }
     $this->addExtensionTask('Enable SearchKit extension', ['org.civicrm.search_kit'], 1100);
     $this->addExtensionTask('Enable Flexmailer extension', ['org.civicrm.flexmailer']);
   }
diff --git a/civicrm/CRM/Utils/Check/Component/Schema.php b/civicrm/CRM/Utils/Check/Component/Schema.php
index a61288d4b3..8a4327f16c 100644
--- a/civicrm/CRM/Utils/Check/Component/Schema.php
+++ b/civicrm/CRM/Utils/Check/Component/Schema.php
@@ -176,6 +176,41 @@ class CRM_Utils_Check_Component_Schema extends CRM_Utils_Check_Component {
     return $messages;
   }
 
+  /**
+   * The column 'civicrm_activity.original_id' should not have 'ON DELETE CASCADE'.
+   * It is OK to have 'ON DELETE SET NULL' or to have no constraint.
+   *
+   * @return CRM_Utils_Check_Message[]
+   */
+  public function checkOldAcitvityCascade(): array {
+    $messages = [];
+
+    $sql = "SELECT CONSTRAINT_NAME, DELETE_RULE
+      FROM information_schema.referential_constraints
+      WHERE CONSTRAINT_SCHEMA=database() AND TABLE_NAME='civicrm_activity' AND CONSTRAINT_NAME='FK_civicrm_activity_original_id'
+    ";
+    $cascades = CRM_Core_DAO::executeQuery($sql, [], FALSE, NULL, FALSE, FALSE)
+      ->fetchMap('CONSTRAINT_NAME', 'DELETE_RULE');
+    $cascade = $cascades['FK_civicrm_activity_original_id'] ?? NULL;
+    if ($cascade === 'CASCADE') {
+      $docUrl = 'https://civicrm.org/redirect/activities-5.57';
+      $messages[] = new CRM_Utils_Check_Message(
+        __FUNCTION__,
+        ts(
+          '<p>The table <code>%1</code> includes an incorrect constraint. <a %2>Learn how to fix this.</a>', [
+            1 => 'civicrm_activity',
+            2 => 'target="_blank" href="' . htmlentities($docUrl) . '"',
+          ]
+        ),
+        ts('Schema Error'),
+        \Psr\Log\LogLevel::WARNING,
+        'fa-server'
+      );
+    }
+
+    return $messages;
+  }
+
   /**
    * @return CRM_Utils_Check_Message[]
    */
diff --git a/civicrm/ang/crmUi.js b/civicrm/ang/crmUi.js
index 6b9a54c622..309d512bdd 100644
--- a/civicrm/ang/crmUi.js
+++ b/civicrm/ang/crmUi.js
@@ -753,7 +753,7 @@
           if (ctrl.ngModel) {
             // Ensure widget is updated when model changes
             ctrl.ngModel.$render = function() {
-              element.val(ctrl.ngModel.$viewValue || '').change();
+              element.val(ctrl.ngModel.$viewValue || '');
             };
 
             // Copied from ng-list
diff --git a/civicrm/civicrm-version.php b/civicrm/civicrm-version.php
index b353ae531d..9f4912d330 100644
--- a/civicrm/civicrm-version.php
+++ b/civicrm/civicrm-version.php
@@ -1,7 +1,7 @@
 <?php
 /** @deprecated */
 function civicrmVersion( ) {
-  return array( 'version'  => '5.57.1',
+  return array( 'version'  => '5.57.2',
                 'cms'      => 'Wordpress',
                 'revision' => '' );
 }
diff --git a/civicrm/ext/afform/admin/info.xml b/civicrm/ext/afform/admin/info.xml
index 0f8f8f4234..0818af6b54 100644
--- a/civicrm/ext/afform/admin/info.xml
+++ b/civicrm/ext/afform/admin/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>beta</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/afform/core/info.xml b/civicrm/ext/afform/core/info.xml
index 434f5154b4..7cea730a6b 100644
--- a/civicrm/ext/afform/core/info.xml
+++ b/civicrm/ext/afform/core/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>beta</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/afform/html/info.xml b/civicrm/ext/afform/html/info.xml
index 1cb4104bf0..ac981b4e5a 100644
--- a/civicrm/ext/afform/html/info.xml
+++ b/civicrm/ext/afform/html/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/afform/mock/info.xml b/civicrm/ext/afform/mock/info.xml
index c7172e0e00..888381ff62 100644
--- a/civicrm/ext/afform/mock/info.xml
+++ b/civicrm/ext/afform/mock/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/authx/info.xml b/civicrm/ext/authx/info.xml
index ed50b21a08..9c5b6ca438 100644
--- a/civicrm/ext/authx/info.xml
+++ b/civicrm/ext/authx/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/civicrm_admin_ui/info.xml b/civicrm/ext/civicrm_admin_ui/info.xml
index 55f2a8b851..ad26019f61 100644
--- a/civicrm/ext/civicrm_admin_ui/info.xml
+++ b/civicrm/ext/civicrm_admin_ui/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/civigrant/info.xml b/civicrm/ext/civigrant/info.xml
index 2c23e04151..be65f4ff9d 100644
--- a/civicrm/ext/civigrant/info.xml
+++ b/civicrm/ext/civigrant/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/civiimport/info.xml b/civicrm/ext/civiimport/info.xml
index db18283937..11bde8ed90 100644
--- a/civicrm/ext/civiimport/info.xml
+++ b/civicrm/ext/civiimport/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2022-08-11</releaseDate>
-  <version>5.57.1</version>
+  <version>5.57.2</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/ckeditor4/info.xml b/civicrm/ext/ckeditor4/info.xml
index 859494e6aa..8219c4da7f 100644
--- a/civicrm/ext/ckeditor4/info.xml
+++ b/civicrm/ext/ckeditor4/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/contributioncancelactions/info.xml b/civicrm/ext/contributioncancelactions/info.xml
index 71fd534f45..384487a79c 100644
--- a/civicrm/ext/contributioncancelactions/info.xml
+++ b/civicrm/ext/contributioncancelactions/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/elavon/info.xml b/civicrm/ext/elavon/info.xml
index f2261f2de8..e80a40f067 100644
--- a/civicrm/ext/elavon/info.xml
+++ b/civicrm/ext/elavon/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2022-08-05</releaseDate>
-  <version>5.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/eventcart/info.xml b/civicrm/ext/eventcart/info.xml
index a914ff700c..44973bddab 100644
--- a/civicrm/ext/eventcart/info.xml
+++ b/civicrm/ext/eventcart/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/ewaysingle/info.xml b/civicrm/ext/ewaysingle/info.xml
index 5427e19674..aff19efa8e 100644
--- a/civicrm/ext/ewaysingle/info.xml
+++ b/civicrm/ext/ewaysingle/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/financialacls/info.xml b/civicrm/ext/financialacls/info.xml
index d9ec7fc3c1..910fdd3ff0 100644
--- a/civicrm/ext/financialacls/info.xml
+++ b/civicrm/ext/financialacls/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/flexmailer/info.xml b/civicrm/ext/flexmailer/info.xml
index fb8dd2b138..71dfa71c57 100644
--- a/civicrm/ext/flexmailer/info.xml
+++ b/civicrm/ext/flexmailer/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <comments>
     FlexMailer is an email delivery engine which replaces the internal guts
diff --git a/civicrm/ext/greenwich/info.xml b/civicrm/ext/greenwich/info.xml
index c47a3b0d08..c4413da899 100644
--- a/civicrm/ext/greenwich/info.xml
+++ b/civicrm/ext/greenwich/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/legacycustomsearches/info.xml b/civicrm/ext/legacycustomsearches/info.xml
index 91561692d7..4c8eacab9e 100644
--- a/civicrm/ext/legacycustomsearches/info.xml
+++ b/civicrm/ext/legacycustomsearches/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <tags>
     <tag>mgmt:hidden</tag>
diff --git a/civicrm/ext/message_admin/info.xml b/civicrm/ext/message_admin/info.xml
index 55a6aad6b9..b87137b534 100644
--- a/civicrm/ext/message_admin/info.xml
+++ b/civicrm/ext/message_admin/info.xml
@@ -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.57.1</version>
+  <version>5.57.2</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/oauth-client/info.xml b/civicrm/ext/oauth-client/info.xml
index 9a720a0e87..48cbec2b9e 100644
--- a/civicrm/ext/oauth-client/info.xml
+++ b/civicrm/ext/oauth-client/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-10-23</releaseDate>
-  <version>5.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/payflowpro/info.xml b/civicrm/ext/payflowpro/info.xml
index c83829ba93..43c548c6bf 100644
--- a/civicrm/ext/payflowpro/info.xml
+++ b/civicrm/ext/payflowpro/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-04-13</releaseDate>
-  <version>5.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.57</ver>
diff --git a/civicrm/ext/recaptcha/info.xml b/civicrm/ext/recaptcha/info.xml
index 9b5da62139..629bccbc30 100644
--- a/civicrm/ext/recaptcha/info.xml
+++ b/civicrm/ext/recaptcha/info.xml
@@ -13,7 +13,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-04-03</releaseDate>
-  <version>5.57.1</version>
+  <version>5.57.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/search_kit/info.xml b/civicrm/ext/search_kit/info.xml
index 5ab6e94529..e31ee15db4 100644
--- a/civicrm/ext/search_kit/info.xml
+++ b/civicrm/ext/search_kit/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-01-06</releaseDate>
-  <version>5.57.1</version>
+  <version>5.57.2</version>
   <develStage>stable</develStage>
   <tags>
     <tag>mgmt:required</tag>
diff --git a/civicrm/ext/sequentialcreditnotes/info.xml b/civicrm/ext/sequentialcreditnotes/info.xml
index 1c9f1dbe36..81ef8e3d8a 100644
--- a/civicrm/ext/sequentialcreditnotes/info.xml
+++ b/civicrm/ext/sequentialcreditnotes/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-28</releaseDate>
-  <version>5.57.1</version>
+  <version>5.57.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/release-notes.md b/civicrm/release-notes.md
index 2a2b32fd74..8b0302ac20 100644
--- a/civicrm/release-notes.md
+++ b/civicrm/release-notes.md
@@ -15,6 +15,15 @@ Other resources for identifying changes are:
     * https://github.com/civicrm/civicrm-joomla
     * https://github.com/civicrm/civicrm-wordpress
 
+## CiviCRM 5.57.2
+
+Released January 26, 2023
+
+- **[Synopsis](release-notes/5.57.2.md#synopsis)**
+- **[Bugs resolved](release-notes/5.57.2.md#bugs)**
+- **[Credits](release-notes/5.57.2.md#credits)**
+- **[Feedback](release-notes/5.57.2.md#feedback)**
+
 ## CiviCRM 5.57.1
 
 Released January 12, 2023
diff --git a/civicrm/release-notes/5.57.2.md b/civicrm/release-notes/5.57.2.md
new file mode 100644
index 0000000000..be06221455
--- /dev/null
+++ b/civicrm/release-notes/5.57.2.md
@@ -0,0 +1,44 @@
+# CiviCRM 5.57.2
+
+Released January 26, 2023
+
+- **[Synopsis](#synopsis)**
+- **[Bugs resolved](#bugs)**
+- **[Credits](#credits)**
+- **[Feedback](#feedback)**
+
+## <a name="synopsis"></a>Synopsis
+
+| *Does this version...?*                                         |          |
+| --------------------------------------------------------------- | -------- |
+| Change the database schema?                                     | no       |
+| Alter the API?                                                  | no       |
+| Require attention to configuration options?                     | no       |
+| **Fix problems installing or upgrading to a previous version?** | **yes**  |
+| Introduce features?                                             | no       |
+| **Fix bugs?**                                                   | **yes**  |
+| Fix security vulnerabilities?                                   | no       |
+
+## <a name="bugs"></a>Bugs resolved
+
+* **_CiviEvent_: Fix confirmation email for offline registrations ([dev/core#4087](https://lab.civicrm.org/dev/core/-/issues/4087): [#25370](https://github.com/civicrm/civicrm-core/pull/25370))**
+* **_CiviEvent_: Fix missing defaults ([#25410](https://github.com/civicrm/civicrm-core/pull/25410))**
+* **_Distmaker_: Fix "WordPress" entry in JSON build-report ([#25424](https://github.com/civicrm/civicrm-core/pull/25424))**
+* **_Form Builder_: Fix autocomplete for "Existing Contact" fields ([dev/core#4083](https://lab.civicrm.org/dev/core/-/issues/4083): [#25374](https://github.com/civicrm/civicrm-core/pull/25374))**
+* **_Upgrade_: Defer expensive upgrade step (for large databases) ([#25380](https://github.com/civicrm/civicrm-core/pull/25380))**
+* **_Upgrade_: Add status-check about deferred upgrade step ([#25437](https://github.com/civicrm/civicrm-core/pull/25437))**
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Wildsight - Lars Sanders-Green; Wikimedia Foundation - Eileen McNaughton; Megaphone
+Technology Consulting - Brienne Kordis; JMA Consulting - Seamus Lee; Dave D; CiviCRM -
+Coleman Watts, Tim Otten; Circle Interactive - Pradeep Nayak; Christian Wach; Australian
+Greens - Andrew Cormick-Dockery
+
+## <a name="feedback"></a>Feedback
+
+These release notes are edited by Tim Otten and Andie Hunt.  If you'd like to
+provide feedback on them, please login to https://chat.civicrm.org/civicrm and
+contact `@agh1`.
diff --git a/civicrm/sql/civicrm_data.mysql b/civicrm/sql/civicrm_data.mysql
index c29adf4623..4fb04a21fe 100644
--- a/civicrm/sql/civicrm_data.mysql
+++ b/civicrm/sql/civicrm_data.mysql
@@ -23654,4 +23654,4 @@ INSERT INTO `civicrm_report_instance`
     ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`)
 VALUES
     (  @domainID, 'Survey Details', 'survey/detail', 'Detailed report for canvassing, phone-banking, walk lists or other surveys.', 'access CiviReport', 'a:39:{s:6:"fields";a:2:{s:9:"sort_name";s:1:"1";s:6:"result";s:1:"1";}s:22:"assignee_contact_id_op";s:2:"eq";s:25:"assignee_contact_id_value";s:0:"";s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:17:"street_number_min";s:0:"";s:17:"street_number_max";s:0:"";s:16:"street_number_op";s:3:"lte";s:19:"street_number_value";s:0:"";s:14:"street_name_op";s:3:"has";s:17:"street_name_value";s:0:"";s:15:"postal_code_min";s:0:"";s:15:"postal_code_max";s:0:"";s:14:"postal_code_op";s:3:"lte";s:17:"postal_code_value";s:0:"";s:7:"city_op";s:3:"has";s:10:"city_value";s:0:"";s:20:"state_province_id_op";s:2:"in";s:23:"state_province_id_value";a:0:{}s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:12:"survey_id_op";s:2:"in";s:15:"survey_id_value";a:0:{}s:12:"status_id_op";s:2:"eq";s:15:"status_id_value";s:1:"1";s:11:"custom_1_op";s:2:"in";s:14:"custom_1_value";a:0:{}s:11:"custom_2_op";s:2:"in";s:14:"custom_2_value";a:0:{}s:17:"custom_3_relative";s:1:"0";s:13:"custom_3_from";s:0:"";s:11:"custom_3_to";s:0:"";s:11:"description";s:75:"Detailed report for canvassing, phone-banking, walk lists or other surveys.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviReport";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}');
-UPDATE civicrm_domain SET version = '5.57.1';
+UPDATE civicrm_domain SET version = '5.57.2';
diff --git a/civicrm/sql/civicrm_generated.mysql b/civicrm/sql/civicrm_generated.mysql
index e5435b1b1f..12c1522690 100644
--- a/civicrm/sql/civicrm_generated.mysql
+++ b/civicrm/sql/civicrm_generated.mysql
@@ -3056,7 +3056,7 @@ UNLOCK TABLES;
 LOCK TABLES `civicrm_domain` WRITE;
 /*!40000 ALTER TABLE `civicrm_domain` DISABLE KEYS */;
 INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES
- (1,'Default Domain Name',NULL,'5.57.1',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
+ (1,'Default Domain Name',NULL,'5.57.2',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
 /*!40000 ALTER TABLE `civicrm_domain` ENABLE KEYS */;
 UNLOCK TABLES;
 
diff --git a/civicrm/templates/CRM/Event/Form/ManageEvent/Registration.tpl b/civicrm/templates/CRM/Event/Form/ManageEvent/Registration.tpl
index c3db65bb90..946aaa4ebf 100644
--- a/civicrm/templates/CRM/Event/Form/ManageEvent/Registration.tpl
+++ b/civicrm/templates/CRM/Event/Form/ManageEvent/Registration.tpl
@@ -50,7 +50,7 @@
 
   <tr class="crm-event-manage-registration-form-block-registration_link_text">
     <td scope="row" class="label"
-        width="20%">{$form.registration_link_text.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='registration_link_text' id=$eventID}{/if}</td>
+        width="20%">{$form.registration_link_text.label} <span class="crm-marker">*</span>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='registration_link_text' id=$eventID}{/if}</td>
     <td>{$form.registration_link_text.html} {help id="id-link_text"}</td>
   </tr>
   {if !$isTemplate}
diff --git a/civicrm/vendor/autoload.php b/civicrm/vendor/autoload.php
index 2c27cd7d1f..4e869e11cc 100644
--- a/civicrm/vendor/autoload.php
+++ b/civicrm/vendor/autoload.php
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer/autoload_real.php';
 
-return ComposerAutoloaderInit33b931cc9909fb98223956c347efaa64::getLoader();
+return ComposerAutoloaderInit6c9ae686e246434c72842d75d7a476bb::getLoader();
diff --git a/civicrm/vendor/composer/autoload_real.php b/civicrm/vendor/composer/autoload_real.php
index bcfb5bd97b..01320839da 100644
--- a/civicrm/vendor/composer/autoload_real.php
+++ b/civicrm/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
 
 // autoload_real.php @generated by Composer
 
-class ComposerAutoloaderInit33b931cc9909fb98223956c347efaa64
+class ComposerAutoloaderInit6c9ae686e246434c72842d75d7a476bb
 {
     private static $loader;
 
@@ -24,9 +24,9 @@ class ComposerAutoloaderInit33b931cc9909fb98223956c347efaa64
 
         require __DIR__ . '/platform_check.php';
 
-        spl_autoload_register(array('ComposerAutoloaderInit33b931cc9909fb98223956c347efaa64', 'loadClassLoader'), true, true);
+        spl_autoload_register(array('ComposerAutoloaderInit6c9ae686e246434c72842d75d7a476bb', 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
-        spl_autoload_unregister(array('ComposerAutoloaderInit33b931cc9909fb98223956c347efaa64', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInit6c9ae686e246434c72842d75d7a476bb', 'loadClassLoader'));
 
         $includePaths = require __DIR__ . '/include_paths.php';
         $includePaths[] = get_include_path();
@@ -36,7 +36,7 @@ class ComposerAutoloaderInit33b931cc9909fb98223956c347efaa64
         if ($useStaticLoader) {
             require __DIR__ . '/autoload_static.php';
 
-            call_user_func(\Composer\Autoload\ComposerStaticInit33b931cc9909fb98223956c347efaa64::getInitializer($loader));
+            call_user_func(\Composer\Autoload\ComposerStaticInit6c9ae686e246434c72842d75d7a476bb::getInitializer($loader));
         } else {
             $map = require __DIR__ . '/autoload_namespaces.php';
             foreach ($map as $namespace => $path) {
@@ -57,12 +57,12 @@ class ComposerAutoloaderInit33b931cc9909fb98223956c347efaa64
         $loader->register(true);
 
         if ($useStaticLoader) {
-            $includeFiles = Composer\Autoload\ComposerStaticInit33b931cc9909fb98223956c347efaa64::$files;
+            $includeFiles = Composer\Autoload\ComposerStaticInit6c9ae686e246434c72842d75d7a476bb::$files;
         } else {
             $includeFiles = require __DIR__ . '/autoload_files.php';
         }
         foreach ($includeFiles as $fileIdentifier => $file) {
-            composerRequire33b931cc9909fb98223956c347efaa64($fileIdentifier, $file);
+            composerRequire6c9ae686e246434c72842d75d7a476bb($fileIdentifier, $file);
         }
 
         return $loader;
@@ -74,7 +74,7 @@ class ComposerAutoloaderInit33b931cc9909fb98223956c347efaa64
  * @param string $file
  * @return void
  */
-function composerRequire33b931cc9909fb98223956c347efaa64($fileIdentifier, $file)
+function composerRequire6c9ae686e246434c72842d75d7a476bb($fileIdentifier, $file)
 {
     if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
         $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
diff --git a/civicrm/vendor/composer/autoload_static.php b/civicrm/vendor/composer/autoload_static.php
index 3047378057..a85093da49 100644
--- a/civicrm/vendor/composer/autoload_static.php
+++ b/civicrm/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
 
 namespace Composer\Autoload;
 
-class ComposerStaticInit33b931cc9909fb98223956c347efaa64
+class ComposerStaticInit6c9ae686e246434c72842d75d7a476bb
 {
     public static $files = array (
         'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@@ -738,11 +738,11 @@ class ComposerStaticInit33b931cc9909fb98223956c347efaa64
     public static function getInitializer(ClassLoader $loader)
     {
         return \Closure::bind(function () use ($loader) {
-            $loader->prefixLengthsPsr4 = ComposerStaticInit33b931cc9909fb98223956c347efaa64::$prefixLengthsPsr4;
-            $loader->prefixDirsPsr4 = ComposerStaticInit33b931cc9909fb98223956c347efaa64::$prefixDirsPsr4;
-            $loader->prefixesPsr0 = ComposerStaticInit33b931cc9909fb98223956c347efaa64::$prefixesPsr0;
-            $loader->fallbackDirsPsr0 = ComposerStaticInit33b931cc9909fb98223956c347efaa64::$fallbackDirsPsr0;
-            $loader->classMap = ComposerStaticInit33b931cc9909fb98223956c347efaa64::$classMap;
+            $loader->prefixLengthsPsr4 = ComposerStaticInit6c9ae686e246434c72842d75d7a476bb::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInit6c9ae686e246434c72842d75d7a476bb::$prefixDirsPsr4;
+            $loader->prefixesPsr0 = ComposerStaticInit6c9ae686e246434c72842d75d7a476bb::$prefixesPsr0;
+            $loader->fallbackDirsPsr0 = ComposerStaticInit6c9ae686e246434c72842d75d7a476bb::$fallbackDirsPsr0;
+            $loader->classMap = ComposerStaticInit6c9ae686e246434c72842d75d7a476bb::$classMap;
 
         }, null, ClassLoader::class);
     }
diff --git a/civicrm/vendor/composer/include_paths.php b/civicrm/vendor/composer/include_paths.php
index 189ce0e9b6..06cf2843ee 100644
--- a/civicrm/vendor/composer/include_paths.php
+++ b/civicrm/vendor/composer/include_paths.php
@@ -12,9 +12,9 @@ return array(
     $vendorDir . '/pear/console_getopt',
     $vendorDir . '/pear/pear-core-minimal/src',
     $vendorDir . '/pear/db',
-    $vendorDir . '/pear/log',
     $vendorDir . '/pear/mail',
     $vendorDir . '/pear/mail_mime',
+    $vendorDir . '/pear/log',
     $vendorDir . '/pear/net_socket',
     $vendorDir . '/pear/net_smtp',
     $vendorDir . '/pear/validate_finance_creditcard',
diff --git a/civicrm/vendor/composer/installed.php b/civicrm/vendor/composer/installed.php
index 5c942d4433..e893ace168 100644
--- a/civicrm/vendor/composer/installed.php
+++ b/civicrm/vendor/composer/installed.php
@@ -5,7 +5,7 @@
         'type' => 'library',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
-        'reference' => 'c8c56978a794cbe0a83cc13199281c6423b93c0a',
+        'reference' => '1addfdcbc131f23c79e1965238799af5c3bd7cbc',
         'name' => 'civicrm/civicrm-core',
         'dev' => true,
     ),
@@ -61,7 +61,7 @@
             'type' => 'library',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
-            'reference' => 'c8c56978a794cbe0a83cc13199281c6423b93c0a',
+            'reference' => '1addfdcbc131f23c79e1965238799af5c3bd7cbc',
             'dev_requirement' => false,
         ),
         'civicrm/civicrm-cxn-rpc' => array(
diff --git a/civicrm/xml/version.xml b/civicrm/xml/version.xml
index fb6db02f7d..921319e24b 100644
--- a/civicrm/xml/version.xml
+++ b/civicrm/xml/version.xml
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="iso-8859-1" ?>
 <version>
-  <version_no>5.57.1</version_no>
+  <version_no>5.57.2</version_no>
 </version>
-- 
GitLab