Merge pull request #16516 from colemanw/request
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 14 Feb 2020 11:12:28 +0000 (00:12 +1300)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2020 11:12:28 +0000 (00:12 +1300)
APIv4 - merge ActionUtil with Request::create

35 files changed:
CRM/Admin/Form/Generic.php
CRM/Admin/Form/Preferences/Contribute.php
CRM/Admin/Form/SettingTrait.php
CRM/Api4/Page/AJAX.php
CRM/Contact/BAO/Query.php
CRM/Contact/Page/AJAX.php
CRM/Contact/Page/Inline/CommunicationPreferences.php
CRM/Contact/Page/Inline/OpenID.php
CRM/Contact/Page/Inline/Phone.php
CRM/Contact/Page/Inline/Website.php
CRM/Contribute/Form/AbstractEditPayment.php
CRM/Contribute/Form/AdditionalPayment.php
CRM/Core/BAO/ConfigSetting.php
CRM/Core/BAO/Log.php
CRM/Core/Form.php
CRM/Core/Page/AJAX/Location.php
CRM/Core/Payment.php
CRM/Core/Payment/Dummy.php
CRM/Core/Payment/Manual.php
CRM/Financial/BAO/PaymentProcessor.php
CRM/Mailing/MailStore/Imap.php
CRM/Report/Form/Contact/Relationship.php
CRM/Report/Form/Contribute/Summary.php
CRM/SMS/Controller/Send.php
CRM/Utils/Hook.php
Civi/Test.php
composer.json
composer.lock
release-notes.md
release-notes/5.23.0.md [new file with mode: 0644]
settings/Contribute.setting.php
tests/phpunit/CRM/Financial/BAO/PaymentProcessorTest.php
tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch [deleted file]
tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch [deleted file]
tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch [deleted file]

