From a240692a9b5a00076d7b6d97ea0b5e3185d5387e Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 18 Jun 2020 18:24:53 +1000 Subject: [PATCH 1/1] [REF] Patch electrolinux/phpquery and also core files to fix using {} when doing array or string access when it should be [] --- CRM/Report/Form/Contribute/Summary.php | 2 +- Civi/Angular/ChangeSet.php | 2 +- composer.json | 3 +++ composer.lock | 10 ++++++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index ea28427be4..79465208aa 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -354,7 +354,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { $fy = $config->fiscalYearStart; $fiscal = self::fiscalYearOffset($field['dbAlias']); - $select[] = "DATE_ADD(MAKEDATE({$fiscal}, 1), INTERVAL ({$fy{'M'}})-1 MONTH) AS {$tableName}_{$fieldName}_start"; + $select[] = "DATE_ADD(MAKEDATE({$fiscal}, 1), INTERVAL ({$fy['M']})-1 MONTH) AS {$tableName}_{$fieldName}_start"; $select[] = "{$fiscal} AS {$tableName}_{$fieldName}_subtotal"; $select[] = "{$fiscal} AS {$tableName}_{$fieldName}_interval"; $field['title'] = ts('Fiscal Year Beginning'); diff --git a/Civi/Angular/ChangeSet.php b/Civi/Angular/ChangeSet.php index 27c92a5867..fc5d9b08c9 100644 --- a/Civi/Angular/ChangeSet.php +++ b/Civi/Angular/ChangeSet.php @@ -150,7 +150,7 @@ class ChangeSet implements ChangeSetInterface { */ public function alterHtml($file, $callback) { $this->htmlFilters[] = [ - 'regex' => ($file{0} === ';') ? $file : $this->createRegex($file), + 'regex' => ($file[0] === ';') ? $file : $this->createRegex($file), 'callback' => $callback, ]; return $this; diff --git a/composer.json b/composer.json index e2fc32f8fd..fc89c367c7 100644 --- a/composer.json +++ b/composer.json @@ -242,6 +242,9 @@ "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" }, + "electrolinux/phpquery": { + "PHP7.4 Fix for array access using {} instead of []": "https://raw.githubusercontent.com/civicrm/civicrm-core/fe45bdfc4f3e3d3deb27e3d853cdbc7f616620a9/tools/scripts/composer/patches/php74_array_access_fix_phpquery.patch" + }, "pear/mail": { "Apply CiviCRM Customisations for CRM-1367 and CRM-5946": "https://raw.githubusercontent.com/civicrm/civicrm-core/36319938a5bf26c1e7e2110a26a65db6a5979268/tools/scripts/composer/patches/pear-mail.patch" }, diff --git a/composer.lock b/composer.lock index bfcbff172d..a226475702 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3c6d377d0dfd5ce11b0a96af56344181", + "content-hash": "96209031150a0c16ca42aeb4422abe56", "packages": [ { "name": "adrienrn/php-mimetyper", @@ -431,6 +431,11 @@ "shasum": "" }, "type": "library", + "extra": { + "patches_applied": { + "PHP7.4 Fix for array access using {} instead of []": "https://raw.githubusercontent.com/civicrm/civicrm-core/fe45bdfc4f3e3d3deb27e3d853cdbc7f616620a9/tools/scripts/composer/patches/php74_array_access_fix_phpquery.patch" + } + }, "autoload": { "classmap": [ "phpQuery/" @@ -3061,5 +3066,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.1" - } + }, + "plugin-api-version": "1.1.0" } -- 2.25.1