diff --git a/civicrm.php b/civicrm.php
index 78a0e871f3a7feb22e2187a42a0573b5391457aa..f8dd8860b8c83f0e6ea8c5be5652c6439beb8fd1 100644
--- a/civicrm.php
+++ b/civicrm.php
@@ -2,7 +2,7 @@
 /**
  * Plugin Name: CiviCRM
  * Description: CiviCRM - Growing and Sustaining Relationships
- * Version: 5.50.1
+ * Version: 5.50.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.50.1');
+define('CIVICRM_PLUGIN_VERSION', '5.50.2');
 
 // Store reference to this file.
 if (!defined('CIVICRM_PLUGIN_FILE')) {
diff --git a/civicrm/CRM/Batch/BAO/EntityBatch.php b/civicrm/CRM/Batch/BAO/EntityBatch.php
index f4c1e55a7027fc5e49ee220c13804bde98fb29c0..492286897eebe2879cb65c3bace8259079300621 100644
--- a/civicrm/CRM/Batch/BAO/EntityBatch.php
+++ b/civicrm/CRM/Batch/BAO/EntityBatch.php
@@ -26,6 +26,7 @@ class CRM_Batch_BAO_EntityBatch extends CRM_Batch_DAO_EntityBatch {
     // Only write the EntityBatch record if the financial trxn and batch match on currency and payment instrument.
     $batchId = $params['batch_id'] ?? NULL;
     $entityId = $params['entity_id'] ?? NULL;
+    $entityTable = $params['entity_table'] ?? 'civicrm_financial_trxn';
     // Not having a batch ID and entity ID is only acceptable on an update.
     if (!$batchId) {
       $existingEntityBatch = \Civi\Api4\EntityBatch::get(FALSE)
@@ -36,7 +37,7 @@ class CRM_Batch_BAO_EntityBatch extends CRM_Batch_DAO_EntityBatch {
       $entityId = $existingEntityBatch['entity_id'] ?? NULL;
     }
     // There should never be a legitimate case where a record has an ID but no batch ID but SyntaxConformanceTest says otherwise.
-    if ($batchId) {
+    if ($batchId && $entityTable === 'civicrm_financial_trxn') {
       $batchCurrency = self::getBatchCurrency($batchId);
       $batchPID = (int) CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $batchId, 'payment_instrument_id');
       $trxn = \Civi\Api4\FinancialTrxn::get(FALSE)
diff --git a/civicrm/CRM/Extension/Manager.php b/civicrm/CRM/Extension/Manager.php
index 444f86ec32b4d44520d0e3fe747a25dbe1745548..800a7b3ce71bd89f7fdeea171fbb5e06654855d1 100644
--- a/civicrm/CRM/Extension/Manager.php
+++ b/civicrm/CRM/Extension/Manager.php
@@ -712,9 +712,12 @@ class CRM_Extension_Manager {
    * @return CRM_Extension_Info|NULL
    */
   public function createInfoFromDB($key) {
-    $dao = new CRM_Core_DAO_Extension();
-    $dao->full_name = $key;
-    if ($dao->find(TRUE)) {
+    // System hasn't booted - and extension is missing. Need low-tech/no-hook SELECT to learn more about what's missing.
+    $select = CRM_Utils_SQL_Select::from('civicrm_extension')
+      ->where('full_name = @key', ['key' => $key])
+      ->select('full_name, type, name, label, file');
+    $dao = $select->execute();
+    if ($dao->fetch()) {
       $info = new CRM_Extension_Info($dao->full_name, $dao->type, $dao->name, $dao->label, $dao->file);
       return $info;
     }
diff --git a/civicrm/Civi/Core/CiviEventDispatcher.php b/civicrm/Civi/Core/CiviEventDispatcher.php
index f2ddb6431ef63e8eb784b2bf7d059c3f04410e2f..d4564e5b4c2504cdc7cd46be0e2188af3e5af0f0 100644
--- a/civicrm/Civi/Core/CiviEventDispatcher.php
+++ b/civicrm/Civi/Core/CiviEventDispatcher.php
@@ -187,7 +187,18 @@ class CiviEventDispatcher extends EventDispatcher {
           throw new \RuntimeException("The dispatch policy prohibits event \"$eventName\".");
 
         case 'not-ready':
-          throw new \RuntimeException("CiviCRM has not bootstrapped sufficiently to fire event \"$eventName\".");
+          // The system is not ready to run hooks -- eg it has not finished loading the extension main-files.
+          // If you fire a hook at this point, it will not be received by the intended listeners.
+          // In practice, many hooks involve cached data-structures, so a premature hook is liable to have spooky side-effects.
+          // This condition indicates a structural problem and merits a consistent failure-mode.
+          // If you believe some special case merits an exemption, then you could add it to `$bootDispatchPolicy`.
+
+          // An `Exception` would be ideal for preventing new bugs, but it can be too noisy for systems with pre-existing bugs.
+          // throw new \RuntimeException("The event \"$eventName\" attempted to fire before CiviCRM was fully loaded. Skipping.");
+          // Complain to web-user and sysadmin. Log a backtrace. We're pre-boot, so don't use high-level services.
+          error_log("The event \"$eventName\" attempted to fire before CiviCRM was fully loaded. Skipping.\n" . \CRM_Core_Error::formatBacktrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), FALSE));
+          trigger_error("The event \"$eventName\" attempted to fire before CiviCRM was fully loaded. Skipping.", E_USER_WARNING);
+          return $event;
 
         default:
           throw new \RuntimeException("The dispatch policy for \"$eventName\" is unrecognized ($mode).");
diff --git a/civicrm/civicrm-version.php b/civicrm/civicrm-version.php
index 88521370a2ae6790cfef99e31df708efe6136351..a27beb137eba6ceda9afce959a01d5d731661b89 100644
--- a/civicrm/civicrm-version.php
+++ b/civicrm/civicrm-version.php
@@ -1,7 +1,7 @@
 <?php
 /** @deprecated */
 function civicrmVersion( ) {
-  return array( 'version'  => '5.50.1',
+  return array( 'version'  => '5.50.2',
                 'cms'      => 'Wordpress',
                 'revision' => '' );
 }
diff --git a/civicrm/composer.lock b/civicrm/composer.lock
index 190c30fea390c218a5099a0d0cf1b1ada89c8644..66cb49b582783ae2f83c1edca5d9a260f0a15f7f 100644
--- a/civicrm/composer.lock
+++ b/civicrm/composer.lock
@@ -826,16 +826,16 @@
         },
         {
             "name": "guzzlehttp/guzzle",
-            "version": "6.5.6",
+            "version": "6.5.7",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/guzzle.git",
-                "reference": "f092dd734083473658de3ee4bef093ed77d2689c"
+                "reference": "724562fa861e21a4071c652c8a159934e4f05592"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f092dd734083473658de3ee4bef093ed77d2689c",
-                "reference": "f092dd734083473658de3ee4bef093ed77d2689c",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/724562fa861e21a4071c652c8a159934e4f05592",
+                "reference": "724562fa861e21a4071c652c8a159934e4f05592",
                 "shasum": ""
             },
             "require": {
@@ -921,7 +921,7 @@
             ],
             "support": {
                 "issues": "https://github.com/guzzle/guzzle/issues",
-                "source": "https://github.com/guzzle/guzzle/tree/6.5.6"
+                "source": "https://github.com/guzzle/guzzle/tree/6.5.7"
             },
             "funding": [
                 {
@@ -937,7 +937,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-05-25T13:19:12+00:00"
+            "time": "2022-06-09T21:36:50+00:00"
         },
         {
             "name": "guzzlehttp/promises",
diff --git a/civicrm/ext/afform/admin/info.xml b/civicrm/ext/afform/admin/info.xml
index 35ee88710c3107f13ade29685a78d3b82d6ed512..1bf467e94a6b7a9eb759a0ab668d5f833bc11d1b 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>beta</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/afform/core/info.xml b/civicrm/ext/afform/core/info.xml
index 7410312f7a0892d0d9d15e36c399a54b80ad51f1..0ead66a0d7756fb10798a6d48270f8263450f903 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>beta</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/afform/html/info.xml b/civicrm/ext/afform/html/info.xml
index d4fa2be501a206cc51c15933789267ed90fee9b5..8bce9ad6f9bf8a148d17707f48d6d8fcec784ae5 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/afform/mock/info.xml b/civicrm/ext/afform/mock/info.xml
index c6ffe09779dea9aa668d6e3c9ea8fb0b70162449..e005da8852b28895d3d9f81fd6dfe692cc719c8c 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.50.1</version>
+  <version>5.50.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/authx/info.xml b/civicrm/ext/authx/info.xml
index 3bd0344d5df2894f3e5070cfad1a48f4550b1a50..a742ecf4c1d8e2ef1b548c92682fe272e7a9f53a 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/civicrm_admin_ui/info.xml b/civicrm/ext/civicrm_admin_ui/info.xml
index 5f50f13692fb457291b861e641a24a4679d2840b..78b866d0ebc63c1c76dc6785e6d375defc8782bd 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/civigrant/info.xml b/civicrm/ext/civigrant/info.xml
index e566a910d32e1d440abca0b931be749365e73da8..abd636fd6ec9f868c5ac342a4c4c2e301140d46e 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/ckeditor4/info.xml b/civicrm/ext/ckeditor4/info.xml
index 00f2fea54634c6bae6d0dc91ba57e0fa77c57dd6..a096eff0c590c138bb840218078dc02deaba0373 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/contributioncancelactions/info.xml b/civicrm/ext/contributioncancelactions/info.xml
index 1cbcce8d77a4b23fcec19211fa32e338d7611046..887752f26827c5e84a9bb6e2e87ee4e04a9b0f99 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/eventcart/info.xml b/civicrm/ext/eventcart/info.xml
index 406ae748f5e6dff1edfd887d9d8753f44879e388..fe379ec5ff7258fbb5b906f69deb7568a84440b2 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.50.1</version>
+  <version>5.50.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/ewaysingle/info.xml b/civicrm/ext/ewaysingle/info.xml
index f86e62aff0fc0e0c68b9c3be09304b5e4e6eb211..1dfeddc2ce4d06478f107cf18327ce8c4bcd02a5 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.50.1</version>
+  <version>5.50.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/financialacls/info.xml b/civicrm/ext/financialacls/info.xml
index 1b339b2b3f7c0d80afec2d961f3120addfe68257..1450f772c01a3f034ee4c56ca147de7929722868 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/flexmailer/info.xml b/civicrm/ext/flexmailer/info.xml
index 8116a2152210f0911f5c837db30f512aa6386610..3462cd1ab1cd5b8bbbcab124201e1f713718d281 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.50.1</version>
+  <version>5.50.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 afc4d65071db3ec66517a3834933dbdd9e49f5c4..96fe2c903b1e947e43c87a27d93fc459b10dac6a 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.50.1</version>
+  <version>5.50.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/legacycustomsearches/info.xml b/civicrm/ext/legacycustomsearches/info.xml
index f07239c1779057fdb6808a1703633f5dabb755c6..3c339520143f549df64d11b7ff8ce1d3915e76fa 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.50.1</version>
+  <version>5.50.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 a2d5daaabe7213335143f22d217f9d289ba40394..00557ef5e311d38fa50afda69ada8174177c5732 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.50.1</version>
+  <version>5.50.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/oauth-client/info.xml b/civicrm/ext/oauth-client/info.xml
index 2d0fec80ec8949b7dc4736d0ca64ff8f50ccfcd5..ea7ba16696e8d0e9f5563b41272a2e9787a2ffe2 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/payflowpro/info.xml b/civicrm/ext/payflowpro/info.xml
index e7a2a1e88c4f57c3d1449100a679ec405ec2cdcf..d412eb8e35e7e68c75f40290255e787efceb6ad4 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/recaptcha/info.xml b/civicrm/ext/recaptcha/info.xml
index 5f154a7a3cfe7ee66fde48525c4dcbef76222178..ddfd4e83bc27a8ddd6b668784e67ee66be7b3d0f 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.50.1</version>
+  <version>5.50.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 48deb9671748c302b8880f9c1c1500ba8b16c66f..1c035bdcbc2521d19738bc3297816c6ab08f05cf 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.50.1</version>
+  <version>5.50.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.50</ver>
diff --git a/civicrm/ext/sequentialcreditnotes/info.xml b/civicrm/ext/sequentialcreditnotes/info.xml
index b0ac956e0e248ecf8e32aa96dd7573d5d8ff7767..e01ecdd6e79f8b3af1e404ee1abafb042f080214 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.50.1</version>
+  <version>5.50.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/js/crm.ajax.js b/civicrm/js/crm.ajax.js
index 4cb20cd03ee7b65c3fea57749294e07d8577166a..39f7c85ef9aa29d3c196f69d2c9094bd90aafcb3 100644
--- a/civicrm/js/crm.ajax.js
+++ b/civicrm/js/crm.ajax.js
@@ -28,13 +28,11 @@
       path = path.split('#')[0];
     }
     frag = path.split('?');
-    // Remove basepage as it can be changed on some CMS eg. WordPress frontend.
-    frag[0] = frag[0].replace('civicrm/', '/');
     // Encode url path only if slashes in placeholder were also encoded
-    if (tplURL[mode].indexOf('/crmajax-placeholder-url-path') >= 0) {
-      url = tplURL[mode].replace('/crmajax-placeholder-url-path', frag[0]);
+    if (tplURL[mode].indexOf('civicrm/placeholder-url-path') >= 0) {
+      url = tplURL[mode].replace('civicrm/placeholder-url-path', frag[0]);
     } else {
-      url = tplURL[mode].replace('%2Fcrmajax-placeholder-url-path', encodeURIComponent(frag[0]));
+      url = tplURL[mode].replace('civicrm%2Fplaceholder-url-path', encodeURIComponent(frag[0]));
     }
 
     if (_.isEmpty(query)) {
diff --git a/civicrm/release-notes.md b/civicrm/release-notes.md
index 79ed3eb31e15b5af1fd917bc6fd0672a368e666c..95be4d1741286b30310acb482b3c76b1cb99e53d 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.50.2
+
+Released June 14, 2022
+
+- **[Synopsis](release-notes/5.50.2.md#synopsis)**
+- **[Bugs resolved](release-notes/5.50.2.md#bugs)**
+- **[Credits](release-notes/5.50.2.md#credits)**
+- **[Feedback](release-notes/5.50.2.md#feedback)**
+
 ## CiviCRM 5.50.1
 
 Released June 2, 2022
diff --git a/civicrm/release-notes/5.50.2.md b/civicrm/release-notes/5.50.2.md
new file mode 100644
index 0000000000000000000000000000000000000000..3406fcef7fdf743a39551f36cad65cdeb0010498
--- /dev/null
+++ b/civicrm/release-notes/5.50.2.md
@@ -0,0 +1,46 @@
+# CiviCRM 5.50.2
+
+Released June 14, 2022
+
+- **[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?     | no       |
+| Introduce features?                                             | no       |
+| **Fix bugs?**                                                   | **yes**  |
+
+## <a name="bugs"></a>Bugs resolved
+
+* **_Accounting_: Fix new error that prevents creating account batches for `ukgiftaid`. ([extensions/ukgiftaid#30](https://lab.civicrm.org/extensions/ukgiftaid/-/issues/30): [#23741](https://github.com/civicrm/civicrm-core/pull/23741))**
+* **_CiviMember_: Re-enable configuration field "Renewal Message" ([dev/core#3499](https://lab.civicrm.org/dev/core/-/issues/3499): [#23726](https://github.com/civicrm/civicrm-core/pull/23726))**
+* **_Event Dispatcher_: Reduce fatal error to warning ([dev/core#3502](https://lab.civicrm.org/dev/core/-/issues/3502): [#23739](https://github.com/civicrm/civicrm-core/pull/23739))**
+* **_Extensions_: Missing extension leads to bootstrap error for "hook_civicrm_entityTypes"  ([dev/core#3496](https://lab.civicrm.org/dev/core/-/issues/3496): [#23716](https://github.com/civicrm/civicrm-core/pull/23716))**
+* **_Guzzle_: Update to v6.5.6 ([#23748](https://github.com/civicrm/civicrm-core/pull/23748))**
+
+  This applies a prophylactic security update. It is not believed to impact the security of CiviCRM deployments.
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Wikimedia Foundation - Eileen McNaughton; Squiffle Consulting - Aidan
+Saunders; MJW Consulting - Matthew Wire; Megaphone Technology Consulting -
+Jon Goldberg; jrobens; JMA Consulting - Seamus Lee; Humanists UK - Andrew
+West; GMCVO Databases; Francesc Bassas i Bullich; DevApp - Adam Kwiatkowski;
+davephassall; Dave D; CiviCRM - Tim Otten; Circle Interactive - Pradeep
+Nayak; Benjamin W
+
+## <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 c37cd9849f0126f6f6a2fa2f9fa4c64e972c048c..34ab573a1c090e3ef58a0b3cc341e24de221c75c 100644
--- a/civicrm/sql/civicrm_data.mysql
+++ b/civicrm/sql/civicrm_data.mysql
@@ -23793,4 +23793,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.50.1';
+UPDATE civicrm_domain SET version = '5.50.2';
diff --git a/civicrm/sql/civicrm_generated.mysql b/civicrm/sql/civicrm_generated.mysql
index 7ee912dba3fd305b77cf5effe417442a8497e3bc..493309f20cf36fa77df5609fe72850392e68d319 100644
--- a/civicrm/sql/civicrm_generated.mysql
+++ b/civicrm/sql/civicrm_generated.mysql
@@ -2938,7 +2938,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.50.1',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
+ (1,'Default Domain Name',NULL,'5.50.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/common/l10n.js.tpl b/civicrm/templates/CRM/common/l10n.js.tpl
index 67f69ada05885bd537d3c64e5e5c4d627dfe5aac..7e804f5568b938db00a2e406537aa8ccdf88d146 100644
--- a/civicrm/templates/CRM/common/l10n.js.tpl
+++ b/civicrm/templates/CRM/common/l10n.js.tpl
@@ -29,7 +29,7 @@
   CRM.config.entityRef = $.extend({ldelim}{rdelim}, {$entityRef|@json_encode}, CRM.config.entityRef || {ldelim}{rdelim});
 
   // Initialize CRM.url and CRM.formatMoney
-  CRM.url({ldelim}back: '{crmURL p="civicrm/crmajax-placeholder-url-path" q="civicrm-placeholder-url-query=1" h=0 fb=1}', front: '{crmURL p="civicrm/crmajax-placeholder-url-path" q="civicrm-placeholder-url-query=1" h=0 fe=1}'{rdelim});
+  CRM.url({ldelim}back: '{crmURL p="civicrm/placeholder-url-path" q="civicrm-placeholder-url-query=1" h=0 fb=1}', front: '{crmURL p="civicrm/placeholder-url-path" q="civicrm-placeholder-url-query=1" h=0 fe=1}'{rdelim});
   CRM.formatMoney('init', false, {$moneyFormat|@json_encode});
 
   // Localize select2
diff --git a/civicrm/vendor/autoload.php b/civicrm/vendor/autoload.php
index 6a5e44c5abd7568ae80bddefe56a7a8eec9d57da..fc48045d15258ef41e3efeb2c0d2b169e03b98f6 100644
--- a/civicrm/vendor/autoload.php
+++ b/civicrm/vendor/autoload.php
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer/autoload_real.php';
 
-return ComposerAutoloaderInit97c9e40edab64e2c93752ad5b5fd6a37::getLoader();
+return ComposerAutoloaderInitd4c716c4ee5d5afc7cf2f8bc4b092fca::getLoader();
diff --git a/civicrm/vendor/composer/autoload_real.php b/civicrm/vendor/composer/autoload_real.php
index 31b2eecf15d2d3a37d2e85c7c3bad363db879db0..c26ec2a7a9a7509442dec3eb5dd865aa6f4d5176 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 ComposerAutoloaderInit97c9e40edab64e2c93752ad5b5fd6a37
+class ComposerAutoloaderInitd4c716c4ee5d5afc7cf2f8bc4b092fca
 {
     private static $loader;
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit97c9e40edab64e2c93752ad5b5fd6a37
             return self::$loader;
         }
 
-        spl_autoload_register(array('ComposerAutoloaderInit97c9e40edab64e2c93752ad5b5fd6a37', 'loadClassLoader'), true, true);
+        spl_autoload_register(array('ComposerAutoloaderInitd4c716c4ee5d5afc7cf2f8bc4b092fca', 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        spl_autoload_unregister(array('ComposerAutoloaderInit97c9e40edab64e2c93752ad5b5fd6a37', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInitd4c716c4ee5d5afc7cf2f8bc4b092fca', 'loadClassLoader'));
 
         $includePaths = require __DIR__ . '/include_paths.php';
         $includePaths[] = get_include_path();
@@ -31,7 +31,7 @@ class ComposerAutoloaderInit97c9e40edab64e2c93752ad5b5fd6a37
         if ($useStaticLoader) {
             require_once __DIR__ . '/autoload_static.php';
 
-            call_user_func(\Composer\Autoload\ComposerStaticInit97c9e40edab64e2c93752ad5b5fd6a37::getInitializer($loader));
+            call_user_func(\Composer\Autoload\ComposerStaticInitd4c716c4ee5d5afc7cf2f8bc4b092fca::getInitializer($loader));
         } else {
             $map = require __DIR__ . '/autoload_namespaces.php';
             foreach ($map as $namespace => $path) {
@@ -52,19 +52,19 @@ class ComposerAutoloaderInit97c9e40edab64e2c93752ad5b5fd6a37
         $loader->register(true);
 
         if ($useStaticLoader) {
-            $includeFiles = Composer\Autoload\ComposerStaticInit97c9e40edab64e2c93752ad5b5fd6a37::$files;
+            $includeFiles = Composer\Autoload\ComposerStaticInitd4c716c4ee5d5afc7cf2f8bc4b092fca::$files;
         } else {
             $includeFiles = require __DIR__ . '/autoload_files.php';
         }
         foreach ($includeFiles as $fileIdentifier => $file) {
-            composerRequire97c9e40edab64e2c93752ad5b5fd6a37($fileIdentifier, $file);
+            composerRequired4c716c4ee5d5afc7cf2f8bc4b092fca($fileIdentifier, $file);
         }
 
         return $loader;
     }
 }
 
-function composerRequire97c9e40edab64e2c93752ad5b5fd6a37($fileIdentifier, $file)
+function composerRequired4c716c4ee5d5afc7cf2f8bc4b092fca($fileIdentifier, $file)
 {
     if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
         require $file;
diff --git a/civicrm/vendor/composer/autoload_static.php b/civicrm/vendor/composer/autoload_static.php
index 4038a28f167bbe5bee67d59b5a31d7d4e8d092d8..0955c06f3f27fd9b085bee6b5a4e23a971199f9c 100644
--- a/civicrm/vendor/composer/autoload_static.php
+++ b/civicrm/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
 
 namespace Composer\Autoload;
 
-class ComposerStaticInit97c9e40edab64e2c93752ad5b5fd6a37
+class ComposerStaticInitd4c716c4ee5d5afc7cf2f8bc4b092fca
 {
     public static $files = array (
         '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@@ -684,11 +684,11 @@ class ComposerStaticInit97c9e40edab64e2c93752ad5b5fd6a37
     public static function getInitializer(ClassLoader $loader)
     {
         return \Closure::bind(function () use ($loader) {
-            $loader->prefixLengthsPsr4 = ComposerStaticInit97c9e40edab64e2c93752ad5b5fd6a37::$prefixLengthsPsr4;
-            $loader->prefixDirsPsr4 = ComposerStaticInit97c9e40edab64e2c93752ad5b5fd6a37::$prefixDirsPsr4;
-            $loader->prefixesPsr0 = ComposerStaticInit97c9e40edab64e2c93752ad5b5fd6a37::$prefixesPsr0;
-            $loader->fallbackDirsPsr0 = ComposerStaticInit97c9e40edab64e2c93752ad5b5fd6a37::$fallbackDirsPsr0;
-            $loader->classMap = ComposerStaticInit97c9e40edab64e2c93752ad5b5fd6a37::$classMap;
+            $loader->prefixLengthsPsr4 = ComposerStaticInitd4c716c4ee5d5afc7cf2f8bc4b092fca::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInitd4c716c4ee5d5afc7cf2f8bc4b092fca::$prefixDirsPsr4;
+            $loader->prefixesPsr0 = ComposerStaticInitd4c716c4ee5d5afc7cf2f8bc4b092fca::$prefixesPsr0;
+            $loader->fallbackDirsPsr0 = ComposerStaticInitd4c716c4ee5d5afc7cf2f8bc4b092fca::$fallbackDirsPsr0;
+            $loader->classMap = ComposerStaticInitd4c716c4ee5d5afc7cf2f8bc4b092fca::$classMap;
 
         }, null, ClassLoader::class);
     }
diff --git a/civicrm/vendor/composer/installed.json b/civicrm/vendor/composer/installed.json
index 5c8bff46772b5c92960caef070ba8dd2a5ba4122..83ac6d0bc3a60c96e0e71e57608975361aa965d2 100644
--- a/civicrm/vendor/composer/installed.json
+++ b/civicrm/vendor/composer/installed.json
@@ -843,17 +843,17 @@
     },
     {
         "name": "guzzlehttp/guzzle",
-        "version": "6.5.6",
-        "version_normalized": "6.5.6.0",
+        "version": "6.5.7",
+        "version_normalized": "6.5.7.0",
         "source": {
             "type": "git",
             "url": "https://github.com/guzzle/guzzle.git",
-            "reference": "f092dd734083473658de3ee4bef093ed77d2689c"
+            "reference": "724562fa861e21a4071c652c8a159934e4f05592"
         },
         "dist": {
             "type": "zip",
-            "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f092dd734083473658de3ee4bef093ed77d2689c",
-            "reference": "f092dd734083473658de3ee4bef093ed77d2689c",
+            "url": "https://api.github.com/repos/guzzle/guzzle/zipball/724562fa861e21a4071c652c8a159934e4f05592",
+            "reference": "724562fa861e21a4071c652c8a159934e4f05592",
             "shasum": ""
         },
         "require": {
@@ -871,7 +871,7 @@
         "suggest": {
             "psr/log": "Required for using the Log middleware"
         },
-        "time": "2022-05-25T13:19:12+00:00",
+        "time": "2022-06-09T21:36:50+00:00",
         "type": "library",
         "extra": {
             "branch-alias": {
@@ -941,7 +941,7 @@
         ],
         "support": {
             "issues": "https://github.com/guzzle/guzzle/issues",
-            "source": "https://github.com/guzzle/guzzle/tree/6.5.6"
+            "source": "https://github.com/guzzle/guzzle/tree/6.5.7"
         }
     },
     {
diff --git a/civicrm/vendor/guzzlehttp/guzzle/CHANGELOG.md b/civicrm/vendor/guzzlehttp/guzzle/CHANGELOG.md
index 95d26df215088950c73c5b2f55cdc37b5b0c7898..cd3db22d855688478c1b644cea96d6d71c74ba85 100644
--- a/civicrm/vendor/guzzlehttp/guzzle/CHANGELOG.md
+++ b/civicrm/vendor/guzzlehttp/guzzle/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Change Log
 
+## 6.5.7 - 2022-06-09
+
+* Fix failure to strip Authorization header on HTTP downgrade
+* Fix failure to strip the Cookie header on change in host or HTTP downgrade
+
 ## 6.5.6 - 2022-05-25
 
 * Fix cross-domain cookie leakage
diff --git a/civicrm/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/civicrm/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
index e4644b7ac1d9dcf44cf31d1bf4f13742da3990ab..fd86c60a71201beab45868966bc73bf3bc6bf6f2 100644
--- a/civicrm/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
+++ b/civicrm/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
@@ -141,7 +141,7 @@ class RedirectMiddleware
     }
 
     /**
-     * Check for too many redirects
+     * Check for too many redirects.
      *
      * @return void
      *
@@ -190,7 +190,7 @@ class RedirectMiddleware
             $modify['body'] = '';
         }
 
-        $uri = $this->redirectUri($request, $response, $protocols);
+        $uri = self::redirectUri($request, $response, $protocols);
         if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) {
             $idnOptions = ($options['idn_conversion'] === true) ? IDNA_DEFAULT : $options['idn_conversion'];
             $uri = Utils::idnUriConvert($uri, $idnOptions);
@@ -210,16 +210,42 @@ class RedirectMiddleware
             $modify['remove_headers'][] = 'Referer';
         }
 
-        // Remove Authorization header if host is different.
-        if ($request->getUri()->getHost() !== $modify['uri']->getHost()) {
+        // Remove Authorization and Cookie headers if required.
+        if (self::shouldStripSensitiveHeaders($request->getUri(), $modify['uri'])) {
             $modify['remove_headers'][] = 'Authorization';
+            $modify['remove_headers'][] = 'Cookie';
         }
 
         return Psr7\modify_request($request, $modify);
     }
 
     /**
-     * Set the appropriate URL on the request based on the location header
+     * Determine if we should strip sensitive headers from the request.
+     *
+     * We return true if either of the following conditions are true:
+     *
+     * 1. the host is different;
+     * 2. the scheme has changed, and now is non-https.
+     *
+     * @return bool
+     */
+    private static function shouldStripSensitiveHeaders(
+        UriInterface $originalUri,
+        UriInterface $modifiedUri
+    ) {
+        if (strcasecmp($originalUri->getHost(), $modifiedUri->getHost()) !== 0) {
+            return true;
+        }
+
+        if ($originalUri->getScheme() !== $modifiedUri->getScheme() && 'https' !== $modifiedUri->getScheme()) {
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Set the appropriate URL on the request based on the location header.
      *
      * @param RequestInterface  $request
      * @param ResponseInterface $response
@@ -227,7 +253,7 @@ class RedirectMiddleware
      *
      * @return UriInterface
      */
-    private function redirectUri(
+    private static function redirectUri(
         RequestInterface $request,
         ResponseInterface $response,
         array $protocols
diff --git a/civicrm/xml/version.xml b/civicrm/xml/version.xml
index d36edc5b46a6b2d89356aaf5ef00dc69db5f8704..a35a369400c3fe81bd3581d145452c18e8eeed61 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.50.1</version_no>
+  <version_no>5.50.2</version_no>
 </version>