index 00a4e3d3a4e86b622d5ef1f91f7c6bb9874eb5f6..2c23019a6af81885d15adadb288810791d674d9e 100644 (file)
@@ -50,14 +50,6 @@ class CRM_Admin_Form_Generic extends CRM_Core_Form {
    * Build the form object.
    */
   public function buildQuickForm() {
-    $filter = $this->getSettingPageFilter();
-    $settings = civicrm_api3('Setting', 'getfields', [])['values'];
-    foreach ($settings as $key => $setting) {
-      if (isset($setting['settings_pages'][$filter])) {
-        $this->_settings[$key] = $setting;
-      }
-    }
-
     $this->addFieldsDefinedInSettingsMetadata();
 
     // @todo look at sharing the code below in the settings trait.
index 69fa149cb0be8af77132b1d6730f817c17b5a0c9..e835e335e80218a3f12bd4f5a7fd4ace94fa7a6e 100644 (file)
  * This class generates form components for the display preferences.
  */
 class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
-  protected $_settings = [
-    'cvv_backoffice_required' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
-    'update_contribution_on_membership_type_change' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
-    'acl_financial_type' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
-    'always_post_to_accounts_receivable' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
-    'deferred_revenue_enabled' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
-    'default_invoice_page' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
-    'invoicing' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
-  ];
 
   /**
    * Our standards for settings are to have a setting per value with defined metadata.
@@ -35,7 +26,10 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
    * Unfortunately the 'contribution_invoice_settings' has been added in non-compliance.
    * We use this array to hack-handle.
    *
-   * I think the best way forwards would be to covert to multiple individual settings.
+   * These are now stored as individual settings but this form still does weird & wonderful things.
+   *
+   * Note the 'real' settings on this form are added via metadata definition - ie
+   * 'settings_pages' => ['contribute' => ['weight' => 1]], in their metadata.
    *
    * @var array
    */
@@ -43,10 +37,12 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
 
   /**
    * Build the form object.
+   *
+   * @throws \CiviCRM_API3_Exception
+   * @throws \CRM_Core_Exception
    */
   public function buildQuickForm() {
     parent::buildQuickForm();
-    $config = CRM_Core_Config::singleton();
     $this->invoiceSettings = [
       'invoice_prefix' => [
         'html_type' => 'text',
@@ -54,12 +50,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
         'weight' => 1,
         'description' => ts('Enter prefix to be display on PDF for invoice'),
       ],
-      'credit_notes_prefix' => [
-        'html_type' => 'text',
-        'title' => ts('Credit Notes Prefix'),
-        'weight' => 2,
-        'description' => ts('Enter prefix to be display on PDF for credit notes.'),
-      ],
       'due_date' => [
         'html_type' => 'text',
         'title' => ts('Due Date'),
index 840461009c300b197e49b6ff3d9cb3458cd37372..a4b59e523f353a0aa85b6e7469f523cb4e8a21de 100644 (file)
@@ -153,8 +153,10 @@ trait CRM_Admin_Form_SettingTrait {
    * Add fields in the metadata to the template.
    *
    * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
   protected function addFieldsDefinedInSettingsMetadata() {
+    $this->addSettingsToFormFromMetadata();
     $settingMetaData = $this->getSettingsMetaData();
     $descriptions = [];
     foreach ($settingMetaData as $setting => $props) {
@@ -174,7 +176,7 @@ trait CRM_Admin_Form_SettingTrait {
         }
 
         //Load input as readonly whose values are overridden in civicrm.settings.php.
-        if (Civi::settings()->getMandatory($setting)) {
+        if (Civi::settings()->getMandatory($setting) !== NULL) {
           $props['html_attributes']['readonly'] = TRUE;
           $this->includesReadOnlyFields = TRUE;
         }
@@ -222,7 +224,7 @@ trait CRM_Admin_Form_SettingTrait {
           $this->$add($setting, $props['title'], $props['entity_reference_options']);
         }
         elseif ($add === 'addYesNo' && ($props['type'] === 'Boolean')) {
-          $this->addRadio($setting, $props['title'], [1 => 'Yes', 0 => 'No'], NULL, '&nbsp;&nbsp;');
+          $this->addRadio($setting, $props['title'], [1 => 'Yes', 0 => 'No'], CRM_Utils_Array::value('html_attributes', $props), '&nbsp;&nbsp;');
         }
         elseif ($add === 'add') {
           $this->add($props['html_type'], $setting, $props['title'], $options);
@@ -372,4 +374,19 @@ trait CRM_Admin_Form_SettingTrait {
     return array_intersect($order, $settingValueKeys);
   }
 
+  /**
+   * Add settings to form if the metadata designates they should be on the page.
+   *
+   * @throws \CiviCRM_API3_Exception
+   */
+  protected function addSettingsToFormFromMetadata() {
+    $filter = $this->getSettingPageFilter();
+    $settings = civicrm_api3('Setting', 'getfields', [])['values'];
+    foreach ($settings as $key => $setting) {
+      if (isset($setting['settings_pages'][$filter])) {
+        $this->_settings[$key] = $setting;
+      }
+    }
+  }
+
 }
index da37b04682985781db5a365fc20da5a20abb79d2..94f9c329c788b4e81c44e70a778281cff276ed47 100644 (file)
@@ -65,7 +65,7 @@ class CRM_Api4_Page_AJAX extends CRM_Core_Page {
     try {
       // Call multiple
       if (empty($this->urlPath[3])) {
-        $calls = CRM_Utils_Request::retrieve('calls', 'String', CRM_Core_DAO::$_nullObject, TRUE, NULL, 'POST', TRUE);
+        $calls = CRM_Utils_Request::retrieve('calls', 'String', CRM_Core_DAO::$_nullObject, TRUE, NULL, 'POST');
         $calls = json_decode($calls, TRUE);
         $response = [];
         foreach ($calls as $index => $call) {
index 0f0a1644db220e09faaba0df6f43e26fa58425cd..04e33776d16aba525dec7c8f6a6c4851d8def2cb 100644 (file)
@@ -1791,6 +1791,10 @@ class CRM_Contact_BAO_Query {
       (substr($values[0], 0, 10) === 'financial_') ||
       (substr($values[0], 0, 8) === 'payment_') ||
       (substr($values[0], 0, 11) === 'membership_')
+      // temporary fix for regression https://lab.civicrm.org/dev/core/issues/1551
+      //  ideally the metadata would allow  this field to be parsed below & the special handling would not
+      // be needed.
+      || $values[0] === 'mailing_id'
     ) {
       return;
     }
@@ -4215,7 +4219,7 @@ WHERE  $smartGroupClause
         }
         $this->_qill[$grouping][] = 'Relationship Type(s) ' . $relQill . " $name";
       }
-      else {
+      elseif ($name) {
         $this->_qill[$grouping][] = $name;
       }
     }
@@ -7074,22 +7078,22 @@ AND   displayRelType.is_active = 1
       $secondWhere = str_replace('civicrm_contact.', 'contact_a.', $secondWhere);
     }
 
+    $this->_qill[$grouping][] = $this->getQillForRelativeDateRange($dates[0], $dates[1], $fieldSpec['title'], $filters[$value]);
+    if ($fieldName === 'relation_active_period_date') {
+      // Hack this to fix regression https://lab.civicrm.org/dev/core/issues/1592
+      // Not sure the  'right' fix.
+      $this->_where[$grouping] = [self::getRelationshipActivePeriodClauses($dates[0], $dates[1], TRUE)];
+      return;
+    }
+
     if (empty($dates[0])) {
       // ie. no start date we only have end date
       $this->_where[$grouping][] = $secondWhere . " <= '{$dates[1]}'";
-
-      $this->_qill[$grouping][] = ts('%1 is ', [$fieldSpec['title']]) . $filters[$value] . ' (' . ts("to %1", [
-        CRM_Utils_Date::customFormat($dates[1]),
-      ]) . ')';
     }
     elseif (empty($dates[1])) {
 
       // ie. no end date we only have start date
       $this->_where[$grouping][] = $where . " >= '{$dates[0]}'";
-
-      $this->_qill[$grouping][] = ts('%1 is ', [$fieldSpec['title']]) . $filters[$value] . ' (' . ts("from %1", [
-        CRM_Utils_Date::customFormat($dates[0]),
-      ]) . ')';
     }
     else {
       // we have start and end dates.
@@ -7099,11 +7103,6 @@ AND   displayRelType.is_active = 1
       else {
         $this->_where[$grouping][] = $where . " BETWEEN '{$dates[0]}' AND '{$dates[1]}'";
       }
-
-      $this->_qill[$grouping][] = ts('%1 is ', [$fieldSpec['title']]) . $filters[$value] . ' (' . ts("between %1 and %2", [
-        CRM_Utils_Date::customFormat($dates[0]),
-        CRM_Utils_Date::customFormat($dates[1]),
-      ]) . ')';
     }
   }
 
@@ -7231,4 +7230,27 @@ AND   displayRelType.is_active = 1
     }
   }
 
+  /**
+   * Get the qill for the relative date range.
+   *
+   * @param string|null $from
+   * @param string|null $to
+   * @param string $fieldTitle
+   * @param string $relativeRange
+   *
+   * @return string
+   */
+  protected function getQillForRelativeDateRange($from, $to, string $fieldTitle, string $relativeRange): string {
+    if (!$from) {
+      return ts('%1 is ', [$fieldTitle]) . $relativeRange . ' (' . ts('to %1', [CRM_Utils_Date::customFormat($to)]) . ')';
+    }
+    if (!$to) {
+      return ts('%1 is ', [$fieldTitle]) . $relativeRange . ' (' . ts('from %1', [CRM_Utils_Date::customFormat($from)]) . ')';
+    }
+    return ts('%1 is ', [$fieldTitle]) . $relativeRange . ' (' . ts('between %1 and %2', [
+      CRM_Utils_Date::customFormat($from),
+      CRM_Utils_Date::customFormat($to),
+    ]) . ')';
+  }
+
 }
index 444d3f96db1a16613f40093b44316da47b958049..334925e6af939e7fde784749714312d81b5845fa 100644 (file)
@@ -346,111 +346,51 @@ class CRM_Contact_Page_AJAX {
    *  Function to get email address of a contact.
    */
   public static function getContactEmail() {
-    if (!empty($_REQUEST['contact_id'])) {
-      $contactID = CRM_Utils_Type::escape($_REQUEST['contact_id'], 'Positive');
-      if (!CRM_Contact_BAO_Contact_Permission::allow($contactID, CRM_Core_Permission::EDIT)) {
-        return;
+    $queryStrings = [];
+    $name = CRM_Utils_Array::value('name', $_GET);
+    if ($name) {
+      $name = CRM_Utils_Type::escape($name, 'String');
+      $wildCard = Civi::settings()->get('includeWildCardInName') ? '%' : '';
+      foreach (['cc.sort_name', 'ce.email'] as $column) {
+        $queryStrings[] = "{$column} LIKE '{$wildCard}{$name}%'";
       }
-      list($displayName,
-        $userEmail
-        ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID);
+      $result = [];
+      $rowCount = Civi::settings()->get('search_autocomplete_count');
 
-      CRM_Utils_System::setHttpHeader('Content-Type', 'text/plain');
-      if ($userEmail) {
-        echo $userEmail;
-      }
-    }
-    else {
-      $noemail = CRM_Utils_Array::value('noemail', $_GET);
-      $queryString = NULL;
-      $name = CRM_Utils_Array::value('name', $_GET);
-      if ($name) {
-        $name = CRM_Utils_Type::escape($name, 'String');
-        if ($noemail) {
-          $queryString = " cc.sort_name LIKE '%$name%'";
-        }
-        else {
-          $queryString = " ( cc.sort_name LIKE '%$name%' OR ce.email LIKE '%$name%' ) ";
-        }
-      }
-      else {
-        $cid = CRM_Utils_Array::value('cid', $_GET);
-        if ($cid) {
-          //check cid for integer
-          $contIDS = explode(',', $cid);
-          foreach ($contIDS as $contID) {
-            CRM_Utils_Type::escape($contID, 'Integer');
-          }
-          $queryString = " cc.id IN ( $cid )";
-        }
+      // add acl clause here
+      list($aclFrom, $aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause('cc');
+      if ($aclWhere) {
+        $aclWhere = "AND {$aclWhere}";
       }
-
-      if ($queryString) {
-        $result = [];
-        $offset = CRM_Utils_Array::value('offset', $_GET, 0);
-        $rowCount = Civi::settings()->get('search_autocomplete_count');
-
-        $offset = CRM_Utils_Type::escape($offset, 'Int');
-
-        // add acl clause here
-        list($aclFrom, $aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause('cc');
-        if ($aclWhere) {
-          $aclWhere = " AND $aclWhere";
-        }
-        if ($noemail) {
-          $query = "
-SELECT sort_name name, cc.id
-FROM civicrm_contact cc
-     {$aclFrom}
-WHERE cc.is_deceased = 0 AND {$queryString}
-      {$aclWhere}
-LIMIT {$offset}, {$rowCount}
-";
-
-          // send query to hook to be modified if needed
-          CRM_Utils_Hook::contactListQuery($query,
-            $name,
-            CRM_Utils_Request::retrieve('context', 'Alphanumeric'),
-            CRM_Utils_Request::retrieve('cid', 'Positive')
-          );
-
-          $dao = CRM_Core_DAO::executeQuery($query);
-          while ($dao->fetch()) {
-            $result[] = [
-              'id' => $dao->id,
-              'text' => $dao->name,
-            ];
-          }
-        }
-        else {
-          $query = "
+      foreach ($queryStrings as &$queryString) {
+        $queryString = "(
 SELECT sort_name name, ce.email, cc.id
 FROM   civicrm_email ce INNER JOIN civicrm_contact cc ON cc.id = ce.contact_id
        {$aclFrom}
 WHERE  ce.on_hold = 0 AND cc.is_deceased = 0 AND cc.do_not_email = 0 AND {$queryString}
        {$aclWhere}
-LIMIT {$offset}, {$rowCount}
-";
+LIMIT {$rowCount}
+)";
+      }
+      $query = implode(' UNION ', $queryStrings) . " LIMIT {$rowCount}";
 
-          // send query to hook to be modified if needed
-          CRM_Utils_Hook::contactListQuery($query,
-            $name,
-            CRM_Utils_Request::retrieve('context', 'Alphanumeric'),
-            CRM_Utils_Request::retrieve('cid', 'Positive')
-          );
-
-          $dao = CRM_Core_DAO::executeQuery($query);
-
-          while ($dao->fetch()) {
-            //working here
-            $result[] = [
-              'text' => '"' . $dao->name . '" <' . $dao->email . '>',
-              'id' => (CRM_Utils_Array::value('id', $_GET)) ? "{$dao->id}::{$dao->email}" : '"' . $dao->name . '" <' . $dao->email . '>',
-            ];
-          }
-        }
-        CRM_Utils_JSON::output($result);
+      // send query to hook to be modified if needed
+      CRM_Utils_Hook::contactListQuery($query,
+        $name,
+        CRM_Utils_Request::retrieve('context', 'Alphanumeric'),
+        CRM_Utils_Request::retrieve('cid', 'Positive')
+      );
+
+      $dao = CRM_Core_DAO::executeQuery($query);
+
+      while ($dao->fetch()) {
+        //working here
+        $result[] = [
+          'text' => '"' . $dao->name . '" <' . $dao->email . '>',
+          'id' => (CRM_Utils_Array::value('id', $_GET)) ? "{$dao->id}::{$dao->email}" : '"' . $dao->name . '" <' . $dao->email . '>',
+        ];
       }
+      CRM_Utils_JSON::output($result);
     }
     CRM_Utils_System::civiExit();
   }
index a5648cdd677024a4af397bd676313ce8fe1393d5..9b95964b0191e8dc02cd7b413d8e33453d067b1d 100644 (file)
@@ -24,10 +24,12 @@ class CRM_Contact_Page_Inline_CommunicationPreferences extends CRM_Core_Page {
    * Run the page.
    *
    * This method is called after the page is created.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function run() {
     // get the emails for this contact
-    $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
+    $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
 
     $params = ['id' => $contactId];
 
index 50897e0bc65a4ab39b2041966e09966950d9ef55..53e93e9f5617cc5f878ab3263f90c4b487ae5b35 100644 (file)
@@ -24,10 +24,12 @@ class CRM_Contact_Page_Inline_OpenID extends CRM_Core_Page {
    * Run the page.
    *
    * This method is called after the page is created.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function run() {
     // get the emails for this contact
-    $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
+    $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
 
     $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', ['labelColumn' => 'display_name']);
 
index 478d1592ace1db4b54863d4046f24b40a037b1c6..714c1c039dd715a6132b5e524bd62453bc980c15 100644 (file)
@@ -24,10 +24,12 @@ class CRM_Contact_Page_Inline_Phone extends CRM_Core_Page {
    * Run the page.
    *
    * This method is called after the page is created.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function run() {
     // get the emails for this contact
-    $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
+    $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
 
     $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', ['labelColumn' => 'display_name']);
     $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
index e1402c96775781ecbcd4f49d6e7a4fea88ed9653..de416295df8da6c15cd918882ecc0771719c17fc 100644 (file)
@@ -24,10 +24,12 @@ class CRM_Contact_Page_Inline_Website extends CRM_Core_Page {
    * Run the page.
    *
    * This method is called after the page is created.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function run() {
     // get the emails for this contact
-    $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
+    $contactId = CRM_Utils_Request::retrieveValue('cid', 'Positive');
 
     $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
 
index 04be631bb13810d842ab22bbbae5b12b9e5b7a15..7469609f7fbcaf2fc35f40f3e8a639005888a976 100644 (file)
@@ -372,19 +372,12 @@ WHERE  contribution_id = {$id}
     }
     $this->_processors = [];
     foreach ($this->_paymentProcessors as $id => $processor) {
-      // @todo review this. The inclusion of this IF was to address test processors being incorrectly loaded.
-      // However the function $this->getValidProcessors() is expected to only return the processors relevant
-      // to the mode (using the actual id - ie. the id of the test processor for the test processor).
-      // for some reason there was a need to filter here per commit history - but this indicates a problem
-      // somewhere else.
-      if ($processor['is_test'] == ($this->_mode == 'test')) {
-        $this->_processors[$id] = $processor['name'];
-        if (!empty($processor['description'])) {
-          $this->_processors[$id] .= ' : ' . $processor['description'];
-        }
-        if ($processor['is_recur']) {
-          $this->_recurPaymentProcessors[$id] = $this->_processors[$id];
-        }
+      $this->_processors[$id] = $processor['name'];
+      if (!empty($processor['description'])) {
+        $this->_processors[$id] .= ' : ' . $processor['description'];
+      }
+      if ($processor['is_recur']) {
+        $this->_recurPaymentProcessors[$id] = $this->_processors[$id];
       }
     }
     // CRM-21002: pass the default payment processor ID whose credit card type icons should be populated first
index ee860de148faacef9a46c178cacb3336b98f096a..cf387bf9444c5898cd3acac6b83eefeeaa2d9508 100644 (file)
@@ -167,6 +167,8 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
 
   /**
    * Build the form object.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function buildQuickForm() {
     if ($this->_view == 'transaction' && ($this->_action & CRM_Core_Action::BROWSE)) {
index 359685a8cf12a0605ff8d970403e709fe21332d6..e011e4e884eb28fa895bfa2f28957a4857c9211b 100644 (file)
@@ -263,8 +263,7 @@ class CRM_Core_BAO_ConfigSetting {
       'Boolean',
       CRM_Core_DAO::$_nullArray,
       FALSE,
-      FALSE,
-      'REQUEST'
+      FALSE
     );
     if ($config->userSystem->is_drupal &&
       $resetSessionTable
index 4fe04b8f1d0315522d164f9ea8512b8a49dcdd45..382fbb5c31678dd07d96bdc5aa5b4d63f80b897c 100644 (file)
@@ -70,6 +70,8 @@ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log {
    * @param string $tableName
    * @param int $tableID
    * @param int $userID
+   *
+   * @throws \CRM_Core_Exception
    */
   public static function register(
     $contactID,
index 5eb5167b312547b67ee642697452616bf82392e9..782f72ca44f03096bb47e9381f02e232a94bd9c5 100644 (file)
@@ -776,10 +776,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
    * @throws \CRM_Core_Exception
    */
   protected function assignPaymentProcessor($isPayLaterEnabled) {
-    $this->_paymentProcessors = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors(
-      [ucfirst($this->_mode) . 'Mode'],
-      $this->_paymentProcessorIDs
-    );
+    $this->_paymentProcessors = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors([ucfirst($this->_mode) . 'Mode'], $this->_paymentProcessorIDs);
     if ($isPayLaterEnabled) {
       $this->_paymentProcessors[0] = CRM_Financial_BAO_PaymentProcessor::getPayment(0);
     }
index 5f0eeb5063c4b3a24e51d9f5b834fb6abae41143..60a11fdd6789f63ee1d72097c68f7dabfd73bbfe 100644 (file)
@@ -28,6 +28,8 @@ class CRM_Core_Page_AJAX_Location {
    * obtain the location of given contact-id.
    * This method is used by on-behalf-of form to dynamically generate poulate the
    * location field values for selected permissioned contact.
+   *
+   * @throws \CRM_Core_Exception
    */
   public static function getPermissionedLocation() {
     $cid = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject, TRUE);
index 1af72a2301f03e52b8dbd79952d03d886dea4fe9..18d89d958920eb4b93b6f78707671c6228ae2520 100644 (file)
@@ -354,7 +354,7 @@ abstract class CRM_Core_Payment {
    * @return bool
    */
   protected function supportsLiveMode() {
-    return TRUE;
+    return empty($this->_paymentProcessor['is_test']) ? TRUE : FALSE;
   }
 
   /**
@@ -363,7 +363,7 @@ abstract class CRM_Core_Payment {
    * @return bool
    */
   protected function supportsTestMode() {
-    return TRUE;
+    return empty($this->_paymentProcessor['is_test']) ? FALSE : TRUE;
   }
 
   /**
index d7c39838ee89103cc69cb64e701f3d0378b2c339..e0a079a8f1b8b48218c9811bdc6e9354531e7d66 100644 (file)
@@ -132,17 +132,6 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment {
     return $params;
   }
 
-  /**
-   * Are back office payments supported.
-   *
-   * E.g paypal standard won't permit you to enter a credit card associated with someone else's login.
-   *
-   * @return bool
-   */
-  protected function supportsLiveMode() {
-    return TRUE;
-  }
-
   /**
    * Does this payment processor support refund?
    *
index be4a171c966765259bbf8eea14ef528f87cec236..fe267437f904fde2ac1f097565db67d8e00e3f6e 100644 (file)
@@ -160,6 +160,24 @@ class CRM_Core_Payment_Manual extends CRM_Core_Payment {
     return CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'payment_instrument_id', $this->getPaymentInstrumentID());
   }
 
+  /**
+   * Are live payments supported - e.g dummy doesn't support this.
+   *
+   * @return bool
+   */
+  protected function supportsLiveMode() {
+    return TRUE;
+  }
+
+  /**
+   * Are test payments supported.
+   *
+   * @return bool
+   */
+  protected function supportsTestMode() {
+    return TRUE;
+  }
+
   /**
    * Declare that more than one payment can be processed at once.
    *
index 65dae3da36241ca4ec63b36b561654afa8705904..b2508ec8653427b978c45ec31b27c1ec2f887b8f 100644 (file)
@@ -379,8 +379,8 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces
    *   available processors
    */
   public static function getPaymentProcessors($capabilities = [], $ids = FALSE) {
-    $testProcessors = in_array('TestMode', $capabilities) ? self::getAllPaymentProcessors('test') : [];
     if (is_array($ids)) {
+      $testProcessors = in_array('TestMode', $capabilities) ? self::getAllPaymentProcessors('test') : [];
       $processors = self::getAllPaymentProcessors('all', FALSE, FALSE);
       if (in_array('TestMode', $capabilities)) {
         $possibleLiveIDs = array_diff($ids, array_keys($testProcessors));
index df938a6a179f8b70aa8bf557ae1e6a811f24afdd..c24943e2db41c69f9c747adcd3cd0a1197dcaf8a 100644 (file)
@@ -56,7 +56,7 @@ class CRM_Mailing_MailStore_Imap extends CRM_Mailing_MailStore {
       'uidReferencing' => TRUE,
     ];
     $this->_transport = new ezcMailImapTransport($host, NULL, $options);
-    if (useXOAUTH2) {
+    if ($useXOAUTH2) {
       $this->_transport->authenticate($username, $password, ezcMailImapTransport::AUTH_XOAUTH2);
     }
     else {
index 8703ce8b8e62d58d840d03a608574ee04281442e..f2756c3e65a34e17eac7cb21a96a0c10868148f4 100644 (file)
@@ -248,6 +248,9 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
           'description' => [
             'title' => ts('Description'),
           ],
+          'is_active' => [
+            'title' => ts('Is active?'),
+          ],
           'relationship_id' => [
             'title' => ts('Rel ID'),
             'name' => 'id',
@@ -311,6 +314,10 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
             'title' => ts('Start Date'),
             'name' => 'start_date',
           ],
+          'end_date' => [
+            'title' => ts('End Date'),
+            'name' => 'end_date',
+          ],
         ],
         'grouping' => 'relation-fields',
       ],
@@ -765,6 +772,8 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
         $entryFound = TRUE;
       }
 
+      $rows[$rowNum]['civicrm_relationship_is_active'] = $row['civicrm_relationship_is_active'] ? ts('Yes') : '';
+
       // skip looking further in rows, if first row itself doesn't
       // have the column we need
       if (!$entryFound) {
index ab65d97d302abc0a2c9bd766e108c737c6c56197..c1ae2db6286ac2eded48ca564041df9350096b90 100644 (file)
  */
 class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
 
-  protected $_charts = array(
+  protected $_charts = [
     '' => 'Tabular',
     'barChart' => 'Bar Chart',
     'pieChart' => 'Pie Chart',
-  );
-  protected $_customGroupExtends = array('Contribution', 'Contact', 'Individual');
+  ];
+  protected $_customGroupExtends = ['Contribution', 'Contact', 'Individual'];
   protected $_customGroupGroupBy = TRUE;
 
-  public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report');
+  public $_drilldownReport = ['contribute/detail' => 'Link to Detail Report'];
 
   /**
    * To what frequency group-by a date column
    *
    * @var array
    */
-  protected $_groupByDateFreq = array(
+  protected $_groupByDateFreq = [
     'MONTH' => 'Month',
     'YEARWEEK' => 'Week',
     'DATE' => 'Day',
     'QUARTER' => 'Quarter',
     'YEAR' => 'Year',
     'FISCALYEAR' => 'Fiscal Year',
-  );
+  ];
 
   /**
    * This report has been optimised for group filtering.
@@ -60,256 +60,256 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
    * Class constructor.
    */
   public function __construct() {
-    $this->_columns = array(
-      'civicrm_contact' => array(
+    $this->_columns = [
+      'civicrm_contact' => [
         'dao' => 'CRM_Contact_DAO_Contact',
         'fields' => array_merge(
           $this->getBasicContactFields(),
-          array(
-            'sort_name' => array(
+          [
+            'sort_name' => [
               'title' => ts('Contact Name'),
               'no_repeat' => TRUE,
-            ),
-          )
+            ],
+          ]
         ),
-        'filters' => $this->getBasicContactFilters(array('deceased' => NULL)),
+        'filters' => $this->getBasicContactFilters(['deceased' => NULL]),
         'grouping' => 'contact-fields',
-        'group_bys' => array(
-          'id' => array('title' => ts('Contact ID')),
-          'sort_name' => array(
+        'group_bys' => [
+          'id' => ['title' => ts('Contact ID')],
+          'sort_name' => [
             'title' => ts('Contact Name'),
-          ),
-        ),
-      ),
-      'civicrm_email' => array(
+          ],
+        ],
+      ],
+      'civicrm_email' => [
         'dao' => 'CRM_Core_DAO_Email',
-        'fields' => array(
-          'email' => array(
+        'fields' => [
+          'email' => [
             'title' => ts('Email'),
             'no_repeat' => TRUE,
-          ),
-        ),
+          ],
+        ],
         'grouping' => 'contact-fields',
-      ),
-      'civicrm_line_item' => array(
+      ],
+      'civicrm_line_item' => [
         'dao' => 'CRM_Price_DAO_LineItem',
-      ),
-      'civicrm_phone' => array(
+      ],
+      'civicrm_phone' => [
         'dao' => 'CRM_Core_DAO_Phone',
-        'fields' => array(
-          'phone' => array(
+        'fields' => [
+          'phone' => [
             'title' => ts('Phone'),
             'no_repeat' => TRUE,
-          ),
-        ),
+          ],
+        ],
         'grouping' => 'contact-fields',
-      ),
-      'civicrm_financial_type' => array(
+      ],
+      'civicrm_financial_type' => [
         'dao' => 'CRM_Financial_DAO_FinancialType',
-        'fields' => array('financial_type' => NULL),
+        'fields' => ['financial_type' => NULL],
         'grouping' => 'contri-fields',
-        'group_bys' => array(
-          'financial_type' => array('title' => ts('Financial Type')),
-        ),
-      ),
-      'civicrm_contribution' => array(
+        'group_bys' => [
+          'financial_type' => ['title' => ts('Financial Type')],
+        ],
+      ],
+      'civicrm_contribution' => [
         'dao' => 'CRM_Contribute_DAO_Contribution',
           //'bao'           => 'CRM_Contribute_BAO_Contribution',
-        'fields' => array(
-          'contribution_status_id' => array(
+        'fields' => [
+          'contribution_status_id' => [
             'title' => ts('Contribution Status'),
-          ),
-          'contribution_source' => array('title' => ts('Source')),
-          'currency' => array(
+          ],
+          'contribution_source' => ['title' => ts('Source')],
+          'currency' => [
             'required' => TRUE,
             'no_display' => TRUE,
-          ),
-          'contribution_page_id' => array(
+          ],
+          'contribution_page_id' => [
             'title' => ts('Contribution Page'),
-          ),
-          'total_amount' => array(
+          ],
+          'total_amount' => [
             'title' => ts('Contribution Amount Stats'),
             'default' => TRUE,
-            'statistics' => array(
+            'statistics' => [
               'count' => ts('Contributions'),
               'sum' => ts('Contribution Aggregate'),
               'avg' => ts('Contribution Avg'),
-            ),
-          ),
-          'non_deductible_amount' => array(
+            ],
+          ],
+          'non_deductible_amount' => [
             'title' => ts('Non-deductible Amount'),
-          ),
-        ),
+          ],
+        ],
         'grouping' => 'contri-fields',
-        'filters' => array(
-          'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
-          'thankyou_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
-          'contribution_status_id' => array(
+        'filters' => [
+          'receive_date' => ['operatorType' => CRM_Report_Form::OP_DATE],
+          'thankyou_date' => ['operatorType' => CRM_Report_Form::OP_DATE],
+          'contribution_status_id' => [
             'title' => ts('Contribution Status'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id', 'search'),
-            'default' => array(1),
+            'default' => [1],
             'type' => CRM_Utils_Type::T_INT,
-          ),
-          'contribution_page_id' => array(
+          ],
+          'contribution_page_id' => [
             'title' => ts('Contribution Page'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Contribute_PseudoConstant::contributionPage(),
             'type' => CRM_Utils_Type::T_INT,
-          ),
-          'currency' => array(
+          ],
+          'currency' => [
             'title' => ts('Currency'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
             'default' => NULL,
             'type' => CRM_Utils_Type::T_STRING,
-          ),
-          'financial_type_id' => array(
+          ],
+          'financial_type_id' => [
             'title' => ts('Financial Type'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes(),
             'type' => CRM_Utils_Type::T_INT,
-          ),
-          'contribution_page_id' => array(
+          ],
+          'contribution_page_id' => [
             'title' => ts('Contribution Page'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Contribute_PseudoConstant::contributionPage(),
             'type' => CRM_Utils_Type::T_INT,
-          ),
-          'total_amount' => array(
+          ],
+          'total_amount' => [
             'title' => ts('Contribution Amount'),
-          ),
-          'non_deductible_amount' => array(
+          ],
+          'non_deductible_amount' => [
             'title' => ts('Non-deductible Amount'),
-          ),
-          'total_sum' => array(
+          ],
+          'total_sum' => [
             'title' => ts('Contribution Aggregate'),
             'type' => CRM_Report_Form::OP_INT,
             'dbAlias' => 'civicrm_contribution_total_amount_sum',
             'having' => TRUE,
-          ),
-          'total_count' => array(
+          ],
+          'total_count' => [
             'title' => ts('Contribution Count'),
             'type' => CRM_Report_Form::OP_INT,
             'dbAlias' => 'civicrm_contribution_total_amount_count',
             'having' => TRUE,
-          ),
-          'total_avg' => array(
+          ],
+          'total_avg' => [
             'title' => ts('Contribution Avg'),
             'type' => CRM_Report_Form::OP_INT,
             'dbAlias' => 'civicrm_contribution_total_amount_avg',
             'having' => TRUE,
-          ),
-        ),
-        'group_bys' => array(
-          'receive_date' => array(
+          ],
+        ],
+        'group_bys' => [
+          'receive_date' => [
             'frequency' => TRUE,
             'default' => TRUE,
             'chart' => TRUE,
-          ),
+          ],
           'contribution_source' => NULL,
-          'contribution_status_id' => array(
+          'contribution_status_id' => [
             'title' => ts('Contribution Status'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id', 'search'),
-            'default' => array(1),
+            'default' => [1],
             'type' => CRM_Utils_Type::T_INT,
-          ),
-          'contribution_page_id' => array(
+          ],
+          'contribution_page_id' => [
             'title' => ts('Contribution Page'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Contribute_PseudoConstant::contributionPage(),
             'type' => CRM_Utils_Type::T_INT,
-          ),
-        ),
-      ),
-      'civicrm_financial_trxn' => array(
+          ],
+        ],
+      ],
+      'civicrm_financial_trxn' => [
         'dao' => 'CRM_Financial_DAO_FinancialTrxn',
-        'fields' => array(
-          'card_type_id' => array(
+        'fields' => [
+          'card_type_id' => [
             'title' => ts('Credit Card Type'),
             'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
-          ),
-        ),
-        'filters' => array(
-          'card_type_id' => array(
+          ],
+        ],
+        'filters' => [
+          'card_type_id' => [
             'title' => ts('Credit Card Type'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
             'default' => NULL,
             'type' => CRM_Utils_Type::T_STRING,
-          ),
-        ),
-      ),
-      'civicrm_batch' => array(
+          ],
+        ],
+      ],
+      'civicrm_batch' => [
         'dao' => 'CRM_Batch_DAO_EntityBatch',
         'grouping' => 'contri-fields',
-        'fields' => array(
-          'batch_id' => array(
+        'fields' => [
+          'batch_id' => [
             'name' => 'batch_id',
             'title' => ts('Batch Title'),
             'dbAlias' => 'GROUP_CONCAT(DISTINCT batch_civireport.batch_id
                                     ORDER BY batch_civireport.batch_id SEPARATOR ",")',
-          ),
-        ),
-        'filters' => array(
-          'batch_id' => array(
+          ],
+        ],
+        'filters' => [
+          'batch_id' => [
             'title' => ts('Batch Title'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Batch_BAO_Batch::getBatches(),
             'type' => CRM_Utils_Type::T_INT,
-          ),
-        ),
-        'group_bys' => array(
-          'batch_id' => array('title' => ts('Batch Title')),
-        ),
-      ),
-      'civicrm_contribution_soft' => array(
+          ],
+        ],
+        'group_bys' => [
+          'batch_id' => ['title' => ts('Batch Title')],
+        ],
+      ],
+      'civicrm_contribution_soft' => [
         'dao' => 'CRM_Contribute_DAO_ContributionSoft',
-        'fields' => array(
-          'soft_amount' => array(
+        'fields' => [
+          'soft_amount' => [
             'title' => ts('Soft Credit Amount Stats'),
             'name' => 'amount',
-            'statistics' => array(
+            'statistics' => [
               'count' => ts('Soft Credits'),
               'sum' => ts('Soft Credit Aggregate'),
               'avg' => ts('Soft Credit Avg'),
-            ),
-          ),
-        ),
+            ],
+          ],
+        ],
         'grouping' => 'contri-fields',
-        'filters' => array(
-          'amount' => array(
+        'filters' => [
+          'amount' => [
             'title' => ts('Soft Credit Amount'),
-          ),
-          'soft_credit_type_id' => array(
+          ],
+          'soft_credit_type_id' => [
             'title' => ts('Soft Credit Type'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Core_OptionGroup::values('soft_credit_type'),
             'default' => NULL,
             'type' => CRM_Utils_Type::T_STRING,
-          ),
-          'soft_sum' => array(
+          ],
+          'soft_sum' => [
             'title' => ts('Soft Credit Aggregate'),
             'type' => CRM_Report_Form::OP_INT,
             'dbAlias' => 'civicrm_contribution_soft_soft_amount_sum',
             'having' => TRUE,
-          ),
-          'soft_count' => array(
+          ],
+          'soft_count' => [
             'title' => ts('Soft Credits Count'),
             'type' => CRM_Report_Form::OP_INT,
             'dbAlias' => 'civicrm_contribution_soft_soft_amount_count',
             'having' => TRUE,
-          ),
-          'soft_avg' => array(
+          ],
+          'soft_avg' => [
             'title' => ts('Soft Credit Avg'),
             'type' => CRM_Report_Form::OP_INT,
             'dbAlias' => 'civicrm_contribution_soft_soft_amount_avg',
             'having' => TRUE,
-          ),
-        ),
-      ),
-    ) + $this->addAddressFields();
+          ],
+        ],
+      ],
+    ] + $this->addAddressFields();
 
     $this->addCampaignFields('civicrm_contribution', TRUE);
 
@@ -323,8 +323,8 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
    * Set select clause.
    */
   public function select() {
-    $select = array();
-    $this->_columnHeaders = array();
+    $select = [];
+    $this->_columnHeaders = [];
     foreach ($this->_columns as $tableName => $table) {
       if (array_key_exists('group_bys', $table)) {
         foreach ($table['group_bys'] as $fieldName => $field) {
@@ -383,8 +383,8 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
               // just to make sure these values are transferred to rows.
               // since we need that for calculation purpose,
               // e.g making subtotals look nicer or graphs
-              $this->_columnHeaders["{$tableName}_{$fieldName}_interval"] = array('no_display' => TRUE);
-              $this->_columnHeaders["{$tableName}_{$fieldName}_subtotal"] = array('no_display' => TRUE);
+              $this->_columnHeaders["{$tableName}_{$fieldName}_interval"] = ['no_display' => TRUE];
+              $this->_columnHeaders["{$tableName}_{$fieldName}_subtotal"] = ['no_display' => TRUE];
             }
           }
         }
@@ -443,15 +443,15 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
   public static function formRule($fields, $files, $self) {
     // Check for searching combination of display columns and
     // grouping criteria
-    $ignoreFields = array('total_amount', 'sort_name');
+    $ignoreFields = ['total_amount', 'sort_name'];
     $errors = $self->customDataFormRule($fields, $ignoreFields);
 
     if (empty($fields['fields']['total_amount'])) {
-      foreach (array(
+      foreach ([
         'total_count_value',
         'total_sum_value',
         'total_avg_value',
-      ) as $val) {
+      ] as $val) {
         if (!empty($fields[$val])) {
           $errors[$val] = ts("Please select the Amount Statistics");
         }
@@ -518,7 +518,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
    */
   public function groupBy() {
     $this->_groupBy = "";
-    $groupByColumns = array();
+    $groupByColumns = [];
     $append = FALSE;
     if (!empty($this->_params['group_bys']) &&
       is_array($this->_params['group_bys'])
@@ -537,7 +537,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
 
                 $append = "YEAR({$field['dbAlias']});;";
                 if (in_array(strtolower($this->_params['group_bys_freq'][$fieldName]),
-                  array('year')
+                  ['year']
                 )) {
                   $append = '';
                 }
@@ -563,7 +563,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
       ) {
         $this->_rollup = " WITH ROLLUP";
       }
-      $groupBy = array();
+      $groupBy = [];
       foreach ($groupByColumns as $key => $val) {
         if (strpos($val, ';;') !== FALSE) {
           $groupBy = array_merge($groupBy, explode(';;', $val));
@@ -608,7 +608,12 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
 
     $softCredit = CRM_Utils_Array::value('soft_amount', $this->_params['fields']);
     $onlySoftCredit = $softCredit && !CRM_Utils_Array::value('total_amount', $this->_params['fields']);
-    $group = "\nGROUP BY {$this->_aliases['civicrm_contribution']}.currency";
+    if (empty($this->_groupBy)) {
+      $group = "\nGROUP BY {$this->_aliases['civicrm_contribution']}.currency";
+    }
+    else {
+      $group = "\n {$this->_groupBy}, {$this->_aliases['civicrm_contribution']}.currency";
+    }
 
     $this->from('contribution');
     if ($softCredit) {
@@ -639,14 +644,38 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_
     $contriSQL = "SELECT {$contriQuery} {$group} {$this->_having}";
     $contriDAO = CRM_Core_DAO::executeQuery($contriSQL);
     $this->addToDeveloperTab($contriSQL);
-    $totalAmount = $average = $mode = $median = $softTotalAmount = $softAverage = array();
-    $count = $softCount = 0;
+    $currencies = $currAmount = $currAverage = $currCount = [];
+    $totalAmount = $average = $mode = $median = [];
+    $softTotalAmount = $softAverage = $averageCount = $averageSoftCount = [];
+    $softCount = $count = 0;
     while ($contriDAO->fetch()) {
-      $totalAmount[]
-        = CRM_Utils_Money::format($contriDAO->civicrm_contribution_total_amount_sum, $contriDAO->currency) .
-        " (" . $contriDAO->civicrm_contribution_total_amount_count . ")";
-      $average[] = CRM_Utils_Money::format($contriDAO->civicrm_contribution_total_amount_avg, $contriDAO->currency);
+      if (!isset($currAmount[$contriDAO->currency])) {
+        $currAmount[$contriDAO->currency] = 0;
+      }
+      if (!isset($currCount[$contriDAO->currency])) {
+        $currCount[$contriDAO->currency] = 0;
+      }
+      if (!isset($currAverage[$contriDAO->currency])) {
+        $currAverage[$contriDAO->currency] = 0;
+      }
+      if (!isset($averageCount[$contriDAO->currency])) {
+        $averageCount[$contriDAO->currency] = 0;
+      }
+      $currAmount[$contriDAO->currency] += $contriDAO->civicrm_contribution_total_amount_sum;
+      $currCount[$contriDAO->currency] += $contriDAO->civicrm_contribution_total_amount_count;
+      $currAverage[$contriDAO->currency] += $contriDAO->civicrm_contribution_total_amount_avg;
+      $averageCount[$contriDAO->currency]++;
       $count += $contriDAO->civicrm_contribution_total_amount_count;
+
+      if (!in_array($contriDAO->currency, $currencies)) {
+        $currencies[] = $contriDAO->currency;
+      }
+    }
+
+    foreach ($currencies as $currency) {
+      $totalAmount[] = CRM_Utils_Money::format($currAmount[$currency], $currency) .
+        " (" . $currCount[$currency] . ")";
+      $average[] = CRM_Utils_Money::format(($currAverage[$currency] / $averageCount[$currency]), $currency);
     }
 
     $groupBy = "\n{$group}, {$this->_aliases['civicrm_contribution']}.total_amount";
@@ -660,59 +689,82 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_
     $mode = $this->calculateMode($modeSQL);
     $median = $this->calculateMedian();
 
+    $currencies = $currSoftAmount = $currSoftAverage = $currSoftCount = [];
     if ($softCredit) {
       $softDAO = CRM_Core_DAO::executeQuery($softSQL);
       $this->addToDeveloperTab($softSQL);
       while ($softDAO->fetch()) {
-        $softTotalAmount[]
-          = CRM_Utils_Money::format($softDAO->civicrm_contribution_soft_soft_amount_sum, $softDAO->currency) .
-          " (" . $softDAO->civicrm_contribution_soft_soft_amount_count . ")";
-        $softAverage[] = CRM_Utils_Money::format($softDAO->civicrm_contribution_soft_soft_amount_avg, $softDAO->currency);
+        if (!isset($currSoftAmount[$softDAO->currency])) {
+          $currSoftAmount[$softDAO->currency] = 0;
+        }
+        if (!isset($currSoftCount[$softDAO->currency])) {
+          $currSoftCount[$softDAO->currency] = 0;
+        }
+        if (!isset($currSoftAverage[$softDAO->currency])) {
+          $currSoftAverage[$softDAO->currency] = 0;
+        }
+        if (!isset($averageSoftCount[$softDAO->currency])) {
+          $averageSoftCount[$softDAO->currency] = 0;
+        }
+        $currSoftAmount[$softDAO->currency] += $softDAO->civicrm_contribution_soft_soft_amount_sum;
+        $currSoftCount[$softDAO->currency] += $softDAO->civicrm_contribution_soft_soft_amount_count;
+        $currSoftAverage[$softDAO->currency] += $softDAO->civicrm_contribution_soft_soft_amount_avg;
+        $averageSoftCount[$softDAO->currency]++;
         $softCount += $softDAO->civicrm_contribution_soft_soft_amount_count;
+
+        if (!in_array($softDAO->currency, $currencies)) {
+          $currencies[] = $softDAO->currency;
+        }
+      }
+
+      foreach ($currencies as $currency) {
+        $softTotalAmount[] = CRM_Utils_Money::format($currSoftAmount[$currency], $currency) .
+          " (" . $currSoftCount[$currency] . ")";
+        $softAverage[] = CRM_Utils_Money::format(($currSoftAverage[$currency] / $averageSoftCount[$currency]), $currency);
       }
     }
 
     if (!$onlySoftCredit) {
-      $statistics['counts']['amount'] = array(
+      $statistics['counts']['amount'] = [
         'title' => ts('Total Amount'),
         'value' => implode(',  ', $totalAmount),
         'type' => CRM_Utils_Type::T_STRING,
-      );
-      $statistics['counts']['count'] = array(
+      ];
+      $statistics['counts']['count'] = [
         'title' => ts('Total Contributions'),
         'value' => $count,
-      );
-      $statistics['counts']['avg'] = array(
+      ];
+      $statistics['counts']['avg'] = [
         'title' => ts('Average'),
         'value' => implode(',  ', $average),
         'type' => CRM_Utils_Type::T_STRING,
-      );
-      $statistics['counts']['mode'] = array(
+      ];
+      $statistics['counts']['mode'] = [
         'title' => ts('Mode'),
         'value' => implode(',  ', $mode),
         'type' => CRM_Utils_Type::T_STRING,
-      );
-      $statistics['counts']['median'] = array(
+      ];
+      $statistics['counts']['median'] = [
         'title' => ts('Median'),
         'value' => implode(',  ', $median),
         'type' => CRM_Utils_Type::T_STRING,
-      );
+      ];
     }
     if ($softCredit) {
-      $statistics['counts']['soft_amount'] = array(
+      $statistics['counts']['soft_amount'] = [
         'title' => ts('Total Soft Credit Amount'),
         'value' => implode(',  ', $softTotalAmount),
         'type' => CRM_Utils_Type::T_STRING,
-      );
-      $statistics['counts']['soft_count'] = array(
+      ];
+      $statistics['counts']['soft_count'] = [
         'title' => ts('Total Soft Credits'),
         'value' => $softCount,
-      );
-      $statistics['counts']['soft_avg'] = array(
+      ];
+      $statistics['counts']['soft_avg'] = [
         'title' => ts('Average Soft Credit'),
         'value' => implode(',  ', $softAverage),
         'type' => CRM_Utils_Type::T_STRING,
-      );
+      ];
     }
     return $statistics;
   }
@@ -731,7 +783,7 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_
    * @param array $rows
    */
   public function buildChart(&$rows) {
-    $graphRows = array();
+    $graphRows = [];
 
     if (!empty($this->_params['charts'])) {
       if (!empty($this->_params['group_bys']['receive_date'])) {
@@ -771,7 +823,7 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_
         // build the chart.
         $config = CRM_Core_Config::Singleton();
         $graphRows['xname'] = $this->_interval;
-        $graphRows['yname'] = ts('Amount (%1)', array(1 => $config->defaultCurrency));
+        $graphRows['yname'] = ts('Amount (%1)', [1 => $config->defaultCurrency]);
         CRM_Utils_Chart::chart($graphRows, $this->_params['charts'], $this->_interval);
         $this->assign('chartType', $this->_params['charts']);
       }
@@ -802,11 +854,11 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_
       $contriDAO = CRM_Core_DAO::executeQuery($contriSQL);
       CRM_Core_DAO::reenableFullGroupByMode();
       $this->addToDeveloperTab($contriSQL);
-      $contriFields = array(
+      $contriFields = [
         'civicrm_contribution_total_amount_sum',
         'civicrm_contribution_total_amount_avg',
         'civicrm_contribution_total_amount_count',
-      );
+      ];
       $count = 0;
       while ($contriDAO->fetch()) {
         foreach ($contriFields as $column) {
@@ -825,7 +877,7 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_
 
         $dateStart = CRM_Utils_Date::customFormat($row['civicrm_contribution_receive_date_start'], '%Y%m%d');
         $endDate = new DateTime($dateStart);
-        $dateEnd = array();
+        $dateEnd = [];
 
         list($dateEnd['Y'], $dateEnd['M'], $dateEnd['d']) = explode(':', $endDate->format('Y:m:d'));
 
index 116cc577ae38fb06027c9c81aa9399336b6b7ce4..92627d38e9ed6e43861e3cc3266f494cc0fc3893 100644 (file)
@@ -22,16 +22,16 @@ class CRM_SMS_Controller_Send extends CRM_Core_Controller {
    * @param string $title
    * @param bool|int $action
    * @param bool $modal
+   *
+   * @throws \CRM_Core_Exception
    */
   public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) {
     parent::__construct($title, $modal, NULL, FALSE, TRUE);
 
-    $mailingID = CRM_Utils_Request::retrieve('mid', 'String', $this, FALSE, NULL);
+    $mailingID = CRM_Utils_Request::retrieve('mid', 'String', $this);
 
     // also get the text and html file
-    $txtFile = CRM_Utils_Request::retrieve('txtFile', 'String',
-      CRM_Core_DAO::$_nullObject, FALSE, NULL
-    );
+    $txtFile = CRM_Utils_Request::retrieveValue('txtFile', 'String');
 
     $config = CRM_Core_Config::singleton();
     if ($txtFile &&
index 1491da33e26306c0f9bac78cafb77a22994d69a5..31663cacf55f2bb2f15f734a6ec7415e9276d584 100644 (file)
@@ -160,7 +160,7 @@ abstract class CRM_Utils_Hook {
     // Instead of not calling any hooks we only call those we know to be frequently important - if a particular extension wanted
     // to avoid this they could do an early return on CRM_Core_Config::singleton()->isUpgradeMode
     // Futther discussion is happening at https://lab.civicrm.org/dev/core/issues/1460
-    $upgradeFriendlyHooks = ['civicrm_alterSettingsFolders', 'civicrm_alterSettingsMetaData', 'civicrm_triggerInfo', 'civicrm_alterLogTables', 'civicrm_container', 'civicrm_permission'];
+    $upgradeFriendlyHooks = ['civicrm_alterSettingsFolders', 'civicrm_alterSettingsMetaData', 'civicrm_triggerInfo', 'civicrm_alterLogTables', 'civicrm_container', 'civicrm_permission', 'civicrm_managed'];
     if (CRM_Core_Config::singleton()->isUpgradeMode() && !in_array($fnSuffix, $upgradeFriendlyHooks)) {
       return;
     }
index 7eb83cade19ad792b41ae8ab4c1ccca1e23a012f..b6f907585ec6ceb2d261ce93bd85ca4e38feeee1 100644 (file)
@@ -163,7 +163,7 @@ class Test {
    */
   public static function codeGen() {
     if (!isset(self::$singletons['codeGen'])) {
-      $civiRoot = dirname(__DIR__);
+      $civiRoot = '.';
       $codeGen = new \CRM_Core_CodeGen_Main("$civiRoot/CRM/Core/DAO", "$civiRoot/sql", $civiRoot, "$civiRoot/templates", NULL, "UnitTests", NULL, "$civiRoot/xml/schema/Schema.xml", NULL);
       $codeGen->init();
       self::$singletons['codeGen'] = $codeGen;
index 6c14e526a2ca69e015bf30d493febf4fec30ebc7..df799befb56d1570e4fe47829a4e7da0b6896266 100644 (file)
@@ -40,6 +40,7 @@
   },
   "require": {
     "php": "~7.0",
+    "cache/integration-tests": "~0.16.0",
     "dompdf/dompdf" : "0.8.*",
     "electrolinux/phpquery": "^0.9.6",
     "symfony/config": "^2.8.50 || ~3.0",
@@ -73,9 +74,6 @@
     "tplaner/when": "~3.0.0",
     "xkerman/restricted-unserialize": "~1.1"
   },
-  "require-dev": {
-    "cache/integration-tests": "dev-master"
-  },
   "scripts": {
     "post-install-cmd": [
       "bash tools/scripts/composer/dompdf-cleanup.sh",
       }
     },
     "patches": {
+      "cache/integration-tests": {
+        "Allow adding tests": "https://github.com/php-cache/integration-tests/commit/05f97174c09364dc10c084a38ba0cfd5124f4cec.patch",
+        "Support PHPUnit 6+": "https://github.com/php-cache/integration-tests/commit/1ec7362962185df91d3d749bc3fa7e7b99cb9fc7.patch",
+        "Add tests for binary data round trip": "https://github.com/php-cache/integration-tests/commit/89cd7068e83aa776774bfc44f6bcba858c085616.patch"
+      },
       "phpoffice/common": {
-        "Fix handling of libxml_disable_entity_loader": "tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch"
+        "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch"
       },
       "phpoffice/phpword": {
-        "Fix handling of libxml_disable_entity_loader": "tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch"
+        "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch"
       },
       "zetacomponents/mail": {
-        "CiviCRM Custom Patches for ZetaCompoents mail": "tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch"
+        "CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch"
       }
     }
   }
index 240823ffed51ab36f9aacdf26ffc0d86a639d115..c2c102f70bdda8acde4803dba3b2342763668fef 100644 (file)
@@ -4,8 +4,122 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "6b2ec4d9dc608f8b2e0def4af6d7bafb",
+    "content-hash": "f545c6e46af52039ade0c29ca8fe41e5",
     "packages": [
+        {
+            "name": "cache/integration-tests",
+            "version": "0.16.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-cache/integration-tests.git",
+                "reference": "a8d9538a44ed5a70d551f9b87f534c98dfe6b0ee"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-cache/integration-tests/zipball/a8d9538a44ed5a70d551f9b87f534c98dfe6b0ee",
+                "reference": "a8d9538a44ed5a70d551f9b87f534c98dfe6b0ee",
+                "shasum": ""
+            },
+            "require": {
+                "cache/tag-interop": "^1.0",
+                "php": "^5.4|^7",
+                "psr/cache": "~1.0"
+            },
+            "require-dev": {
+                "cache/cache": "dev-master",
+                "illuminate/cache": "^5.0",
+                "madewithlove/illuminate-psr-cache-bridge": "^1.0",
+                "phpunit/phpunit": "^4.0|^5.0",
+                "symfony/cache": "^3.1",
+                "tedivm/stash": "dev-master"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Cache\\IntegrationTests\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Aaron Scherer",
+                    "email": "aequasi@gmail.com",
+                    "homepage": "https://github.com/aequasi"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                }
+            ],
+            "description": "Integration tests for PSR-6 and PSR-16 cache implementations",
+            "homepage": "https://github.com/php-cache/integration-tests",
+            "keywords": [
+                "cache",
+                "psr16",
+                "psr6",
+                "test"
+            ],
+            "time": "2017-02-02T14:29:50+00:00"
+        },
+        {
+            "name": "cache/tag-interop",
+            "version": "1.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-cache/tag-interop.git",
+                "reference": "c7496dd81530f538af27b4f2713cde97bc292832"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-cache/tag-interop/zipball/c7496dd81530f538af27b4f2713cde97bc292832",
+                "reference": "c7496dd81530f538af27b4f2713cde97bc292832",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.5 || ^7.0",
+                "psr/cache": "^1.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.0-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Cache\\TagInterop\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                },
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com",
+                    "homepage": "https://github.com/nicolas-grekas"
+                }
+            ],
+            "description": "Framework interoperable interfaces for tags",
+            "homepage": "http://www.php-cache.com/en/latest/",
+            "keywords": [
+                "cache",
+                "psr",
+                "psr6",
+                "tag"
+            ],
+            "time": "2017-03-13T09:14:27+00:00"
+        },
         {
             "name": "civicrm/civicrm-cxn-rpc",
             "version": "v0.19.01.08",
             "type": "library",
             "extra": {
                 "patches_applied": {
-                    "Fix handling of libxml_disable_entity_loader": "tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch"
+                    "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch"
                 }
             },
             "autoload": {
                     "dev-develop": "0.16-dev"
                 },
                 "patches_applied": {
-                    "Fix handling of libxml_disable_entity_loader": "tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch"
+                    "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch"
                 }
             },
             "autoload": {
             ],
             "time": "2017-06-05T06:30:30+00:00"
         },
+        {
+            "name": "psr/cache",
+            "version": "1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/cache.git",
+                "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
+                "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Cache\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for caching libraries",
+            "keywords": [
+                "cache",
+                "psr",
+                "psr-6"
+            ],
+            "time": "2016-08-06T20:24:11+00:00"
+        },
         {
             "name": "psr/http-message",
             "version": "1.0.1",
             "type": "library",
             "extra": {
                 "patches_applied": {
-                    "CiviCRM Custom Patches for ZetaCompoents mail": "tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch"
+                    "CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch"
                 }
             },
             "autoload": {
             "time": "2020-01-17T11:18:01+00:00"
         }
     ],
-    "packages-dev": [
-        {
-            "name": "cache/integration-tests",
-            "version": "dev-master",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/php-cache/integration-tests.git",
-                "reference": "b97328797ab199f0ac933e39842a86ab732f21f9"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/php-cache/integration-tests/zipball/b97328797ab199f0ac933e39842a86ab732f21f9",
-                "reference": "b97328797ab199f0ac933e39842a86ab732f21f9",
-                "shasum": ""
-            },
-            "require": {
-                "cache/tag-interop": "^1.0",
-                "php": "^5.4|^7",
-                "psr/cache": "~1.0"
-            },
-            "conflict": {
-                "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
-            },
-            "require-dev": {
-                "cache/cache": "^1.0",
-                "illuminate/cache": "^5.4|^5.5|^5.6",
-                "mockery/mockery": "^1.0",
-                "phpunit/phpunit": "^4.8.35|^5.4.3",
-                "symfony/cache": "^3.1|^4.0|^5.0",
-                "tedivm/stash": "^0.14"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "Cache\\IntegrationTests\\": "src/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Aaron Scherer",
-                    "email": "aequasi@gmail.com",
-                    "homepage": "https://github.com/aequasi"
-                },
-                {
-                    "name": "Tobias Nyholm",
-                    "email": "tobias.nyholm@gmail.com",
-                    "homepage": "https://github.com/nyholm"
-                }
-            ],
-            "description": "Integration tests for PSR-6 and PSR-16 cache implementations",
-            "homepage": "https://github.com/php-cache/integration-tests",
-            "keywords": [
-                "cache",
-                "psr16",
-                "psr6",
-                "test"
-            ],
-            "time": "2019-05-28T15:23:38+00:00"
-        },
-        {
-            "name": "cache/tag-interop",
-            "version": "1.0.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/php-cache/tag-interop.git",
-                "reference": "c7496dd81530f538af27b4f2713cde97bc292832"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/php-cache/tag-interop/zipball/c7496dd81530f538af27b4f2713cde97bc292832",
-                "reference": "c7496dd81530f538af27b4f2713cde97bc292832",
-                "shasum": ""
-            },
-            "require": {
-                "php": "^5.5 || ^7.0",
-                "psr/cache": "^1.0"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.0-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Cache\\TagInterop\\": ""
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Tobias Nyholm",
-                    "email": "tobias.nyholm@gmail.com",
-                    "homepage": "https://github.com/Nyholm"
-                },
-                {
-                    "name": "Nicolas Grekas",
-                    "email": "p@tchwork.com",
-                    "homepage": "https://github.com/nicolas-grekas"
-                }
-            ],
-            "description": "Framework interoperable interfaces for tags",
-            "homepage": "http://www.php-cache.com/en/latest/",
-            "keywords": [
-                "cache",
-                "psr",
-                "psr6",
-                "tag"
-            ],
-            "time": "2017-03-13T09:14:27+00:00"
-        },
-        {
-            "name": "psr/cache",
-            "version": "1.0.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/php-fig/cache.git",
-                "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
-                "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.0"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.0.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Psr\\Cache\\": "src/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "PHP-FIG",
-                    "homepage": "http://www.php-fig.org/"
-                }
-            ],
-            "description": "Common interface for caching libraries",
-            "keywords": [
-                "cache",
-                "psr",
-                "psr-6"
-            ],
-            "time": "2016-08-06T20:24:11+00:00"
-        }
-    ],
+    "packages-dev": [],
     "aliases": [],
     "minimum-stability": "stable",
     "stability-flags": {
-        "pear/validate_finance_creditcard": 20,
-        "cache/integration-tests": 20
+        "pear/validate_finance_creditcard": 20
     },
     "prefer-stable": false,
     "prefer-lowest": false,
index d75826462377f0d36ba3b5c3dca21b6f053c6050..3dd15c100c34933ae03c4d4ec0a52a86a86bfbf2 100644 (file)
@@ -15,6 +15,17 @@ Other resources for identifying changes are:
     * https://github.com/civicrm/civicrm-joomla
     * https://github.com/civicrm/civicrm-wordpress
 
+## CiviCRM 5.23.0
+
+Released March 4, 2020
+
+- **[Synopsis](release-notes/5.23.0.md#synopsis)**
+- **[Features](release-notes/5.23.0.md#features)**
+- **[Bugs resolved](release-notes/5.23.0.md#bugs)**
+- **[Miscellany](release-notes/5.23.0.md#misc)**
+- **[Credits](release-notes/5.23.0.md#credits)**
+- **[Feedback](release-notes/5.23.0.md#feedback)**
+
 ## CiviCRM 5.22.0
 
 Released February 5, 2020
diff --git a/release-notes/5.23.0.md b/release-notes/5.23.0.md
new file mode 100644 (file)
index 0000000..57fd277
--- /dev/null
@@ -0,0 +1,557 @@
+# CiviCRM 5.23.0
+
+Released March 4, 2020
+
+- **[Synopsis](#synopsis)**
+- **[Features](#features)**
+- **[Bugs resolved](#bugs)**
+- **[Miscellany](#misc)**
+- **[Credits](#credits)**
+- **[Feedback](#feedback)**
+
+## <a name="synopsis"></a>Synopsis
+
+| *Does this version...?*                                         |         |
+|:--------------------------------------------------------------- |:-------:|
+| Fix security vulnerabilities?                                   |         |
+| Change the database schema?                                     |         |
+| Alter the API?                                                  |         |
+| Require attention to configuration options?                     |         |
+| Fix problems installing or upgrading to a previous version?     |         |
+| Introduce features?                                             |         |
+| Fix bugs?                                                       |         |
+
+## <a name="features"></a>Features
+
+### Core CiviCRM
+
+- **crm- Missing Summary ([16423](https://github.com/civicrm/civicrm-core/pull/16423))**
+
+- **CRM-19767 Missing Summary ([16105](https://github.com/civicrm/civicrm-core/pull/16105))**
+
+## <a name="bugs"></a>Bugs resolved
+
+### Core CiviCRM
+
+- **[NFC] Skip utf8mb4 test on MySQL versions lower than 5.7 ([16483](https://github.com/civicrm/civicrm-core/pull/16483))**
+
+- **release-notes: Late changes for 5.22 release notes ([16485](https://github.com/civicrm/civicrm-core/pull/16485))**
+
+- **release-notes: Late changes for 5.22 release notes ([16476](https://github.com/civicrm/civicrm-core/pull/16476))**
+
+- **APIv4 documentation & code cleanup ([16457](https://github.com/civicrm/civicrm-core/pull/16457))**
+
+- **Revert "Remove unreachable code lines." ([16472](https://github.com/civicrm/civicrm-core/pull/16472))**
+
+- **Call hook_civicrm_copy for RecurringEntity ([16466](https://github.com/civicrm/civicrm-core/pull/16466))**
+
+- **composer.json - Relax psr/log constraint. Improve D8 compatibility. ([16471](https://github.com/civicrm/civicrm-core/pull/16471))**
+
+- **APIv3 - Only scan files for deprecation checks in Entity.get ([16460](https://github.com/civicrm/civicrm-core/pull/16460))**
+
+- **Fix for #1573: Extra columns for Contribution Detail report. ([16458](https://github.com/civicrm/civicrm-core/pull/16458))**
+
+- **5.22 to master ([16469](https://github.com/civicrm/civicrm-core/pull/16469))**
+
+- **Fix obscure bug ([16463](https://github.com/civicrm/civicrm-core/pull/16463))**
+
+- **Add require_once to api3TestTrait ([16461](https://github.com/civicrm/civicrm-core/pull/16461))**
+
+- **[REF] Interim code cleanup - make the usage of addPayments clearer ([16441](https://github.com/civicrm/civicrm-core/pull/16441))**
+
+- **Pass language code to CiviCRM for Wordpress ([16446](https://github.com/civicrm/civicrm-core/pull/16446))**
+
+- **dev/core#1558 retrieve setting credit_notes_prefix as  a 'real' setting. ([16397](https://github.com/civicrm/civicrm-core/pull/16397))**
+
+- **APIv4 - Variable substution in docblocks ([16449](https://github.com/civicrm/civicrm-core/pull/16449))**
+
+- **APIv4 Explorer - Better UI for defaults param ([16454](https://github.com/civicrm/civicrm-core/pull/16454))**
+
+- **NFC Fix TokenRow docblock ([16452](https://github.com/civicrm/civicrm-core/pull/16452))**
+
+- **[NFC] Minor test cleanup. ([16450](https://github.com/civicrm/civicrm-core/pull/16450))**
+
+- **[REF] Pass params into function rather than this weird check for whether params exists. ([16438](https://github.com/civicrm/civicrm-core/pull/16438))**
+
+- **dev/core#1319 Fix regression with shared household address ([16447](https://github.com/civicrm/civicrm-core/pull/16447))**
+
+- **dev/core#1471 - Add system status alert for deleted custom fields in … ([16267](https://github.com/civicrm/civicrm-core/pull/16267))**
+
+- **Add unit test to back office form when a payment is made against a partially paid contribution ([16437](https://github.com/civicrm/civicrm-core/pull/16437))**
+
+- **Respect form value for register_date on partipant form ([16439](https://github.com/civicrm/civicrm-core/pull/16439))**
+
+- **Use markdown in php docblocks & display in APIv4 Explorer ([16425](https://github.com/civicrm/civicrm-core/pull/16425))**
+
+- **event#23 - don't count non-counted participants on Confirm Registrati… ([16098](https://github.com/civicrm/civicrm-core/pull/16098))**
+
+- **[REF] Remove unused variable ([16434](https://github.com/civicrm/civicrm-core/pull/16434))**
+
+- **APIv4 - don't throw exception when updating/deleting 0 items ([16374](https://github.com/civicrm/civicrm-core/pull/16374))**
+
+- **Cleanup API_Exception usage ([16432](https://github.com/civicrm/civicrm-core/pull/16432))**
+
+- **dev/core#1558 Data conversion for non-standard setting. ([16424](https://github.com/civicrm/civicrm-core/pull/16424))**
+
+- **dev/core#560 Replace fatal with exception ([16433](https://github.com/civicrm/civicrm-core/pull/16433))**
+
+- **APIv4 Explorer css tweaks ([16431](https://github.com/civicrm/civicrm-core/pull/16431))**
+
+- **dev/core#547 If CiviContribute is not enabled don't crash when calling ContributionPage.getoptions or Event.getoptions ([16365](https://github.com/civicrm/civicrm-core/pull/16365))**
+
+- **dev/core#1522 Handle space as thousand separator ([16392](https://github.com/civicrm/civicrm-core/pull/16392))**
+
+- **dev/core#1558 [REF] Remove deprecated code from CRM_Admin_Form_Preferences ([16398](https://github.com/civicrm/civicrm-core/pull/16398))**
+
+- **dev/core#1387 Continue removal of "config_backend" ([15842](https://github.com/civicrm/civicrm-core/pull/15842))**
+
+- **IconPicker widget improvements ([15760](https://github.com/civicrm/civicrm-core/pull/15760))**
+
+- **Civi\Test - Allow `headless()->apply()` (etc) to execute without setup.sh ([16405](https://github.com/civicrm/civicrm-core/pull/16405))**
+
+- **Allow most values of $civicrm_paths['XXX']['url'] to be relative  ([16403](https://github.com/civicrm/civicrm-core/pull/16403))**
+
+- **Fix loading with alternate packages path (system-level) ([16407](https://github.com/civicrm/civicrm-core/pull/16407))**
+
+- **CRM_Core_Menu - Fix warnings during local test run (dev/core#742) ([16406](https://github.com/civicrm/civicrm-core/pull/16406))**
+
+- ** Fix loading with alternate packages path (UI-level) ([16409](https://github.com/civicrm/civicrm-core/pull/16409))**
+
+- **Api4 docs improvements ([16411](https://github.com/civicrm/civicrm-core/pull/16411))**
+
+- **[REF] Add test for line item, extract fn ([16402](https://github.com/civicrm/civicrm-core/pull/16402))**
+
+- **[REF] Ensure that the from is correctly modified in both the main que… ([16422](https://github.com/civicrm/civicrm-core/pull/16422))**
+
+- **composer.json - Explicitly set target PHP platform ([16421](https://github.com/civicrm/civicrm-core/pull/16421))**
+
+- **5.22 to master ([16420](https://github.com/civicrm/civicrm-core/pull/16420))**
+
+- **5.22 ([16419](https://github.com/civicrm/civicrm-core/pull/16419))**
+
+- **[NFC] throw exceptions, single quotes, declare exceptions, remove unused param ([16415](https://github.com/civicrm/civicrm-core/pull/16415))**
+
+- **[REF] Remove some unused variables ([16414](https://github.com/civicrm/civicrm-core/pull/16414))**
+
+- **dev/core#1558 [REF] Remove unnecessary query, clean up silly function ([16412](https://github.com/civicrm/civicrm-core/pull/16412))**
+
+- **setup.sh - Fixes for running in basic composer file-structure ([16408](https://github.com/civicrm/civicrm-core/pull/16408))**
+
+- **5.22 to master ([16410](https://github.com/civicrm/civicrm-core/pull/16410))**
+
+- **Make $civicrm_paths less sensitive to trailing slashes. Add tests. ([16404](https://github.com/civicrm/civicrm-core/pull/16404))**
+
+- **[REF] Extract & share code to determine revenue recognition date. ([16388](https://github.com/civicrm/civicrm-core/pull/16388))**
+
+- **Prevent PropertBag from being so noisy about deprecation warnings ([16390](https://github.com/civicrm/civicrm-core/pull/16390))**
+
+- **Finish removal of deferred_revenue_enabled from non-standard setting ([16395](https://github.com/civicrm/civicrm-core/pull/16395))**
+
+- **REF Extract code to build pcp_supporter_text and enable translation ([16271](https://github.com/civicrm/civicrm-core/pull/16271))**
+
+- **[REF] Remove unused variables ([16396](https://github.com/civicrm/civicrm-core/pull/16396))**
+
+- **dev/core#1550 Invalid links to extension directory in popup help text ([16394](https://github.com/civicrm/civicrm-core/pull/16394))**
+
+- **Api4 - Use explicit adder functions rather than magicMethod ([16372](https://github.com/civicrm/civicrm-core/pull/16372))**
+
+- **Fix tests to use buildFeeFn ([16389](https://github.com/civicrm/civicrm-core/pull/16389))**
+
+- **dev/translation#30 Move l10n resource dir under private files ([15408](https://github.com/civicrm/civicrm-core/pull/15408))**
+
+- **dev/translation#34 Fix Contact Reference option for Postal Code ([16352](https://github.com/civicrm/civicrm-core/pull/16352))**
+
+- **event#32: Fix bad variable in message template ([16367](https://github.com/civicrm/civicrm-core/pull/16367))**
+
+- **Remove irrelevant code. ([16348](https://github.com/civicrm/civicrm-core/pull/16348))**
+
+- **Update Export unit test to pass on MySQL 8 ([16375](https://github.com/civicrm/civicrm-core/pull/16375))**
+
+- **dev/translation#33 Fix incorrect quoting in a link and an incorrect link ([16387](https://github.com/civicrm/civicrm-core/pull/16387))**
+
+- **dev/drupal#85 Drupal8: Fix bug with empty language prefix mangling https:// to http:/ ([15912](https://github.com/civicrm/civicrm-core/pull/15912))**
+
+- **5.22 ([16386](https://github.com/civicrm/civicrm-core/pull/16386))**
+
+- **5.22 ([16385](https://github.com/civicrm/civicrm-core/pull/16385))**
+
+- **(NFC) Update Var declaration to be standard in CRM folder ([16382](https://github.com/civicrm/civicrm-core/pull/16382))**
+
+- **Add helper for getting participantValues ([16355](https://github.com/civicrm/civicrm-core/pull/16355))**
+
+- **(NFC) Civi/*.php - Update for Drupal.Commenting.VariableComment.IncorrectVarType ([16379](https://github.com/civicrm/civicrm-core/pull/16379))**
+
+- **Api4 - improve docblocks & display links in explorer ([16373](https://github.com/civicrm/civicrm-core/pull/16373))**
+
+- **NFC Add parameter definition to membershipstatus.calc ([16370](https://github.com/civicrm/civicrm-core/pull/16370))**
+
+- **Move exportui extension into core ([16335](https://github.com/civicrm/civicrm-core/pull/16335))**
+
+- **Remove unused code ([16371](https://github.com/civicrm/civicrm-core/pull/16371))**
+
+- **Duplicate code (for real) ([16363](https://github.com/civicrm/civicrm-core/pull/16363))**
+
+- **dev/core#1364 Merge all addresses on export should INCLUDE merging households ([16369](https://github.com/civicrm/civicrm-core/pull/16369))**
+
+- **Make getTotalPayments return 0 instead of NULL ([16129](https://github.com/civicrm/civicrm-core/pull/16129))**
+
+- **[REF] Extract function to export header row ([16364](https://github.com/civicrm/civicrm-core/pull/16364))**
+
+- **fix more typo's in the text ([16368](https://github.com/civicrm/civicrm-core/pull/16368))**
+
+- **event#30 - don't allow multiple waitlist registrations ([16358](https://github.com/civicrm/civicrm-core/pull/16358))**
+
+- **Wrong parameter passed to executeQuery function ([16353](https://github.com/civicrm/civicrm-core/pull/16353))**
+
+- **event#28: Don't send scheduled reminders for event templates ([16311](https://github.com/civicrm/civicrm-core/pull/16311))**
+
+- **fix typo's in the text ([16361](https://github.com/civicrm/civicrm-core/pull/16361))**
+
+- **Update BAO_Acl internal functions to protected & unused to deprecated ([16189](https://github.com/civicrm/civicrm-core/pull/16189))**
+
+- **Add function to set entitySubType for entity forms ([16017](https://github.com/civicrm/civicrm-core/pull/16017))**
+
+- **dev/translation#35 Display the CiviCRM Resources dashlet in the user's language ([16354](https://github.com/civicrm/civicrm-core/pull/16354))**
+
+- **[REF] Move assignment of BalanceAmount ([16334](https://github.com/civicrm/civicrm-core/pull/16334))**
+
+- **Add debug info to api4 output ([16351](https://github.com/civicrm/civicrm-core/pull/16351))**
+
+- **[REF] Fix CRM_Core_BAO_UFGroup::createUFJoin to not receive by reference. ([16260](https://github.com/civicrm/civicrm-core/pull/16260))**
+
+- **Remove unreachable code lines. ([16349](https://github.com/civicrm/civicrm-core/pull/16349))**
+
+- **dev/mailing#59 Add in provider option IMAP_XOAUTH2 to assist with goo… ([16307](https://github.com/civicrm/civicrm-core/pull/16307))**
+
+- **dev/core#1537 Don't append multiple copies of the eligible related contacts text ([16326](https://github.com/civicrm/civicrm-core/pull/16326))**
+
+- **Add "Contributor Name" to Offline Contribution Receipts ([16286](https://github.com/civicrm/civicrm-core/pull/16286))**
+
+- **Api4 - Make abstract function abstract ([16343](https://github.com/civicrm/civicrm-core/pull/16343))**
+
+- **Api4 - Improve Entity::get ([16346](https://github.com/civicrm/civicrm-core/pull/16346))**
+
+- **dev/core#1116 Wrong linebreaks viewing Inbound Emails when activity type label is changed ([16347](https://github.com/civicrm/civicrm-core/pull/16347))**
+
+- **Change function buildEventFeeForm to non-static ([16337](https://github.com/civicrm/civicrm-core/pull/16337))**
+
+- **Fix unit test so price set params are valid ([16344](https://github.com/civicrm/civicrm-core/pull/16344))**
+
+- **Add user friendly error message on merge error ([16340](https://github.com/civicrm/civicrm-core/pull/16340))**
+
+- **Simplify event title retrieval, use cache, add test ([16345](https://github.com/civicrm/civicrm-core/pull/16345))**
+
+- **[NFC] Remove unused local variables from CRM_Contribute_Form_AdditionalPayment::processCreditCard ([16342](https://github.com/civicrm/civicrm-core/pull/16342))**
+
+- **When viewing a membership show if the status is overridden ([16341](https://github.com/civicrm/civicrm-core/pull/16341))**
+
+- **dev/core#1064 Allow personalised 'view in browser' links for mass emails ([14591](https://github.com/civicrm/civicrm-core/pull/14591))**
+
+- **[REF] Remove setting of unused function. ([16315](https://github.com/civicrm/civicrm-core/pull/16315))**
+
+- **[NFC] Code formatting ([16331](https://github.com/civicrm/civicrm-core/pull/16331))**
+
+- **Start to use function rather than multiple queries for event details add test ([16329](https://github.com/civicrm/civicrm-core/pull/16329))**
+
+- **[REF] Move the bounce to the start of the form submit ([16333](https://github.com/civicrm/civicrm-core/pull/16333))**
+
+- **[NFC] Extend unit test to cover for recent refactor by eileen to ensure sup… ([16332](https://github.com/civicrm/civicrm-core/pull/16332))**
+
+- **[REF] Eliminate silly parameter from function signature. ([16330](https://github.com/civicrm/civicrm-core/pull/16330))**
+
+- **Fix retrieving contribution_status_id for manual payment processor ([16018](https://github.com/civicrm/civicrm-core/pull/16018))**
+
+- **Remove function that exactly matches parent class. ([16316](https://github.com/civicrm/civicrm-core/pull/16316))**
+
+- **Extract code for isPaymentOnExistingContribution. ([16327](https://github.com/civicrm/civicrm-core/pull/16327))**
+
+- **[REF] Extract code that assigns event variables to the tpl ([16325](https://github.com/civicrm/civicrm-core/pull/16325))**
+
+- **[NFC] Code cleanup ([16314](https://github.com/civicrm/civicrm-core/pull/16314))**
+
+- **Update temp table handler to support utf8mb4 if that is the db collation ([15992](https://github.com/civicrm/civicrm-core/pull/15992))**
+
+- **also skip report instance header and footer (lab-1286) ([15383](https://github.com/civicrm/civicrm-core/pull/15383))**
+
+- **NFC Convert Manage PCP page to short array syntax ([16320](https://github.com/civicrm/civicrm-core/pull/16320))**
+
+- **dev/core#1535 - Fix missing address is_primary field ([16321](https://github.com/civicrm/civicrm-core/pull/16321))**
+
+- **Remove duplicate line of code ([16317](https://github.com/civicrm/civicrm-core/pull/16317))**
+
+- **5.22 ([16319](https://github.com/civicrm/civicrm-core/pull/16319))**
+
+- **[NFC] code cleanup ([16310](https://github.com/civicrm/civicrm-core/pull/16310))**
+
+- **[NFC] Code cleanup ([16309](https://github.com/civicrm/civicrm-core/pull/16309))**
+
+- **[REF] Remove apparent copy & paste code. ([16308](https://github.com/civicrm/civicrm-core/pull/16308))**
+
+- **Api4 - Support wildcard * in select clause ([16302](https://github.com/civicrm/civicrm-core/pull/16302))**
+
+- **Api4 - format output consistently across get/create/update. ([16305](https://github.com/civicrm/civicrm-core/pull/16305))**
+
+- **dev/mailing#59 Update the version of zetacomponents/mail package to b… ([16306](https://github.com/civicrm/civicrm-core/pull/16306))**
+
+- **Remove unused code in Case/Form/Activity postProcess ([16304](https://github.com/civicrm/civicrm-core/pull/16304))**
+
+- **Update docs link for edit scheduled job parameters ([16299](https://github.com/civicrm/civicrm-core/pull/16299))**
+
+- **Api4 - Filter returned fields by contact type ([16300](https://github.com/civicrm/civicrm-core/pull/16300))**
+
+- **Fix minor typo in help text. ([16303](https://github.com/civicrm/civicrm-core/pull/16303))**
+
+- **dev/core#1395 - Clear the asset builder cache when clearing cache ([15857](https://github.com/civicrm/civicrm-core/pull/15857))**
+
+- **dev/core#1511 Expose option to show event location on configuration tab ([16230](https://github.com/civicrm/civicrm-core/pull/16230))**
+
+- **[NFC] code cleanup ([16301](https://github.com/civicrm/civicrm-core/pull/16301))**
+
+- **Add metadata to is_primary fields ([16113](https://github.com/civicrm/civicrm-core/pull/16113))**
+
+- **Enforce isSkipLineItem for membership payment entity in Order.create ([15891](https://github.com/civicrm/civicrm-core/pull/15891))**
+
+- **dev/core#1517 - Permission error on event info page for anonymous users ([16266](https://github.com/civicrm/civicrm-core/pull/16266))**
+
+- **Fetch Only Active Custom Group Extend Values ([15759](https://github.com/civicrm/civicrm-core/pull/15759))**
+
+- **5.22 ([16296](https://github.com/civicrm/civicrm-core/pull/16296))**
+
+- **dev/drupal#89 Drupal 8 version of checkGroupRole ([16273](https://github.com/civicrm/civicrm-core/pull/16273))**
+
+- **Enotice fix ([16293](https://github.com/civicrm/civicrm-core/pull/16293))**
+
+- **[NFC] Minor code cleanup ([16290](https://github.com/civicrm/civicrm-core/pull/16290))**
+
+- **dev/core#1255 - fix display of email address on pay later contribution ([15314](https://github.com/civicrm/civicrm-core/pull/15314))**
+
+- **Check field to carry over custom data by default when the other contact has none ([16246](https://github.com/civicrm/civicrm-core/pull/16246))**
+
+- **5.22 to master ([16288](https://github.com/civicrm/civicrm-core/pull/16288))**
+
+- **dev/core#1502 Make unicode font dejavusans the default for mailing labels ([16216](https://github.com/civicrm/civicrm-core/pull/16216))**
+
+- **Basic extraction of paid event processing ([16281](https://github.com/civicrm/civicrm-core/pull/16281))**
+
+- **Update civicrm.settings.php.template to default to CLEANURL for WP ([16284](https://github.com/civicrm/civicrm-core/pull/16284))**
+
+- **dev/core#1520 Improve accessibility of membership edit form ([16272](https://github.com/civicrm/civicrm-core/pull/16272))**
+
+- **Force reCaptcha is not working when pay later enabled ([16282](https://github.com/civicrm/civicrm-core/pull/16282))**
+
+- **[REF] Fix return value on deleting financial type ([16280](https://github.com/civicrm/civicrm-core/pull/16280))**
+
+- **Api4 - Convert field values to correct data type ([16274](https://github.com/civicrm/civicrm-core/pull/16274))**
+
+- **Implement PaymentProcessor and PaymentProcessorType APIv4 Entities ([15624](https://github.com/civicrm/civicrm-core/pull/15624))**
+
+- **[REF] Move handling of default payment instrument for a payment proc… ([16279](https://github.com/civicrm/civicrm-core/pull/16279))**
+
+- **Restrict case roles by group ([15570](https://github.com/civicrm/civicrm-core/pull/15570))**
+
+- **Remove never passed-in parameter from addPayments ([16262](https://github.com/civicrm/civicrm-core/pull/16262))**
+
+- **Remove unused and largely unreachable code. ([16244](https://github.com/civicrm/civicrm-core/pull/16244))**
+
+- **[REF] Reduce places where we pass ids into Mailing::create ([16263](https://github.com/civicrm/civicrm-core/pull/16263))**
+
+- **[REF] Remove ids and fully deprecate passing it to Contribution::create ([16256](https://github.com/civicrm/civicrm-core/pull/16256))**
+
+- **Ensure that we always return a raw urlencoded url for extenal urls to… ([16265](https://github.com/civicrm/civicrm-core/pull/16265))**
+
+- **[NFC] Explicitly specify that it is the Payment processor Type Name n… ([16275](https://github.com/civicrm/civicrm-core/pull/16275))**
+
+- **5.22 ([16278](https://github.com/civicrm/civicrm-core/pull/16278))**
+
+- **Add resolved to return array for get_conflicts ([15829](https://github.com/civicrm/civicrm-core/pull/15829))**
+
+- **dev/core#1519 Fix auto renew text ([16269](https://github.com/civicrm/civicrm-core/pull/16269))**
+
+- **Update contributor-key.yml ([16268](https://github.com/civicrm/civicrm-core/pull/16268))**
+
+- **Update failing test to match intervening changes elsewhere ([16270](https://github.com/civicrm/civicrm-core/pull/16270))**
+
+- **#1253 Pass mailing id to alterMailContent hook ([15306](https://github.com/civicrm/civicrm-core/pull/15306))**
+
+- **dev/core#1507 Fix recent items for viewing Email activities from contact activities tab ([16195](https://github.com/civicrm/civicrm-core/pull/16195))**
+
+- **Add more functionality to the api4 $index param ([16257](https://github.com/civicrm/civicrm-core/pull/16257))**
+
+- **Add pre/post hooks on ContributionSoft entity ([16264](https://github.com/civicrm/civicrm-core/pull/16264))**
+
+- **dev/drupal#89 - Drupal 8 - Contact Report does not load any values in… ([15318](https://github.com/civicrm/civicrm-core/pull/15318))**
+
+- **Country/State PseudoConstant not sorted according to the locale ([16258](https://github.com/civicrm/civicrm-core/pull/16258))**
+
+- **Set contribution status to refunded when it has been refunded ([16148](https://github.com/civicrm/civicrm-core/pull/16148))**
+
+- **[REF] Remove never-passed param from getLineItems ([16251](https://github.com/civicrm/civicrm-core/pull/16251))**
+
+- **Add tax rates to metadata ([16253](https://github.com/civicrm/civicrm-core/pull/16253))**
+
+- **[REF] Extract location wrangling code. ([16247](https://github.com/civicrm/civicrm-core/pull/16247))**
+
+- **[REF] rename lineItem & lineItems variable ([16254](https://github.com/civicrm/civicrm-core/pull/16254))**
+
+- **core#1512: Address ID should be exportable ([16240](https://github.com/civicrm/civicrm-core/pull/16240))**
+
+- **Fix activity.case_id token to always display the first case ID ([16208](https://github.com/civicrm/civicrm-core/pull/16208))**
+
+- **[REF] Move use of priceSetID & amount_override to where they are used ([16252](https://github.com/civicrm/civicrm-core/pull/16252))**
+
+- **[REF] Cleanup CRM_Member_BAO_Membership::buildMembershipTypeValues ([16059](https://github.com/civicrm/civicrm-core/pull/16059))**
+
+- **[REF] Remove enclosed & escaped variables ([16249](https://github.com/civicrm/civicrm-core/pull/16249))**
+
+- **[NFC] Code comments ([16248](https://github.com/civicrm/civicrm-core/pull/16248))**
+
+- **[NFC] Minor cleanup in test class ([16250](https://github.com/civicrm/civicrm-core/pull/16250))**
+
+- **[REF] Minor code simplification in dedupe. ([16245](https://github.com/civicrm/civicrm-core/pull/16245))**
+
+- **dev/core#1100 Add externUrl method and civicrm_alterExternUrl hook ([15475](https://github.com/civicrm/civicrm-core/pull/15475))**
+
+- **Remove patch hunk now that zetacomponents/Mail#73 has been merged ([16231](https://github.com/civicrm/civicrm-core/pull/16231))**
+
+- **[REF] move sessionStart functionality to System subclass ([16241](https://github.com/civicrm/civicrm-core/pull/16241))**
+
+- **5.22 to master ([16242](https://github.com/civicrm/civicrm-core/pull/16242))**
+
+- **dev/core#1378 Scheduled reminders: do not email if do_not_email or on_hold ([15778](https://github.com/civicrm/civicrm-core/pull/15778))**
+
+- **Add utf8 to utfmb8 conversion api command ([15969](https://github.com/civicrm/civicrm-core/pull/15969))**
+
+- **dev/core#495 Make admin settings field labels translatable ([16234](https://github.com/civicrm/civicrm-core/pull/16234))**
+
+- **dev/core#495 Make admin settings field labels translatable ([16235](https://github.com/civicrm/civicrm-core/pull/16235))**
+
+- **dev/core#495 Make admin settings field labels translatable ([16236](https://github.com/civicrm/civicrm-core/pull/16236))**
+
+- **dev/core#495 Make admin settings field labels translatable ([16237](https://github.com/civicrm/civicrm-core/pull/16237))**
+
+- **dev/core#495 Make admin settings field labels translatable ([16233](https://github.com/civicrm/civicrm-core/pull/16233))**
+
+- **dev/core#495 Make admin settings field labels translatable ([16232](https://github.com/civicrm/civicrm-core/pull/16232))**
+
+- **dev/core#495 Make admin settings field labels translatable ([16228](https://github.com/civicrm/civicrm-core/pull/16228))**
+
+- **dev/core#495 Make admin settings field labels translatable ([16229](https://github.com/civicrm/civicrm-core/pull/16229))**
+
+- **dev/core#495 Make admin settings field labels translatable  ([16227](https://github.com/civicrm/civicrm-core/pull/16227))**
+
+- **Change check.gif to an actual gif (was a PNG) ([16220](https://github.com/civicrm/civicrm-core/pull/16220))**
+
+- **Refactor CRM_Contact_BAO_Contact::importableFields() to use metadata ([16222](https://github.com/civicrm/civicrm-core/pull/16222))**
+
+- **5.22 to master ([16226](https://github.com/civicrm/civicrm-core/pull/16226))**
+
+- **dev/core#495 Add some ts tags on settings ([16224](https://github.com/civicrm/civicrm-core/pull/16224))**
+
+- **dev/core#1249 Allow IPNs to be validated even if the supplied contact… ([15307](https://github.com/civicrm/civicrm-core/pull/15307))**
+
+- **dev/core#1355 Add contention handling for dedupe jobs ([15670](https://github.com/civicrm/civicrm-core/pull/15670))**
+
+- **Revised version of test from #15725 ([15948](https://github.com/civicrm/civicrm-core/pull/15948))**
+
+- **[NFC] Test update following PR #16150, assertEquals first param is th… ([16219](https://github.com/civicrm/civicrm-core/pull/16219))**
+
+- **dev/core#1499 - Case Resource shows contact names that are not access… ([16150](https://github.com/civicrm/civicrm-core/pull/16150))**
+
+- **Deprecate creating partially paid contributions, other than by partially paying a contribution. ([15855](https://github.com/civicrm/civicrm-core/pull/15855))**
+
+- **[NFC] Add in more assertions around the content of line items and tot… ([16218](https://github.com/civicrm/civicrm-core/pull/16218))**
+
+- **[REF] Update fetchAll function signature to match parent function ([16198](https://github.com/civicrm/civicrm-core/pull/16198))**
+
+- **Fix Error handling following DB Package upgrade ([16213](https://github.com/civicrm/civicrm-core/pull/16213))**
+
+- **dev/core#1143 Support MySQL 8 by wrapping the word groups around in b… ([16201](https://github.com/civicrm/civicrm-core/pull/16201))**
+
+- **dev/core#392 Fix FTS INNDOB indexer query to work in MySQL 8 as well … ([16202](https://github.com/civicrm/civicrm-core/pull/16202))**
+
+- **dev/core#1143 Fix Upgrade tests on MySQL 8 by quoting reserved words ([16214](https://github.com/civicrm/civicrm-core/pull/16214))**
+
+- **dev/WordPress#2 Modify the WordPress plugin version using distmaker ([16211](https://github.com/civicrm/civicrm-core/pull/16211))**
+
+- **dev/core#1506 Fix blank group title in recent items list when editing description inline ([16197](https://github.com/civicrm/civicrm-core/pull/16197))**
+
+- **REF Simplify if statement on case activity form ([16210](https://github.com/civicrm/civicrm-core/pull/16210))**
+
+- **dev/core#1143 Ensure that columns that are reserved words e.g. groupi… ([16203](https://github.com/civicrm/civicrm-core/pull/16203))**
+
+- **dev/core#392 Ensure that the log_date column on logging tables is NOT… ([16204](https://github.com/civicrm/civicrm-core/pull/16204))**
+
+- **dev/core#392 Fix handling of dates in getMembershipStarts function to… ([16207](https://github.com/civicrm/civicrm-core/pull/16207))**
+
+- **dev/core#1143 Ensure that any field name when performaning an export … ([16206](https://github.com/civicrm/civicrm-core/pull/16206))**
+
+- **Update copyright headers following merge of #14662 ([16199](https://github.com/civicrm/civicrm-core/pull/16199))**
+
+- **[REF] Eliminate ['userID'] as an input for BAO_Membership::create ([16196](https://github.com/civicrm/civicrm-core/pull/16196))**
+
+- **dev/core#1143 enable auto adding of backticks when doing an insert() or update() function ([16193](https://github.com/civicrm/civicrm-core/pull/16193))**
+
+- **Update function to repair indexes to take table as a parameter ([16146](https://github.com/civicrm/civicrm-core/pull/16146))**
+
+- **dev/core#711 Add in upgrade step for removing Google+ from website ty… ([16185](https://github.com/civicrm/civicrm-core/pull/16185))**
+
+- **[REF] Move the storing of custom data into the add function rather th… ([16191](https://github.com/civicrm/civicrm-core/pull/16191))**
+
+- **Add PDF letter functionality for Activities using new token processor ([14662](https://github.com/civicrm/civicrm-core/pull/14662))**
+
+- **5.22 ([16194](https://github.com/civicrm/civicrm-core/pull/16194))**
+
+- **Remove  $ids as parameter for Membership::add ([16192](https://github.com/civicrm/civicrm-core/pull/16192))**
+
+- **Permit modified_id as a parameter for membership create api ([16166](https://github.com/civicrm/civicrm-core/pull/16166))**
+
+- **Remove unindexed join from getACLRoles query ([16183](https://github.com/civicrm/civicrm-core/pull/16183))**
+
+- **5.22 ([16188](https://github.com/civicrm/civicrm-core/pull/16188))**
+
+- **dev/drupal#98 Fix masquerade issue caused by drupal update change ([16177](https://github.com/civicrm/civicrm-core/pull/16177))**
+
+- **Mailing Subscribe Form: remove nbsp from descriptions ([16186](https://github.com/civicrm/civicrm-core/pull/16186))**
+
+- **Update my contributor details ([16184](https://github.com/civicrm/civicrm-core/pull/16184))**
+
+- **dev/core#711 remove Google+ ([16099](https://github.com/civicrm/civicrm-core/pull/16099))**
+
+- **[NFC] Doc Block fix should be bool no boolean as per coding standards ([596](https://github.com/civicrm/civicrm-drupal/pull/596))**
+
+- **dev/drupal#102 Fix wiki link that goes nowhere ([595](https://github.com/civicrm/civicrm-drupal/pull/595))**
+
+- **Remove SymfonyComponents/YAML package ([285](https://github.com/civicrm/civicrm-packages/pull/285))**
+
+- **[REF] Activate fetchAll function in DataObject file ([281](https://github.com/civicrm/civicrm-packages/pull/281))**
+
+- **Remove unmaintained unsupported System_Command package ([283](https://github.com/civicrm/civicrm-packages/pull/283))**
+
+- **Fix unit tests after gettext merge ([282](https://github.com/civicrm/civicrm-packages/pull/282))**
+
+- **Update DB_Object ([280](https://github.com/civicrm/civicrm-packages/pull/280))**
+
+- **Update gettext to latest tagged release ([227](https://github.com/civicrm/civicrm-packages/pull/227))**
+
+- **Upgrade DB package to be version 1.9.3 ([276](https://github.com/civicrm/civicrm-packages/pull/276))**
+
+- **Remove unsupported and unused package DB_Table ([277](https://github.com/civicrm/civicrm-packages/pull/277))**
+
+## <a name="misc"></a>Miscellany
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following code authors:
+
+a-n The Artists Information Company - William Mortada; AGH Strategies - Andrew Hunt; Agileware - Pengyi Zhang; Andrei Mondoc; borisson; British Humanist Association - Andrew West; Caltha - Tomasz Pietrzkowski; Chris Burgess; Circle Interactive - Pradeep Nayak; CiviCoop - Jaap Jansma; CiviCRM - Coleman Watts, Tim Otten; CiviDesk - Yashodha Chaku; CompuCorp - Vinu Varshith Sekar; Coop SymbioTIC - Mathieu Lutfy, Samuel Vanhove; Dave D; Electronic Frontier Foundation - Mark Burdett; Fuzion - Jitendra Purohit; Jade Gaunt; JMA Consulting - Seamus Lee; John Kingsnorth; Joinery - Allen Shaw; Megaphone Technology Consulting - Jon Goldberg; MJCO - Mikey O'Toole; MJW Consulting - Matthew Wire; myDropWizard - David Snopek; Progressive Technology Project - Jamie McClelland; Squiffle Consulting - Aidan Saunders; Tadpole Collective - Kevin Cristiano; Third Sector Design - Michael McAndrew; Timbsoft Technologies - Tunbola Ogunwande; Web Access - Kurund Jalmi; Wikimedia Foundation - Eileen McNaughton, Elliott Eggleston
+
+Most authors also reviewed code for this release; in addition, the following
+reviewers contributed their comments:
+
+a-n The Artists Information Company - William Mortada; AGH Strategies - Alice Frumin, Andrew Hunt; Agileware - Justin Freeman, Pengyi Zhang; Andrei Mondoc; Andrew Cormick-Dockery; Artful Robot - Rich Lott; borisson; British Humanist Association - Andrew West; Christian Wach; Circle Interactive - Pradeep Nayak; civibot[bot]; CiviCoop - Jaap Jansma; civicrm-builder; CiviCRM - Coleman Watts, Tim Otten; CiviDesk - Nicolas Ganivet, Yashodha Chaku; CompuCorp - Shitij Gugnani; Coop SymbioTIC - Mathieu Lutfy; Dave D; Electronic Frontier Foundation - Mark Burdett; Francesc Bassas i Bullich; Fuzion - Jitendra Purohit, Luke Stewart, Peter Davis; Greenpeace Central and Eastern Europe - Patrick Figel; JMA Consulting - Joe Murray, Monish Deb, Seamus Lee; John Kingsnorth; Joinery - Allen Shaw; Korlon - Stuart Gaston; Lighthouse Design and Consulting - Brian Shaughnessy; Megaphone Technology Consulting - Jon Goldberg; mikantchap; MJCO - Mikey O'Toole; MJW Consulting - Matthew Wire; Richard van Oosterhout; Squiffle Consulting - Aidan Saunders; SYSTOPIA Organisationsberatung - Björn Endres; Tadpole Collective - Kevin Cristiano; tapashdatta; Timbsoft Technologies - Tunbola Ogunwande; Wikimedia Foundation - Eileen McNaughton, Elliott Eggleston
+
+## <a name="feedback"></a>Feedback
+
+These release notes are edited by Alice Frumin and Andrew Hunt.  If you'd like
+to provide feedback on them, please log in to https://chat.civicrm.org/civicrm
+and contact `@agh1`.
index fb2170cc6ff4fa3e7e43b76730377b5e8030e55c..fe9175d8abceaae22142fb22c21a4a5e1425bf63 100644 (file)
@@ -32,6 +32,7 @@ return [
     'is_contact' => 0,
     'description' => ts('Is the CVV code required for back office credit card transactions'),
     'help_text' => 'If set it back-office credit card transactions will required a cvv code. Leave as required unless you have a very strong reason to change',
+    'settings_pages' => ['contribute' => ['weight' => 10]],
   ],
   'contribution_invoice_settings' => [
     // @todo our standard is to have a setting per item not to hide settings in an array with
@@ -70,6 +71,7 @@ return [
     'on_change' => [
       'CRM_Invoicing_Utils::onToggle',
     ],
+    'settings_pages' => ['contribute' => ['weight' => 90]],
   ],
   'credit_notes_prefix' => [
     'group_name' => 'Contribute Preferences',
@@ -85,6 +87,7 @@ return [
     'description' => ts('Prefix to be prepended to credit note ids'),
     'default' => 'CN_',
     'help_text' => ts('The credit note ID is generated when a contribution is set to Refunded, Cancelled or Chargeback. It is visible on invoices, if invoices are enabled'),
+    'settings_pages' => ['contribute' => ['weight' => 80]],
   ],
   'invoice_prefix' => [
     'html_type' => 'text',
@@ -176,6 +179,7 @@ return [
     'is_contact' => 0,
     'help_text' => NULL,
     'help' => ['id' => 'acl_financial_type'],
+    'settings_pages' => ['contribute' => ['weight' => 30]],
   ],
   'deferred_revenue_enabled' => [
     'group_name' => 'Contribute Preferences',
@@ -190,6 +194,7 @@ return [
     'is_domain' => 1,
     'is_contact' => 0,
     'help_text' => NULL,
+    'settings_pages' => ['contribute' => ['weight' => 50]],
   ],
   'default_invoice_page' => [
     'group_name' => 'Contribute Preferences',
@@ -208,6 +213,7 @@ return [
     'is_domain' => 1,
     'is_contact' => 0,
     'help_text' => NULL,
+    'settings_pages' => ['contribute' => ['weight' => 70]],
   ],
   'always_post_to_accounts_receivable' => [
     'group_name' => 'Contribute Preferences',
@@ -222,6 +228,7 @@ return [
     'is_domain' => 1,
     'is_contact' => 0,
     'help_text' => NULL,
+    'settings_pages' => ['contribute' => ['weight' => 40]],
   ],
   'update_contribution_on_membership_type_change' => [
     'group_name' => 'Contribute Preferences',
@@ -237,5 +244,6 @@ return [
     'is_contact' => 0,
     'description' => ts('Enabling this setting will update related contribution of membership(s) except if the membership is paid for with a recurring contribution.'),
     'help_text' => NULL,
+    'settings_pages' => ['contribute' => ['weight' => 20]],
   ],
 ];
index 0a921a6ec4b7f6546aa2c974646e3d9c94a84ad5..675349f222c138c1f35331d93135279a467aa435 100644 (file)
@@ -58,7 +58,6 @@ class CRM_Financial_BAO_PaymentProcessorTest extends CiviUnitTestCase {
     $liveProcessorID = $testProcessorID + 1;
 
     $processors = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors(['BackOffice', 'TestMode']);
-    $this->markTestIncomplete('Not working yet :-(');
     $this->assertEquals([$testProcessorID, 0], array_keys($processors), 'Only the test processor and the manual processor should be returned');
 
     $processors = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors(['BackOffice', 'TestMode'], [$liveProcessorID]);
@@ -72,7 +71,6 @@ class CRM_Financial_BAO_PaymentProcessorTest extends CiviUnitTestCase {
 
     $processors = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors(['BackOffice', 'LiveMode'], [$liveProcessorID]);
     $this->assertEquals([$liveProcessorID], array_keys($processors), 'Only the Live processor should be returned');
-
   }
 
 }
diff --git a/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch b/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch
deleted file mode 100644 (file)
index e55de1d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/tests/tutorial_examples.php b/tests/tutorial_examples.php
-index 3acadc3..06f1e71 100644
---- a/tests/tutorial_examples.php
-+++ b/tests/tutorial_examples.php
-@@ -1,5 +1,4 @@
- <?php
--declare(encoding="latin1");
- /**
-  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
-  * @version //autogentag//
-diff --git a/src/parser/interfaces/part_parser.php b/src/parser/interfaces/part_parser.php
-index a81378b..6c59e5a 100644
---- a/src/parser/interfaces/part_parser.php
-+++ b/src/parser/interfaces/part_parser.php
-@@ -168,7 +168,11 @@ abstract class ezcMailPartParser
-                 break;
-             case 'text':
--                if ( ezcMailPartParser::$parseTextAttachmentsAsFiles === true )
-+                // dev/core#940 Ensure that emails are not processed as .unknown attachments by checking
-+                // for Filename or name in the content-disposition and content-type headers.
-+                if ( (ezcMailPartParser::$parseTextAttachmentsAsFiles === true)                   &&
-+                     (preg_match('/\s*filename="?([^;"]*);?/i', $headers['Content-Disposition']) ||
-+                      preg_match( '/\s*name="?([^;"]*);?/i'   , $headers['Content-Type'])        )  )
-                 {
-                     $bodyParser = new ezcMailFileParser( $mainType, $subType, $headers );
-                 }
diff --git a/tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch b/tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch
deleted file mode 100644 (file)
index 47b211e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
---- src/Common/XMLReader.php   2019-02-24 13:35:42.895637978 +1100
-+++ src/Common/XMLReader.php   2019-02-24 11:41:29.462449569 +1100
-@@ -71,10 +71,11 @@
-      */
-     public function getDomFromString($content)
-     {
--        libxml_disable_entity_loader(true);
-+        $originalLibXMLEntityValue = libxml_disable_entity_loader(true);
-         $this->dom = new \DOMDocument();
-         $this->dom->loadXML($content);
--
-+        libxml_disable_entity_loader($originalLibXMLEntityValue);
-+
-         return $this->dom;
-     }
diff --git a/tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch b/tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch
deleted file mode 100644 (file)
index cc3673f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-From 27ee4bef48def2e3b966b6d5ff8cc8c56b1fac2c Mon Sep 17 00:00:00 2001
-From: Seamus Lee <seamuslee001@gmail.com>
-Date: Sun, 24 Feb 2019 09:06:51 +1100
-Subject: [PATCH] Ensure that entity_loader disable variable is re-set back to
- the original setting
-
----
- src/PhpWord/Shared/Html.php             | 2 ++
- src/PhpWord/TemplateProcessor.php       | 2 ++
- 3 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/src/PhpWord/Shared/Html.php b/src/PhpWord/Shared/Html.php
-index 89881822ca..f2710ea168 100644
---- a/src/PhpWord/Shared/Html.php
-+++ b/src/PhpWord/Shared/Html.php
-@@ -72,7 +72,7 @@ public static function addHtml($element, $html, $fullHTML = false, $preserveWhit
-         }
-         // Load DOM
--        libxml_disable_entity_loader(true);
-+        $orignalLibEntityLoader = libxml_disable_entity_loader(true);
-         $dom = new \DOMDocument();
-         $dom->preserveWhiteSpace = $preserveWhiteSpace;
-         $dom->loadXML($html);
-@@ -80,6 +80,7 @@ public static function addHtml($element, $html, $fullHTML = false, $preserveWhit
-         $node = $dom->getElementsByTagName('body');
-         self::parseNode($node->item(0), $element);
-+        libxml_disable_entity_loader($orignalLibEntityLoader);
-     }
-     /**
-diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php
-index 0f685bc45b..7efc0f1ac8 100644
---- a/src/PhpWord/TemplateProcessor.php
-+++ b/src/PhpWord/TemplateProcessor.php
-@@ -170,7 +170,7 @@ protected function readPartWithRels($fileName)
-      */
-     protected function transformSingleXml($xml, $xsltProcessor)
-     {
--        libxml_disable_entity_loader(true);
-+        $orignalLibEntityLoader = libxml_disable_entity_loader(true);
-         $domDocument = new \DOMDocument();
-         if (false === $domDocument->loadXML($xml)) {
-             throw new Exception('Could not load the given XML document.');
-@@ -180,6 +180,7 @@ protected function transformSingleXml($xml, $xsltProcessor)
-         if (false === $transformedXml) {
-             throw new Exception('Could not transform the given XML document.');
-         }
-+        libxml_disable_entity_loader($orignalLibEntityLoader);
-         return $transformedXml;
-     }