From 99a9acd64673290d3b1846017723ae8aba57f39a Mon Sep 17 00:00:00 2001
From: Kevin Cristiano <kcristiano@kcristiano.com>
Date: Mon, 15 Nov 2021 18:40:45 -0500
Subject: [PATCH] civicrm release-5.43.2

---
 civicrm.php                                   |   4 +-
 civicrm/CRM/Contact/Form/Task/Map.php         |   2 +-
 civicrm/CRM/Core/DAO.php                      |   4 +-
 civicrm/CRM/Core/Key.php                      |   2 +-
 civicrm/CRM/Core/SelectValues.php             |   2 +-
 civicrm/CRM/Export/BAO/ExportProcessor.php    |  10 ++
 civicrm/CRM/Utils/System/Base.php             |   9 ++
 civicrm/CRM/Utils/System/Drupal8.php          |  14 +++
 .../Api4/Service/Schema/Joinable/Joinable.php |   2 +-
 civicrm/Civi/Core/Container.php               |   4 +
 .../Civi/Token/ImpliedContextSubscriber.php   | 114 ++++++++++++++++++
 civicrm/Civi/Token/TokenProcessor.php         |  11 ++
 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/ckeditor4/info.xml                |   2 +-
 .../ext/contributioncancelactions/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                      |  18 +++
 civicrm/release-notes/5.43.1.md               |  41 +++++++
 civicrm/release-notes/5.43.2.md               |  37 ++++++
 civicrm/sql/civicrm_data.mysql                |   2 +-
 civicrm/sql/civicrm_generated.mysql           |   2 +-
 civicrm/vendor/autoload.php                   |   2 +-
 civicrm/vendor/composer/autoload_real.php     |  14 +--
 civicrm/vendor/composer/autoload_static.php   |  12 +-
 civicrm/xml/version.xml                       |   2 +-
 41 files changed, 304 insertions(+), 44 deletions(-)
 create mode 100644 civicrm/Civi/Token/ImpliedContextSubscriber.php
 create mode 100644 civicrm/release-notes/5.43.1.md
 create mode 100644 civicrm/release-notes/5.43.2.md

