From 612cb73828c5597e4d1675945c8aa40270388389 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Thu, 19 Dec 2024 03:57:19 +0100 Subject: [PATCH 1/5] merged workflows (#4416) --- .github/workflows/phpcs.yml | 12 +--- .phpcs.dist.php.xml | 76 -------------------------- .phpcs.dist.ecg.xml => .phpcs.dist.xml | 64 +++++++++++++++++++++- .phpcs.xml | 5 -- 4 files changed, 65 insertions(+), 92 deletions(-) delete mode 100644 .phpcs.dist.php.xml rename .phpcs.dist.ecg.xml => .phpcs.dist.xml (63%) delete mode 100644 .phpcs.xml diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index 580bc27aad5..669c4276c7c 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -7,17 +7,9 @@ on: jobs: phpcs: - name: ${{ matrix.rules.label }} + name: Validation runs-on: [ubuntu-latest] - strategy: - matrix: - rules: - - label: Ecg - path: .phpcs.dist.ecg.xml - - label: PhpCompatibility - path: .phpcs.dist.php.xml - steps: - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -42,4 +34,4 @@ jobs: run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-* - name: PHPCodeSniffer - run: php vendor/bin/phpcs -s -p --report=full --standard=${{ matrix.rules.path }} + run: php vendor/bin/phpcs -s -p --report=full --standard=.phpcs.dist.xml diff --git a/.phpcs.dist.php.xml b/.phpcs.dist.php.xml deleted file mode 100644 index 13a31978800..00000000000 --- a/.phpcs.dist.php.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - api.php - cron.php - get.php - index.php - install.php - app/Mage.php - app/code/core/Mage/ - errors/ - lib/Mage/ - lib/Magento/ - lib/Varien/ - shell/ - tests/unit/ - - - */Varien/Object.php* - */Varien/Data/Form/Abstract.php* - */Varien/Db/Tree.php* - */Varien/Directory/Collection.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Varien/Crypt/Mcrypt.php* - - - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - - */Magento/Crypt.php* - */Varien/Crypt/Mcrypt.php* - - diff --git a/.phpcs.dist.ecg.xml b/.phpcs.dist.xml similarity index 63% rename from .phpcs.dist.ecg.xml rename to .phpcs.dist.xml index 36665bd7db4..615f2fd5c55 100644 --- a/.phpcs.dist.ecg.xml +++ b/.phpcs.dist.xml @@ -1,5 +1,5 @@ - + api.php cron.php get.php @@ -12,6 +12,7 @@ lib/Magento/ lib/Varien/ shell/ + tests/unit/ */core/Mage/*/data/* */core/Mage/*/sql/* @@ -143,4 +144,65 @@ + + + + */Varien/Object.php* + */Varien/Data/Form/Abstract.php* + */Varien/Db/Tree.php* + */Varien/Directory/Collection.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Varien/Crypt/Mcrypt.php* + + + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + + + */Magento/Crypt.php* + */Varien/Crypt/Mcrypt.php* + diff --git a/.phpcs.xml b/.phpcs.xml deleted file mode 100644 index c3e7a9cb330..00000000000 --- a/.phpcs.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - From 5dbb4322b0c4a514595f4ae0b1c8a1db06050064 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Thu, 19 Dec 2024 04:12:18 +0100 Subject: [PATCH 2/5] fixed badges (#4413) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e81d7c212ef..4333b565b2c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ [![All Contributors](https://img.shields.io/github/all-contributors/openmage/magento-lts?color=ee8449)](#contributors) -[![Version](http://poser.pugx.org/openmage/magento-lts/version)](https://packagist.org/packages/openmage/magento-lts) ![https://packagist.org/packages/openmage/magento-lts](https://poser.pugx.org/openmage/magento-lts/license.svg) ![https://packagist.org/packages/openmage/magento-lts](https://poser.pugx.org/openmage/magento-lts/d/total.svg) ![https://github.com/openmage/magento-lts/actions/workflows/security-php.yml](https://github.com/openmage/magento-lts/actions/workflows/security-php.yml/badge.svg) From 360dcd587fe9c7b017826d4ac3b8ba97a489b674 Mon Sep 17 00:00:00 2001 From: Hans Mackowiak Date: Thu, 19 Dec 2024 08:51:47 +0100 Subject: [PATCH 3/5] [Tax] add FK to tax/sales_order_tax again (#4334) * add FK to tax/sales_order_tax again * ~ fix codestyle * Update upgrade-1.6.0.4-1.6.0.5.php Use purge option --- app/code/core/Mage/Tax/etc/config.xml | 2 +- .../sql/tax_setup/upgrade-1.6.0.4-1.6.0.5.php | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.4-1.6.0.5.php diff --git a/app/code/core/Mage/Tax/etc/config.xml b/app/code/core/Mage/Tax/etc/config.xml index 6d673ed8d34..1ef4fcfbd76 100644 --- a/app/code/core/Mage/Tax/etc/config.xml +++ b/app/code/core/Mage/Tax/etc/config.xml @@ -17,7 +17,7 @@ - 1.6.0.4 + 1.6.0.5 diff --git a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.4-1.6.0.5.php b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.4-1.6.0.5.php new file mode 100644 index 00000000000..72e4c3e3906 --- /dev/null +++ b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.4-1.6.0.5.php @@ -0,0 +1,35 @@ +startSetup(); + +$taxTable = $this->getTable('tax/sales_order_tax'); +$orderTable = $this->getTable('sales/order'); + +// adds FK_SALES_ORDER_TAX_ORDER back again +$this->getConnection()->addForeignKey( + $this->getFkName($taxTable, 'order_id', $orderTable, 'entity_id'), + $taxTable, + 'order_id', + $orderTable, + 'entity_id', + Varien_Db_Adapter_Interface::FK_ACTION_CASCADE, + Varien_Db_Adapter_Interface::FK_ACTION_CASCADE, + true +); + +$this->endSetup(); From c9a901f392326e7d76d10fbc17693a83915edbe0 Mon Sep 17 00:00:00 2001 From: Hans Mackowiak Date: Thu, 19 Dec 2024 08:52:52 +0100 Subject: [PATCH 4/5] Fix Possible Array Access warnings in Captcha Observer (#4424) --- app/code/core/Mage/Captcha/Model/Observer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Captcha/Model/Observer.php b/app/code/core/Mage/Captcha/Model/Observer.php index 6e122069a02..57b302cc680 100644 --- a/app/code/core/Mage/Captcha/Model/Observer.php +++ b/app/code/core/Mage/Captcha/Model/Observer.php @@ -274,7 +274,7 @@ protected function _resetAttempt($login) protected function _getCaptchaString($request, $formId) { $captchaParams = $request->getPost(Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE); - return $captchaParams[$formId]; + return $captchaParams[$formId] ?? ''; } /** From 2c80954025fc89fba9af52f9013d5219166e2a31 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Thu, 19 Dec 2024 17:22:58 +0800 Subject: [PATCH 5/5] Fixed null deprecation array_keys in Multishipping. (#4418) * Fixed null deprecation array_keys in Multishipping. * Update app/code/core/Mage/Core/Model/Session.php Co-authored-by: Sven Reichel --------- Co-authored-by: Sven Reichel --- app/code/core/Mage/Core/Model/Session.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/core/Mage/Core/Model/Session.php b/app/code/core/Mage/Core/Model/Session.php index 12de2773424..e6b245a2830 100644 --- a/app/code/core/Mage/Core/Model/Session.php +++ b/app/code/core/Mage/Core/Model/Session.php @@ -28,7 +28,6 @@ * @method $this setCurrencyCode(string $value) * @method $this setFormData(array $value) * @method int getJustVotedPoll() - * @method array getOrderIds() * @method $this setOrderIds(array $value) * @method $this setJustVotedPoll(int $value) * @method $this setLastUrl(string $value) @@ -75,4 +74,9 @@ public function validateFormKey($formKey) { return ($formKey === $this->getFormKey()); } + + public function getOrderIds(bool $clear = false): array + { + return $this->getData('order_ids', $clear) ?? []; + } }