-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Issue: needs updateAdditional information is require, waiting for responseAdditional information is require, waiting for responseReported on 2.4.6-p10Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.
Description
Preconditions and environment
We've noticed this is a problem, likely only on 2.4.6 and below as the 2.4-develop sorted it. We've never got that via composer though. Patch below.
Saves you having to create a plugin or edit the line every patch install on affected versions.
Marked as S1 severity as the client could no longer create any cart price sales rules.
Environment
- v2.4.6-p10
- PHP v8.1
- MariaDB v10.5
- ElasticSearch v7.17
- Debian GNU/Linux 11 (bullseye), Linux 5.10.0-33-cloud-amd64
Steps to reproduce
- Marketing > Cart Price Rules
- Create a blank rule, don't check "Apply to Shipping Amount"
- Save the rule
- The WSOD will show and the following exception will be logged
main.CRITICAL: Exception: Warning: Undefined array key "simple_free_shipping" in <mnt_path>/public_html/vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php on line 67 in <mnt_path>/public_html/vendor/magento/framework/App/ErrorHandler.php:62
Stack trace:
#0 <mnt_path>/public_html/vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php(67): Magento\Framework\App\ErrorHandler->handler()
#1 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save->execute()
#2 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->___callParent()
#3 <mnt_path>/public_html/vendor/meta/module-business-extension/Plugin/LoggingPluginBase.php(137): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->Magento\Framework\Interception\{closure}()
#4 <mnt_path>/public_html/vendor/meta/module-business-extension/Plugin/LoggingPluginBase.php(85): Meta\BusinessExtension\Plugin\LoggingPluginBase->wrapCallableWithLogging()
#5 <mnt_path>/public_html/vendor/meta/module-business-extension/Plugin/LoggingActionPlugin.php(45): Meta\BusinessExtension\Plugin\LoggingPluginBase->wrapCallableWithErrorAndImpressionLogging()
#6 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Meta\BusinessExtension\Plugin\LoggingActionPlugin->aroundExecute()
#7 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->Magento\Framework\Interception\{closure}()
#8 <mnt_path>/public_html/generated/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save/Interceptor.php(23): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->___callPlugins()
#9 <mnt_path>/public_html/vendor/magento/framework/App/Action/Action.php(111): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->execute()
#10 <mnt_path>/public_html/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#11 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#12 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->___callParent()
#13 <mnt_path>/public_html/app/code/WeltPixel/Backend/Plugin/Utility.php(76): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->Magento\Framework\Interception\{closure}()
#14 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(135): WeltPixel\Backend\Plugin\Utility->aroundDispatch()
#15 <mnt_path>/public_html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->Magento\Framework\Interception\{closure}()
#16 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()
#17 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->Magento\Framework\Interception\{closure}()
#18 <mnt_path>/public_html/generated/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save/Interceptor.php(32): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->___callPlugins()
#19 <mnt_path>/public_html/vendor/magento/framework/App/FrontController.php(245): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save\Interceptor->dispatch()
#20 <mnt_path>/public_html/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#21 <mnt_path>/public_html/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#22 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#23 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#24 <mnt_path>/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#25 <mnt_path>/public_html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#26 <mnt_path>/public_html/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#27 <mnt_path>/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#28 <mnt_path>/public_html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#29 <mnt_path>/public_html/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#30 {main} {"report_id":"89c61a7fb8a29743074bb5d254220de33d132809d6da7fe2140b4ff8bb13c6d3","exception":"[object] (Exception(code: 0): Warning: Undefined array key \"simple_free_shipping\" in <mnt_path>/public_html/vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php on line 67 at <mnt_path>/public_html/vendor/magento/framework/App/ErrorHandler.php:62)"} []
Expected result
The rule is saved successfully.
Actual result
The rule is not saved successfully and a WSOD is shown.
Additional information
Fix
How to Apply
Patch via Composer
20250417-Magento-SalesRule-Controller-Adminhtml-Promo-Quote.patch
From: Ross Parachute <foo@bar.com>
Date: Thu, 17 Apr 2025 10:49:52 +0000
Subject: [PATCH] Magento/SalesRule/Controller/Adminhtml/Promo/Quote
/Save.php::L67 null coalesce ternary fix
---
.../module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php b/vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php
index e407142..aefadd0 100644
--- a/vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php
+++ b/vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php
@@ -64,7 +64,7 @@ class Save extends \Magento\SalesRule\Controller\Adminhtml\Promo\Quote implement
{
$data = $this->getRequest()->getPostValue();
if ($data) {
- $data['simple_free_shipping'] = ($data['simple_free_shipping'] === '')
+ $data['simple_free_shipping'] = (($data['simple_free_shipping'] ?? '') === '')
? null : $data['simple_free_shipping'];
try {
--
2.30.2
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Issue: needs updateAdditional information is require, waiting for responseAdditional information is require, waiting for responseReported on 2.4.6-p10Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.