diff --git a/civicrm.php b/civicrm.php
index 1659c1191d..7d9e9623c2 100644
--- a/civicrm.php
+++ b/civicrm.php
@@ -2,7 +2,7 @@
 /**
  * Plugin Name: CiviCRM
  * Description: CiviCRM - Growing and Sustaining Relationships
- * Version: 5.43.0
+ * Version: 5.43.2
  * Requires at least: 4.9
  * Requires PHP:      7.2
  * Author: CiviCRM LLC
@@ -54,7 +54,7 @@ if (!defined('ABSPATH')) {
 }
 
 // Set version here: when it changes, will force Javascript & CSS to reload.
-define('CIVICRM_PLUGIN_VERSION', '5.43.0');
+define('CIVICRM_PLUGIN_VERSION', '5.43.2');
 
 // Store reference to this file.
 if (!defined('CIVICRM_PLUGIN_FILE')) {
diff --git a/civicrm/CRM/Contact/Form/Task/Map.php b/civicrm/CRM/Contact/Form/Task/Map.php
index 91991489e2..9cb5e97719 100644
--- a/civicrm/CRM/Contact/Form/Task/Map.php
+++ b/civicrm/CRM/Contact/Form/Task/Map.php
@@ -125,7 +125,7 @@ class CRM_Contact_Form_Task_Map extends CRM_Contact_Form_Task {
   public static function createMapXML($ids, $locationId, &$page, $addBreadCrumb, $type = 'Contact') {
     $config = CRM_Core_Config::singleton();
 
-    $this->setTitle(ts('Map Location(s)'));
+    $page->setTitle(ts('Map Location(s)'));
     $page->assign('query', 'CiviCRM Search Query');
     $page->assign('mapProvider', $config->mapProvider);
     $page->assign('mapKey', urlencode($config->mapAPIKey));
diff --git a/civicrm/CRM/Core/DAO.php b/civicrm/CRM/Core/DAO.php
index 2a375fbca1..f6ee6f1c84 100644
--- a/civicrm/CRM/Core/DAO.php
+++ b/civicrm/CRM/Core/DAO.php
@@ -918,7 +918,9 @@ class CRM_Core_DAO extends DB_DataObject {
 
     \CRM_Utils_Hook::pre($hook, $entityName, $record['id'] ?? NULL, $record);
     $instance = new $className();
-    $instance->copyValues($record);
+    // Ensure fields exist before attempting to write to them
+    $values = array_intersect_key($record, self::getSupportedFields());
+    $instance->copyValues($values);
     $instance->save();
     \CRM_Utils_Hook::post($hook, $entityName, $instance->id, $instance);
 
diff --git a/civicrm/CRM/Core/Key.php b/civicrm/CRM/Core/Key.php
index 3e7826f2c7..58b0a3912c 100644
--- a/civicrm/CRM/Core/Key.php
+++ b/civicrm/CRM/Core/Key.php
@@ -67,7 +67,7 @@ class CRM_Core_Key {
       $session = CRM_Core_Session::singleton();
       self::$_sessionID = $session->get('qfSessionID');
       if (!self::$_sessionID) {
-        self::$_sessionID = session_id();
+        self::$_sessionID = CRM_Core_Config::singleton()->userSystem->getSessionId();
         $session->set('qfSessionID', self::$_sessionID);
       }
     }
diff --git a/civicrm/CRM/Core/SelectValues.php b/civicrm/CRM/Core/SelectValues.php
index 2830c67782..5944201751 100644
--- a/civicrm/CRM/Core/SelectValues.php
+++ b/civicrm/CRM/Core/SelectValues.php
@@ -598,7 +598,7 @@ class CRM_Core_SelectValues {
     $tokenProcessor = new TokenProcessor(Civi::dispatcher(), ['schema' => ['participantId']]);
     $allTokens = $tokenProcessor->listTokens();
     foreach (array_keys($allTokens) as $token) {
-      if (strpos($token, '{domain.') === 0) {
+      if (strpos($token, '{domain.') === 0 || strpos($token, '{event.') === 0) {
         unset($allTokens[$token]);
       }
     }
diff --git a/civicrm/CRM/Export/BAO/ExportProcessor.php b/civicrm/CRM/Export/BAO/ExportProcessor.php
index 4e85f9758c..18a5663ff8 100644
--- a/civicrm/CRM/Export/BAO/ExportProcessor.php
+++ b/civicrm/CRM/Export/BAO/ExportProcessor.php
@@ -1464,6 +1464,16 @@ class CRM_Export_BAO_ExportProcessor {
 
         case CRM_Utils_Type::T_STRING:
           if (isset($fieldSpec['maxlength'])) {
+            // A localized string for the preferred_mail_format does not fit
+            // into the varchar(8) field.
+            // @see https://lab.civicrm.org/dev/core/-/issues/2645
+            switch ($fieldName) {
+              case 'preferred_mail_format':
+                return "`$fieldName` text(16)";
+
+              default:
+                return "`$fieldName` varchar({$fieldSpec['maxlength']})";
+            }
           }
           $dataType = $fieldSpec['data_type'] ?? '';
           // set the sql columns for custom data
diff --git a/civicrm/CRM/Utils/System/Base.php b/civicrm/CRM/Utils/System/Base.php
index 933a952a59..3e151ce3d2 100644
--- a/civicrm/CRM/Utils/System/Base.php
+++ b/civicrm/CRM/Utils/System/Base.php
@@ -1019,6 +1019,15 @@ abstract class CRM_Utils_System_Base {
     session_start();
   }
 
+  /**
+   * This exists because of https://www.drupal.org/node/3006306 where
+   * they changed so that they don't start sessions for anonymous, but we
+   * want that.
+   */
+  public function getSessionId() {
+    return session_id();
+  }
+
   /**
    * Get role names
    *
diff --git a/civicrm/CRM/Utils/System/Drupal8.php b/civicrm/CRM/Utils/System/Drupal8.php
index 06db470714..3cf29f4498 100644
--- a/civicrm/CRM/Utils/System/Drupal8.php
+++ b/civicrm/CRM/Utils/System/Drupal8.php
@@ -848,6 +848,20 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
     }
   }
 
+  /**
+   * @inheritdoc
+   */
+  public function getSessionId() {
+    if (\Drupal::hasContainer()) {
+      $session = \Drupal::service('session');
+      if (!$session->has('civicrm.tempstore.sessionid')) {
+        $session->set('civicrm.tempstore.sessionid', \Drupal\Component\Utility\Crypt::randomBytesBase64());
+      }
+      return $session->get('civicrm.tempstore.sessionid');
+    }
+    return '';
+  }
+
   /**
    * Load the user object.
    *
diff --git a/civicrm/Civi/Api4/Service/Schema/Joinable/Joinable.php b/civicrm/Civi/Api4/Service/Schema/Joinable/Joinable.php
index 2681466d86..6b5aed9e82 100644
--- a/civicrm/Civi/Api4/Service/Schema/Joinable/Joinable.php
+++ b/civicrm/Civi/Api4/Service/Schema/Joinable/Joinable.php
@@ -104,7 +104,7 @@ class Joinable {
    */
   public function getConditionsForJoin(string $baseTableAlias, string $tableAlias) {
     $baseCondition = sprintf(
-      '%s.%s =  %s.%s',
+      '`%s`.`%s` =  `%s`.`%s`',
       $baseTableAlias,
       $this->baseColumn,
       $tableAlias,
diff --git a/civicrm/Civi/Core/Container.php b/civicrm/Civi/Core/Container.php
index fd7c2773d6..841f318ba5 100644
--- a/civicrm/Civi/Core/Container.php
+++ b/civicrm/Civi/Core/Container.php
@@ -338,6 +338,10 @@ class Container {
         []
       ))->addTag('kernel.event_subscriber')->setPublic(TRUE);
     }
