diff --git a/civicrm.php b/civicrm.php
index 25cace6037650c376270de533bd3d47476a3b78f..65088106d83c7fd7f4cf9f232bf6b3901f09f394 100644
--- a/civicrm.php
+++ b/civicrm.php
@@ -2,7 +2,7 @@
 /**
  * Plugin Name: CiviCRM
  * Description: CiviCRM - Growing and Sustaining Relationships
- * Version: 5.40.3
+ * Version: 5.40.4
  * 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.40.3');
+define('CIVICRM_PLUGIN_VERSION', '5.40.4');
 
 // Store reference to this file.
 if (!defined('CIVICRM_PLUGIN_FILE')) {
diff --git a/civicrm/CRM/Contribute/BAO/Contribution.php b/civicrm/CRM/Contribute/BAO/Contribution.php
index e0f140a7bde022f279df64ff3dbd278f0cd26182..bb4c88d07499ce4923b3dccc0fc74bcbabcf7e61 100644
--- a/civicrm/CRM/Contribute/BAO/Contribution.php
+++ b/civicrm/CRM/Contribute/BAO/Contribution.php
@@ -192,7 +192,6 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
     if (!isset($params['tax_amount']) && $setPrevContribution && (isset($params['total_amount']) ||
      isset($params['financial_type_id']))) {
       $params['tax_amount'] = $taxAmount;
-      $params['total_amount'] = $taxAmount + $lineTotal;
     }
     if (isset($params['tax_amount']) && empty($params['skipLineItem'])
       && !CRM_Utils_Money::equals($params['tax_amount'], $taxAmount, ($params['currency'] ?? Civi::settings()->get('defaultCurrency')))
diff --git a/civicrm/CRM/Price/BAO/LineItem.php b/civicrm/CRM/Price/BAO/LineItem.php
index c2c707f7b0c46e6d9ce0cd51a98d54fdcbfd17c8..73a0c78fdedff1fd0c83f5a405b31587377ca40c 100644
--- a/civicrm/CRM/Price/BAO/LineItem.php
+++ b/civicrm/CRM/Price/BAO/LineItem.php
@@ -513,17 +513,20 @@ WHERE li.contribution_id = %1";
           }
           $financialType = $values['financial_type_id'];
         }
+        $taxRates = CRM_Core_PseudoConstant::getTaxRates();
+        $taxRate = $taxRates[$financialType] ?? 0;
+        $taxAmount = ($taxRate / 100) * $totalAmount / (1 + ($taxRate / 100));
         $lineItem = [
           'price_field_id' => $values['priceFieldID'],
           'price_field_value_id' => $values['priceFieldValueID'],
           'label' => $values['label'],
           'qty' => 1,
-          'unit_price' => $totalAmount,
-          'line_total' => $totalAmount,
+          'unit_price' => $totalAmount - $taxAmount,
+          'line_total' => $totalAmount - $taxAmount,
           'financial_type_id' => $financialType,
           'membership_type_id' => $values['membership_type_id'],
+          'tax_amount' => $taxAmount,
         ];
-        $lineItem['tax_amount'] = self::getTaxAmountForLineItem($lineItem);
         $params['line_item'][$values['setID']][$values['priceFieldID']] = $lineItem;
         break;
       }
diff --git a/civicrm/Civi/ActionSchedule/RecipientBuilder.php b/civicrm/Civi/ActionSchedule/RecipientBuilder.php
index 8871a4e6b6e05ae3f21182e3506411fb3bd704cb..2366b69fdd06026177f066b0ba79f0ba29421f51 100644
--- a/civicrm/Civi/ActionSchedule/RecipientBuilder.php
+++ b/civicrm/Civi/ActionSchedule/RecipientBuilder.php
@@ -409,10 +409,10 @@ class RecipientBuilder {
       else {
         $startDateClauses[] = "DATE_SUB(!casNow, INTERVAL 1 DAY ) <= {$date}";
       }
-      if (!empty($actionSchedule->effective_start_date)) {
+      if (!empty($actionSchedule->effective_start_date) && $actionSchedule->effective_start_date !== '0000-00-00 00:00:00') {
         $startDateClauses[] = "'{$actionSchedule->effective_start_date}' <= {$date}";
       }
-      if (!empty($actionSchedule->effective_end_date)) {
+      if (!empty($actionSchedule->effective_end_date) && $actionSchedule->effective_end_date !== '0000-00-00 00:00:00') {
         $startDateClauses[] = "'{$actionSchedule->effective_end_date}' > {$date}";
       }
     }
diff --git a/civicrm/api/v3/Contribution.php b/civicrm/api/v3/Contribution.php
index 3a72fd9f650cfb3469955f25e1d6762ece961cd6..e3d49c086c09bb6ddb2bc7a3944c0fd8f1602f96 100644
--- a/civicrm/api/v3/Contribution.php
+++ b/civicrm/api/v3/Contribution.php
@@ -70,6 +70,18 @@ function civicrm_api3_contribution_create($params) {
       throw new API_Exception($error['financial_type_id']);
     }
   }
+  if (!isset($params['tax_amount']) && empty($params['line_item'])
+    && empty($params['skipLineItem'])
+    && empty($params['id'])
+  ) {
+    $taxRates = CRM_Core_PseudoConstant::getTaxRates();
+    $taxRate = $taxRates[$params['financial_type_id']] ?? 0;
+    if ($taxRate) {
+      // Be afraid - historically if a contribution was tax then the passed in amount is EXCLUSIVE
+      $params['tax_amount'] = $params['total_amount'] * ($taxRate / 100);
+      $params['total_amount'] += $params['tax_amount'];
+    }
+  }
   _civicrm_api3_contribution_create_legacy_support_45($params);
 
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Contribution');
diff --git a/civicrm/civicrm-version.php b/civicrm/civicrm-version.php
index efa82fb7f45b5fe1718a07a43005c2f56d035915..5bae061c1c67ab45f1f6f949faf72e75a6ff314e 100644
--- a/civicrm/civicrm-version.php
+++ b/civicrm/civicrm-version.php
@@ -1,7 +1,7 @@
 <?php
 /** @deprecated */
 function civicrmVersion( ) {
-  return array( 'version'  => '5.40.3',
+  return array( 'version'  => '5.40.4',
                 'cms'      => 'Wordpress',
                 'revision' => '' );
 }
diff --git a/civicrm/ext/afform/admin/info.xml b/civicrm/ext/afform/admin/info.xml
index c45682b9c8025d4a7f947c86b3b405719677dfcf..6ec24b028c8dfa5100bdddae8d09621e9f38e6ab 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.40.3</version>
+  <version>5.40.4</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.23</ver>
diff --git a/civicrm/ext/afform/core/info.xml b/civicrm/ext/afform/core/info.xml
index cfdfff3b1183d46218b6943259be86957a04b3e5..395c32ba75a56805bf8b2c32c489bf2b2927d891 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.40.3</version>
+  <version>5.40.4</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.23</ver>
diff --git a/civicrm/ext/afform/html/info.xml b/civicrm/ext/afform/html/info.xml
index 763dc9efa980d714d422c796164275c7899dc8e6..797925020ab845e172ce70f4878af5dbad4a6cbf 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.40.3</version>
+  <version>5.40.4</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 fc0e1ab9da4103a8c095974266c7e4e7ff87616d..6bf8ae9d40121e197fe5217f1743443c114dd4e1 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.40.3</version>
+  <version>5.40.4</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/authx/info.xml b/civicrm/ext/authx/info.xml
index 2933f00a5448d63337cf5fc610a9dcec9392422f..4e190d5c6b53f907c7e1ab152ae415938aebd947 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.40.3</version>
+  <version>5.40.4</version>
   <develStage>alpha</develStage>
   <compatibility>
     <ver>5.0</ver>
diff --git a/civicrm/ext/ckeditor4/info.xml b/civicrm/ext/ckeditor4/info.xml
index f1d15ff152a431bb12f5ed5e4a3ba56ecb284ea7..783a9b643d44948ac4e5b74accc6aa0ae362050e 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.40.3</version>
+  <version>5.40.4</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.39</ver>
diff --git a/civicrm/ext/contributioncancelactions/info.xml b/civicrm/ext/contributioncancelactions/info.xml
index adce09ddf2185da074d58b0b9c2741fc21adec70..7aa49f341a9332cf581df36c3c6e1574acc76da2 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.40.3</version>
+  <version>5.40.4</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.32</ver>
diff --git a/civicrm/ext/eventcart/info.xml b/civicrm/ext/eventcart/info.xml
index 0a10cb31c104056e21138dea08ea996014d2ea56..6f0dd0456e7b69c510c53f3f32f996082b0f671b 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.40.3</version>
+  <version>5.40.4</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/ewaysingle/info.xml b/civicrm/ext/ewaysingle/info.xml
index 787cb0780b5b2c9b9c88922ef4efca57371ddb3d..3a74b27fabfb59c72835c90b539c379a1328f0eb 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.40.3</version>
+  <version>5.40.4</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/financialacls/info.xml b/civicrm/ext/financialacls/info.xml
index f736cf49f63a970ce5731d2def6de12f5bfa17ed..476f62387e4a436b4b055d67f29293df6c85301b 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.40.3</version>
+  <version>5.40.4</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.30</ver>
diff --git a/civicrm/ext/flexmailer/info.xml b/civicrm/ext/flexmailer/info.xml
index 2c96e5c8cfa3a9ceaf919ae04fa3f79801f4839e..1e8f838763ec2252cb47ba4a53fc6d2e7b14d123 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.40.3</version>
+  <version>5.40.4</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 9cb0d93772edbbd49491946d3e0383629da7c001..5f06438c82dbae322fa4f1b7fcc41a174f56c28e 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.40.3</version>
+  <version>5.40.4</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/oauth-client/info.xml b/civicrm/ext/oauth-client/info.xml
index e6ea25d0170c4574085c9ea77d8b5680bae0e2bb..08f4cf644cc72cd9650c832ef46a4fc8ceaf1854 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.40.3</version>
+  <version>5.40.4</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.38</ver>
diff --git a/civicrm/ext/payflowpro/info.xml b/civicrm/ext/payflowpro/info.xml
index 1d0fa68116e41cb545d740704bb0803f5993fe45..1169c29c0d62086eb14baded68a0e121469db6e2 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.40.3</version>
+  <version>5.40.4</version>
   <develStage>stable</develStage>
   <compatibility>
     <ver>5.0</ver>
diff --git a/civicrm/ext/recaptcha/info.xml b/civicrm/ext/recaptcha/info.xml
index dbeee75ed889862490b2fcd0965b8cf1cc08719a..131df01ae1ee3d882a415858740045fc1450ef76 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.40.3</version>
+  <version>5.40.4</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/ext/search_kit/info.xml b/civicrm/ext/search_kit/info.xml
index 8907eeee809d64a6c33c4395e988684d6ef5bf35..240b38043f9826f5dc91bd9a3fc07190a5683008 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.40.3</version>
+  <version>5.40.4</version>
   <develStage>beta</develStage>
   <compatibility>
     <ver>5.38</ver>
diff --git a/civicrm/ext/sequentialcreditnotes/info.xml b/civicrm/ext/sequentialcreditnotes/info.xml
index e904cef807ed499b51dfcdeff199ff8dec9e784f..f53f9ca60489704a9c6caaf50c51ecc427dcd435 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.40.3</version>
+  <version>5.40.4</version>
   <tags>
     <tag>mgmt:hidden</tag>
   </tags>
diff --git a/civicrm/release-notes.md b/civicrm/release-notes.md
index bf9ec0185a4e955afb010c6ff271f4f7e865dda2..655b836c8965002d11d00f9c215f8526b7849895 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.40.4
+
+Released August 26, 2021
+
+- **[Synopsis](release-notes/5.40.4.md#synopsis)**
+- **[Bugs resolved](release-notes/5.40.4.md#bugs)**
+- **[Credits](release-notes/5.40.4.md#credits)**
+- **[Feedback](release-notes/5.40.4.md#feedback)**
+
 ## CiviCRM 5.40.3
 
 Released August 23, 2021
diff --git a/civicrm/release-notes/5.40.4.md b/civicrm/release-notes/5.40.4.md
new file mode 100644
index 0000000000000000000000000000000000000000..ee2fbd93a9b3a648dd1fd0ced837c183c814670e
--- /dev/null
+++ b/civicrm/release-notes/5.40.4.md
@@ -0,0 +1,41 @@
+# CiviCRM 5.40.4
+
+Released August 26, 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
+
+* **_CiviContribute_: Fix line-item total calculation ([dev/financial#182](https://lab.civicrm.org/dev/financial/-/issues/182): [#21212](https://github.com/civicrm/civicrm-core/pull/21212))**
+
+  The total may sometimes incorrectly include tax-amount. This did not impact contributions through core forms but could impact customizations/add-ons that add taxed items via API.
+
+* **_Export_: Fix error when editing SMS-based reminders ([dev/core#2784](https://lab.civicrm.org/dev/core/-/issues/2784): [#21239](https://github.com/civicrm/civicrm-core/pull/21239))**
+* **_Scheduled Reminders_: Work-around to enable reminders when the "Effective Start/End Date" is "0000-00-00 00:00:00". ([dev/core#2787](https://lab.civicrm.org/dev/core/-/issues/2787): [#21250](https://github.com/civicrm/civicrm-core/pull/21250))**
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Wikimedia Foundation - Eileen McNaughton; Tadpole Collective - Kevin Cristiano; Semper IT - Karin Gerritsen; JMA Consulting - Seamus Lee, Monish Deb; Fuzion - Jitendra Purohit;
+Dave D; CiviCoop - Jaap Jansma; CiviCRM - Tim Otten; Agileware - Justin Freeman
+
+## <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 60c9411e705c93e2ca6586fef5278d5db605bf7f..f971c3b4154a9caec71e54a2563d563585971805 100644
--- a/civicrm/sql/civicrm_data.mysql
+++ b/civicrm/sql/civicrm_data.mysql
@@ -23954,4 +23954,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.40.3';
+UPDATE civicrm_domain SET version = '5.40.4';
diff --git a/civicrm/sql/civicrm_generated.mysql b/civicrm/sql/civicrm_generated.mysql
index b23dad755ca0533fdeb869c57b9927c8e13f6424..c54949ae56551cfbc45604039e1adee928bbbeb4 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.40.3',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
+ (1,'Default Domain Name',NULL,'5.40.4',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 c6f842dd0d286137e6eb39174eb7c9c52f17e416..37461309afc0a15191e8ab44eeb435d2a969967e 100644
--- a/civicrm/vendor/autoload.php
+++ b/civicrm/vendor/autoload.php
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer/autoload_real.php';
 
-return ComposerAutoloaderInit47aa25b517a223cfa6c95bd671b17c66::getLoader();
+return ComposerAutoloaderInitd3b425df3f98c8fcc68875089e748d8c::getLoader();
diff --git a/civicrm/vendor/composer/autoload_real.php b/civicrm/vendor/composer/autoload_real.php
index 4d662e294041b30308c8c5dfaa8c2874ab38d383..b163669b82ff63f1c08c3e35ccb99ebce373004e 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 ComposerAutoloaderInit47aa25b517a223cfa6c95bd671b17c66
+class ComposerAutoloaderInitd3b425df3f98c8fcc68875089e748d8c
 {
     private static $loader;
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit47aa25b517a223cfa6c95bd671b17c66
             return self::$loader;
         }
 
-        spl_autoload_register(array('ComposerAutoloaderInit47aa25b517a223cfa6c95bd671b17c66', 'loadClassLoader'), true, true);
+        spl_autoload_register(array('ComposerAutoloaderInitd3b425df3f98c8fcc68875089e748d8c', 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        spl_autoload_unregister(array('ComposerAutoloaderInit47aa25b517a223cfa6c95bd671b17c66', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInitd3b425df3f98c8fcc68875089e748d8c', 'loadClassLoader'));
 
         $includePaths = require __DIR__ . '/include_paths.php';
         $includePaths[] = get_include_path();
@@ -31,7 +31,7 @@ class ComposerAutoloaderInit47aa25b517a223cfa6c95bd671b17c66
         if ($useStaticLoader) {
             require_once __DIR__ . '/autoload_static.php';
 
-            call_user_func(\Composer\Autoload\ComposerStaticInit47aa25b517a223cfa6c95bd671b17c66::getInitializer($loader));
+            call_user_func(\Composer\Autoload\ComposerStaticInitd3b425df3f98c8fcc68875089e748d8c::getInitializer($loader));
         } else {
             $map = require __DIR__ . '/autoload_namespaces.php';
             foreach ($map as $namespace => $path) {
@@ -52,19 +52,19 @@ class ComposerAutoloaderInit47aa25b517a223cfa6c95bd671b17c66
         $loader->register(true);
 
         if ($useStaticLoader) {
-            $includeFiles = Composer\Autoload\ComposerStaticInit47aa25b517a223cfa6c95bd671b17c66::$files;
+            $includeFiles = Composer\Autoload\ComposerStaticInitd3b425df3f98c8fcc68875089e748d8c::$files;
         } else {
             $includeFiles = require __DIR__ . '/autoload_files.php';
         }
         foreach ($includeFiles as $fileIdentifier => $file) {
-            composerRequire47aa25b517a223cfa6c95bd671b17c66($fileIdentifier, $file);
+            composerRequired3b425df3f98c8fcc68875089e748d8c($fileIdentifier, $file);
         }
 
         return $loader;
     }
 }
 
-function composerRequire47aa25b517a223cfa6c95bd671b17c66($fileIdentifier, $file)
+function composerRequired3b425df3f98c8fcc68875089e748d8c($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 15344a85e714846ab667f1bbde4b8f6ffd6c66b1..10e8acd57b081aa48e6c556335c456a8ef6ef6ba 100644
--- a/civicrm/vendor/composer/autoload_static.php
+++ b/civicrm/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
 
 namespace Composer\Autoload;
 
-class ComposerStaticInit47aa25b517a223cfa6c95bd671b17c66
+class ComposerStaticInitd3b425df3f98c8fcc68875089e748d8c
 {
     public static $files = array (
         '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@@ -572,11 +572,11 @@ class ComposerStaticInit47aa25b517a223cfa6c95bd671b17c66
     public static function getInitializer(ClassLoader $loader)
     {
         return \Closure::bind(function () use ($loader) {
-            $loader->prefixLengthsPsr4 = ComposerStaticInit47aa25b517a223cfa6c95bd671b17c66::$prefixLengthsPsr4;
-            $loader->prefixDirsPsr4 = ComposerStaticInit47aa25b517a223cfa6c95bd671b17c66::$prefixDirsPsr4;
-            $loader->prefixesPsr0 = ComposerStaticInit47aa25b517a223cfa6c95bd671b17c66::$prefixesPsr0;
-            $loader->fallbackDirsPsr0 = ComposerStaticInit47aa25b517a223cfa6c95bd671b17c66::$fallbackDirsPsr0;
-            $loader->classMap = ComposerStaticInit47aa25b517a223cfa6c95bd671b17c66::$classMap;
+            $loader->prefixLengthsPsr4 = ComposerStaticInitd3b425df3f98c8fcc68875089e748d8c::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInitd3b425df3f98c8fcc68875089e748d8c::$prefixDirsPsr4;
+            $loader->prefixesPsr0 = ComposerStaticInitd3b425df3f98c8fcc68875089e748d8c::$prefixesPsr0;
+            $loader->fallbackDirsPsr0 = ComposerStaticInitd3b425df3f98c8fcc68875089e748d8c::$fallbackDirsPsr0;
+            $loader->classMap = ComposerStaticInitd3b425df3f98c8fcc68875089e748d8c::$classMap;
 
         }, null, ClassLoader::class);
     }
diff --git a/civicrm/xml/version.xml b/civicrm/xml/version.xml
index 4907745e0151be01145abeb540e499d2257c2055..ee3cdfe0ac823a6eb7897d5e356e134ff74d67eb 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.40.3</version_no>
+  <version_no>5.40.4</version_no>
 </version>