+    $container->setDefinition('civi_token_impliedcontext', new Definition(
+      'Civi\Token\ImpliedContextSubscriber',
+      []
+    ))->addTag('kernel.event_subscriber')->setPublic(TRUE);
     $container->setDefinition('crm_participant_tokens', new Definition(
       'CRM_Event_ParticipantTokens',
       []
diff --git a/civicrm/Civi/Token/ImpliedContextSubscriber.php b/civicrm/Civi/Token/ImpliedContextSubscriber.php
new file mode 100644
index 0000000000..3f3c5c016a
--- /dev/null
+++ b/civicrm/Civi/Token/ImpliedContextSubscriber.php
@@ -0,0 +1,114 @@
+<?php
+namespace Civi\Token;
+
+use Civi\Token\Event\TokenRegisterEvent;
+use Civi\Token\Event\TokenValueEvent;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Suppose you have `$context['participantId']`. You can infer a
+ * corresponding `$context['eventId']`. The ImpliedContextSubscriber reads
+ * values like `participantId` and fills-in values like `eventId`.
+ *
+ * @package Civi\Token
+ */
+class ImpliedContextSubscriber implements EventSubscriberInterface {
+
+  public static function getSubscribedEvents() {
+    return [
+      'civi.token.list' => ['onRegisterTokens', 1000],
+      'civi.token.eval' => ['onEvaluateTokens', 1000],
+    ];
+  }
+
+  /**
+   * When listing tokens, ensure that implied data is visible.
+   *
+   * Ex: If `$context['participantId']` is part of the schema, then
+   * `$context['eventId']` will also be part of the schema.
+   *
+   * This fires early during the `civi.token.list` process to ensure that
+   * other listeners see the updated schema.
+   *
+   * @param \Civi\Token\Event\TokenRegisterEvent $e
+   */
+  public function onRegisterTokens(TokenRegisterEvent $e): void {
+    $tokenProc = $e->getTokenProcessor();
+    foreach ($this->findRelevantMappings($tokenProc) as $mapping) {
+      $tokenProc->addSchema($mapping['destEntityId']);
+    }
+  }
+
+  /**
+   * When evaluating tokens, ensure that implied data is loaded.
+   *
+   * Ex: If `$context['participantId']` is supplied, then lookup the
+   * corresponding `$context['eventId']`.
+   *
+   * This fires early during the `civi.token.list` process to ensure that
+   * other listeners see the autoloaded values.
+   *
+   * @param \Civi\Token\Event\TokenValueEvent $e
+   */
+  public function onEvaluateTokens(TokenValueEvent $e): void {
+    $tokenProc = $e->getTokenProcessor();
+    foreach ($this->findRelevantMappings($tokenProc) as $mapping) {
+      $getSrcId = function($row) use ($mapping) {
+        return $row->context[$mapping['srcEntityId']] ?? $row->context[$mapping['srcEntityRec']]['id'] ?? NULL;
+      };
+
+      $ids = [];
+      foreach ($tokenProc->getRows() as $row) {
+        $ids[] = $getSrcId($row);
+      }
+      $ids = \array_diff(\array_unique($ids), [NULL]);
+      if (empty($ids)) {
+        continue;
+      }
+
+      [$srcTable, $fkColumn] = explode('.', $mapping['fk']);
+      $fks = \CRM_Utils_SQL_Select::from($srcTable)
+        ->where('id in (#ids)', ['ids' => $ids])
+        ->select(['id', $fkColumn])
+        ->execute()
+        ->fetchMap('id', $fkColumn);
+
+      $tokenProc->addSchema($mapping['destEntityId']);
+      foreach ($tokenProc->getRows() as $row) {
+        $srcId = $getSrcId($row);
+        if ($srcId && empty($row->context[$mapping['destEntityId']])) {
+          $row->context($mapping['destEntityId'], $fks[$srcId]);
+        }
+      }
+    }
+  }
+
+  /**
+   * Are there any context-fields for which we should do lookups?
+   *
+   * Ex: If the `$tokenProcessor` has the `participantId`s, then we would want
+   * to know any rules that involve `participantId`. But we don't need to know
+   * rules that involve `contributionId`.
+   *
+   * @param \Civi\Token\TokenProcessor $tokenProcessor
+   */
+  private function findRelevantMappings(TokenProcessor $tokenProcessor): iterable {
+    $schema = $tokenProcessor->context['schema'];
+    yield from [];
+    foreach ($this->getMappings() as $mapping) {
+      if (in_array($mapping['srcEntityRec'], $schema) || in_array($mapping['srcEntityId'], $schema)) {
+        yield $mapping;
+      }
+    }
+  }
+
+  private function getMappings(): iterable {
+    yield [
+      'srcEntityId' => 'participantId',
+      'srcEntityRec' => 'participant',
+      'fk' => 'civicrm_participant.event_id',
+      'destEntityId' => 'eventId',
+    ];
+  }
+
+}
diff --git a/civicrm/Civi/Token/TokenProcessor.php b/civicrm/Civi/Token/TokenProcessor.php
index 0451b2ae53..93c1e01c1a 100644
--- a/civicrm/Civi/Token/TokenProcessor.php
+++ b/civicrm/Civi/Token/TokenProcessor.php
@@ -127,6 +127,17 @@ class TokenProcessor {
     $this->context = $context;
   }
 
+  /**
+   * Add new elements to the field schema.
+   *
+   * @param string|string[] $fieldNames
+   * @return TokenProcessor
+   */
+  public function addSchema($fieldNames) {
+    $this->context['schema'] = array_unique(array_merge($this->context['schema'], (array) $fieldNames));
+    return $this;
+  }
+
   /**
    * Register a string for which we'll need to merge in tokens.
    *
diff --git a/civicrm/civicrm-version.php b/civicrm/civicrm-version.php
index 72e0051097..387c928260 100644
--- a/civicrm/civicrm-version.php
+++ b/civicrm/civicrm-version.php
@@ -1,7 +1,7 @@
 <?php
 /** @deprecated */
 function civicrmVersion( ) {
-  return array( 'version'  => '5.43.0',
+  return array( 'version'  => '5.43.2',
                 'cms'      => 'Wordpress',
                 'revision' => '' );
 }
diff --git a/civicrm/ext/afform/admin/info.xml b/civicrm/ext/afform/admin/info.xml
index f80148bb32..b7fabd0ba0 100644
--- a/civicrm/ext/afform/admin/info.xml
+++ b/civicrm/ext/afform/admin/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-09</releaseDate>
-  <version>5.43.0</version>
+  <version>5.43.2</version>
   <develStage>beta</develStage>
   <compatibility>
     <ver>5.23</ver>
diff --git a/civicrm/ext/afform/core/info.xml b/civicrm/ext/afform/core/info.xml
index 82de9f23c0..bf183d0407 100644
--- a/civicrm/ext/afform/core/info.xml
+++ b/civicrm/ext/afform/core/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-09</releaseDate>
-  <version>5.43.0</version>
+  <version>5.43.2</version>
   <develStage>beta</develStage>
   <compatibility>
     <ver>5.23</ver>
diff --git a/civicrm/ext/afform/html/info.xml b/civicrm/ext/afform/html/info.xml
index 16f0c5d8f3..579a362e59 100644
--- a/civicrm/ext/afform/html/info.xml
+++ b/civicrm/ext/afform/html/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-09</releaseDate>
-  <version>5.43.0</version>
+  <version>5.43.2</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.23</ver>
diff --git a/civicrm/ext/afform/mock/info.xml b/civicrm/ext/afform/mock/info.xml
index 78389d0e6f..6aa8643b97 100644
--- a/civicrm/ext/afform/mock/info.xml
+++ b/civicrm/ext/afform/mock/info.xml
@@ -15,7 +15,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2020-01-09</releaseDate>
-  <version>5.43.0</version>
+  <version>5.43.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/authx/info.xml b/civicrm/ext/authx/info.xml
index 02b8cfb1f1..dd58227d71 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.43.0</version>
+  <version>5.43.2</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.0</ver>
diff --git a/civicrm/ext/ckeditor4/info.xml b/civicrm/ext/ckeditor4/info.xml
index 2bd2c602aa..b693c9e7ad 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.43.0</version>
+  <version>5.43.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.39</ver>
diff --git a/civicrm/ext/contributioncancelactions/info.xml b/civicrm/ext/contributioncancelactions/info.xml
index 351d99f1e3..d02685382c 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.43.0</version>
+  <version>5.43.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.32</ver>
diff --git a/civicrm/ext/eventcart/info.xml b/civicrm/ext/eventcart/info.xml
index 55a0ddb655..c69586d42e 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.43.0</version>
+  <version>5.43.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/ewaysingle/info.xml b/civicrm/ext/ewaysingle/info.xml
index ea6bd038ab..41e615bc7a 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.43.0</version>
+  <version>5.43.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/financialacls/info.xml b/civicrm/ext/financialacls/info.xml
index dfba585dac..0259224dd5 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.43.0</version>
+  <version>5.43.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.30</ver>
diff --git a/civicrm/ext/flexmailer/info.xml b/civicrm/ext/flexmailer/info.xml
index ff0c21b536..58da017732 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.43.0</version>
+  <version>5.43.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 5b14a03fd4..4a2803196f 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.43.0</version>
+  <version>5.43.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/legacycustomsearches/info.xml b/civicrm/ext/legacycustomsearches/info.xml
index 26317d3d7c..d520119537 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.43.0</version>
+  <version>5.43.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 4f05213f31..de41e99d53 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.43.0</version>
+  <version>5.43.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 f6c9354ed3..dd1aadfbad 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.43.0</version>
+  <version>5.43.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.38</ver>
diff --git a/civicrm/ext/payflowpro/info.xml b/civicrm/ext/payflowpro/info.xml
index c29c81db22..2bac6679d9 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.43.0</version>
+  <version>5.43.2</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.0</ver>
diff --git a/civicrm/ext/recaptcha/info.xml b/civicrm/ext/recaptcha/info.xml
index fb037476fe..5886d25e4e 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.43.0</version>
+  <version>5.43.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 ff9f274879..3d02008230 100644
--- a/civicrm/ext/search_kit/info.xml
+++ b/civicrm/ext/search_kit/info.xml
@@ -14,7 +14,7 @@
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
   <releaseDate>2021-01-06</releaseDate>
-  <version>5.43.0</version>
+  <version>5.43.2</version>
   <develStage>beta</develStage>
   <compatibility>
     <ver>5.38</ver>
diff --git a/civicrm/ext/sequentialcreditnotes/info.xml b/civicrm/ext/sequentialcreditnotes/info.xml
index c1551dc14e..04da0ec9eb 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.43.0</version>
+  <version>5.43.2</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/release-notes.md b/civicrm/release-notes.md
index dffc97b019..6c02ae5cdf 100644
--- a/civicrm/release-notes.md
+++ b/civicrm/release-notes.md
@@ -15,6 +15,24 @@ Other resources for identifying changes are:
     * https://github.com/civicrm/civicrm-joomla
     * https://github.com/civicrm/civicrm-wordpress
 
+## CiviCRM 5.43.2
+
+Released November 15, 2021
+
+- **[Synopsis](release-notes/5.43.2.md#synopsis)**
+- **[Bugs resolved](release-notes/5.43.2.md#bugs)**
+- **[Credits](release-notes/5.43.2.md#credits)**
+- **[Feedback](release-notes/5.43.2.md#feedback)**
+
+## CiviCRM 5.43.1
+
+Released November 12, 2021
+
+- **[Synopsis](release-notes/5.43.1.md#synopsis)**
+- **[Bugs resolved](release-notes/5.43.1.md#bugs)**
+- **[Credits](release-notes/5.43.1.md#credits)**
+- **[Feedback](release-notes/5.43.1.md#feedback)**
+
 ## CiviCRM 5.43.0
 
 Released November 3, 2021
diff --git a/civicrm/release-notes/5.43.1.md b/civicrm/release-notes/5.43.1.md
new file mode 100644
index 0000000000..8c5f76cf50
--- /dev/null
+++ b/civicrm/release-notes/5.43.1.md
@@ -0,0 +1,41 @@
+# CiviCRM 5.43.1
+
+Released November 11, 2021
+
+- **[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**  |
+
+## <a name="bugs"></a>Bugs resolved
+
+* **_Upgrader_: Upgrader crashes when migrating some smart groups ([dev/core#2550](https://lab.civicrm.org/dev/core/-/issues/2550): [#21997](https://github.com/civicrm/civicrm-core/pull/21997))**
+* **_Maps_: Map link displays critical error ([dev/core#2942](https://lab.civicrm.org/dev/core/-/issues/2942): [#21980](https://github.com/civicrm/civicrm-core/pull/21980))**
+* **_CiviEvent_: `{event.*}` tokens do not render in PDFs for participants ([dev/core#2947](https://lab.civicrm.org/dev/core/-/issues/2947): [#22046](https://github.com/civicrm/civicrm-core/pull/22046))**
+* **_APIv4_: Fix failure when joining unusual custom-field-sets. ([dev/mail#103](https://lab.civicrm.org/dev/mail/-/issues/103): [#22051](https://github.com/civicrm/civicrm-core/pull/22051))**
+
+    Note: This bug manifested as a crash when loading CiviMail tokens via APIv4. It only affects custom-field-sets where the _internal machine name_ is unusual.
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Wikimedia Foundation - Eileen McNaughton; PeaceWorks Technology Solutions - Martin Hansen; JMA Consulting - Monish Deb,
+Seamus Lee; Dave D; Coop SymbioTIC - Mathieu Lutfy; CiviCRM - Coleman Watts, Tim Otten; lishaw1968; @treasurer
+
+## <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/release-notes/5.43.2.md b/civicrm/release-notes/5.43.2.md
new file mode 100644
index 0000000000..fde306fbb1
--- /dev/null
+++ b/civicrm/release-notes/5.43.2.md
@@ -0,0 +1,37 @@
+# CiviCRM 5.43.2
+
+Released November 15, 2021
+
+- **[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
+
+* **_Drupal 9_: Fix session error for anonymous user on Drupal 9.2  ([dev/drupal#169](https://lab.civicrm.org/dev/drupal/-/issues/169): [#22071](https://github.com/civicrm/civicrm-core/pull/22071))**
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Tadpole Collective - Kevin Cristiano; Semper IT - Karin Gerritsen; Megaphone Technology
+Consulting - Jon Goldberg; JMA Consulting - Seamus Lee; Fuzion - Peter Davis; Dave D;
+CiviCRM - Tim Otten; CiviCoop - Jaap Jansma
+
+## <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 4a929b5931..f580c90eaa 100644
--- a/civicrm/sql/civicrm_data.mysql
+++ b/civicrm/sql/civicrm_data.mysql
@@ -23962,4 +23962,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.43.0';
+UPDATE civicrm_domain SET version = '5.43.2';
diff --git a/civicrm/sql/civicrm_generated.mysql b/civicrm/sql/civicrm_generated.mysql
index a39591405e..44760006cc 100644
--- a/civicrm/sql/civicrm_generated.mysql
+++ b/civicrm/sql/civicrm_generated.mysql
@@ -2869,7 +2869,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.43.0',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
+ (1,'Default Domain Name',NULL,'5.43.2',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
 /*!40000 ALTER TABLE `civicrm_domain` ENABLE KEYS */;
 UNLOCK TABLES;
 
diff --git a/civicrm/vendor/autoload.php b/civicrm/vendor/autoload.php
index 0e6b3a8761..9f0953d2a7 100644
--- a/civicrm/vendor/autoload.php
+++ b/civicrm/vendor/autoload.php
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer/autoload_real.php';
 
-return ComposerAutoloaderInit13e9b60dd93f8aaefb66b9a8626540e9::getLoader();
+return ComposerAutoloaderInit29763ef3c99982470d3ccd2d5af6ac9e::getLoader();
diff --git a/civicrm/vendor/composer/autoload_real.php b/civicrm/vendor/composer/autoload_real.php
index cc1d0749ec..08b16bac6f 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 ComposerAutoloaderInit13e9b60dd93f8aaefb66b9a8626540e9
+class ComposerAutoloaderInit29763ef3c99982470d3ccd2d5af6ac9e
 {
     private static $loader;
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit13e9b60dd93f8aaefb66b9a8626540e9
             return self::$loader;
         }
 
-        spl_autoload_register(array('ComposerAutoloaderInit13e9b60dd93f8aaefb66b9a8626540e9', 'loadClassLoader'), true, true);
+        spl_autoload_register(array('ComposerAutoloaderInit29763ef3c99982470d3ccd2d5af6ac9e', 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        spl_autoload_unregister(array('ComposerAutoloaderInit13e9b60dd93f8aaefb66b9a8626540e9', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInit29763ef3c99982470d3ccd2d5af6ac9e', 'loadClassLoader'));
 
         $includePaths = require __DIR__ . '/include_paths.php';
         $includePaths[] = get_include_path();
@@ -31,7 +31,7 @@ class ComposerAutoloaderInit13e9b60dd93f8aaefb66b9a8626540e9
         if ($useStaticLoader) {
             require_once __DIR__ . '/autoload_static.php';
 
-            call_user_func(\Composer\Autoload\ComposerStaticInit13e9b60dd93f8aaefb66b9a8626540e9::getInitializer($loader));
+            call_user_func(\Composer\Autoload\ComposerStaticInit29763ef3c99982470d3ccd2d5af6ac9e::getInitializer($loader));
         } else {
             $map = require __DIR__ . '/autoload_namespaces.php';
             foreach ($map as $namespace => $path) {
@@ -52,19 +52,19 @@ class ComposerAutoloaderInit13e9b60dd93f8aaefb66b9a8626540e9
         $loader->register(true);
 
         if ($useStaticLoader) {
-            $includeFiles = Composer\Autoload\ComposerStaticInit13e9b60dd93f8aaefb66b9a8626540e9::$files;
+            $includeFiles = Composer\Autoload\ComposerStaticInit29763ef3c99982470d3ccd2d5af6ac9e::$files;
         } else {
             $includeFiles = require __DIR__ . '/autoload_files.php';
         }
         foreach ($includeFiles as $fileIdentifier => $file) {
-            composerRequire13e9b60dd93f8aaefb66b9a8626540e9($fileIdentifier, $file);
+            composerRequire29763ef3c99982470d3ccd2d5af6ac9e($fileIdentifier, $file);
         }
 
         return $loader;
     }
 }
 
-function composerRequire13e9b60dd93f8aaefb66b9a8626540e9($fileIdentifier, $file)
+function composerRequire29763ef3c99982470d3ccd2d5af6ac9e($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 61aa8ba849..9863109e92 100644
--- a/civicrm/vendor/composer/autoload_static.php
+++ b/civicrm/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
 
 namespace Composer\Autoload;
 
-class ComposerStaticInit13e9b60dd93f8aaefb66b9a8626540e9
+class ComposerStaticInit29763ef3c99982470d3ccd2d5af6ac9e
 {
     public static $files = array (
         '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@@ -572,11 +572,11 @@ class ComposerStaticInit13e9b60dd93f8aaefb66b9a8626540e9
     public static function getInitializer(ClassLoader $loader)
     {
         return \Closure::bind(function () use ($loader) {
-            $loader->prefixLengthsPsr4 = ComposerStaticInit13e9b60dd93f8aaefb66b9a8626540e9::$prefixLengthsPsr4;
-            $loader->prefixDirsPsr4 = ComposerStaticInit13e9b60dd93f8aaefb66b9a8626540e9::$prefixDirsPsr4;
-            $loader->prefixesPsr0 = ComposerStaticInit13e9b60dd93f8aaefb66b9a8626540e9::$prefixesPsr0;
-            $loader->fallbackDirsPsr0 = ComposerStaticInit13e9b60dd93f8aaefb66b9a8626540e9::$fallbackDirsPsr0;
-            $loader->classMap = ComposerStaticInit13e9b60dd93f8aaefb66b9a8626540e9::$classMap;
+            $loader->prefixLengthsPsr4 = ComposerStaticInit29763ef3c99982470d3ccd2d5af6ac9e::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInit29763ef3c99982470d3ccd2d5af6ac9e::$prefixDirsPsr4;
+            $loader->prefixesPsr0 = ComposerStaticInit29763ef3c99982470d3ccd2d5af6ac9e::$prefixesPsr0;
+            $loader->fallbackDirsPsr0 = ComposerStaticInit29763ef3c99982470d3ccd2d5af6ac9e::$fallbackDirsPsr0;
+            $loader->classMap = ComposerStaticInit29763ef3c99982470d3ccd2d5af6ac9e::$classMap;
 
         }, null, ClassLoader::class);
     }
diff --git a/civicrm/xml/version.xml b/civicrm/xml/version.xml
index 99267b3757..278f13f5f5 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.43.0</version_no>
+  <version_no>5.43.2</version_no>
 </version>
-- 
GitLab