Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: RemovePasswordAndUserConfirmationFormFieldsPlugin::afterGetForm(): Argument #2 ($result) must be of type Magento\Framework\Data\Form, null given #36145

Closed
1 of 5 tasks
mohammedTBB opened this issue Sep 15, 2022 · 10 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.5 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@mohammedTBB
Copy link

Preconditions and environment

Magento v2.4.5
php v8.1
amasty/module-xcoupon v1.1.16

Steps to reproduce

1- Go to admin panel
2- Marketing
3-cart price rules
4-add new rule

Expected result

should open the form of creating a new rule without error.

Actual result

[2022-09-12T14:57:29.735745+00:00] main.CRITICAL: TypeError: Magento\AdminAdobeIms\Plugin\RemovePasswordAndUserConfirmationFormFieldsPlugin::afterGetForm(): Argument #2 ($result) must be of type Magento\Framework\Data\Form, null given, called in /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php on line 146 and defined in /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-admin-adobe-ims/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php:39

Stack trace:
#0 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(146): Magento\AdminAdobeIms\Plugin\RemovePasswordAndUserConfirmationFormFieldsPlugin->afterGetForm()
#1 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(153): Amasty\Xcoupon\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Import\Interceptor->Magento\Framework\Interception{closure}()
#2 /var/www/clients/client1/web5/web/releases/38/generated/code/Amasty/Xcoupon/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Import/Interceptor.php(23): Amasty\Xcoupon\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Import\Interceptor->___callPlugins()
#3 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-backend/Block/Widget/Form.php(112): Amasty\Xcoupon\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Import\Interceptor->getForm()
#4 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-backend/view/adminhtml/templates/widget/form.phtml(13): Magento\Backend\Block\Widget\Form->getFormHtml()
#5 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('...')
#6 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()
#7 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()
#8 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception{closure}()
#9 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()
#10 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()
#11 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#12 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-backend/Block/Template.php(141): Magento\Framework\View\Element\Template->_toHtml()
#13 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Backend\Block\Template->_toHtml()
#14 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}()
#15 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#16 /var/www/clients/client1/web5/web/releases/38/generated/code/Amasty/Xcoupon/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Import/Interceptor.php(32): Magento\Framework\View\Element\AbstractBlock->toHtml()
#17 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(578): Amasty\Xcoupon\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Import\Interceptor->toHtml()
#18 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock()
#19 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#20 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(507): Magento\Framework\View\Layout->renderElement()
#21 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Element\AbstractBlock->getChildHtml()
#22 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(138): Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Interceptor->___callParent()
#23 /var/www/clients/client1/web5/web/releases/38/vendor/amasty/module-xcoupon/Plugin/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php(31): Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Interceptor->Magento\Framework\Interception{closure}()
#24 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(135): Amasty\Xcoupon\Plugin\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons->aroundGetChildHtml()
#25 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(153): Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Interceptor->Magento\Framework\Interception{closure}()
#26 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Interceptor.php(23): Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Interceptor->___callPlugins()
#27 /var/www/clients/client1/web5/web/releases/38/vendor/amasty/module-xcoupon/Plugin/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php(35): Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Interceptor->getChildHtml()
#28 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(135): Amasty\Xcoupon\Plugin\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons->aroundGetChildHtml()
#29 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(153): Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Interceptor->Magento\Framework\Interception{closure}()
#30 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Interceptor.php(23): Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Interceptor->___callPlugins()
#31 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-sales-rule/view/adminhtml/templates/tab/coupons.phtml(8): Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Interceptor->getChildHtml()
#32 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('...')
#33 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()
#34 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()
#35 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception{closure}()
#36 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()
#37 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()
#38 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#39 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Framework\View\Element\Template->_toHtml()
#40 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}()
#41 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#42 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Interceptor.php(32): Magento\Framework\View\Element\AbstractBlock->toHtml()
#43 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-ui/Component/HtmlContent.php(76): Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Interceptor->toHtml()
#44 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout/Generic.php(116): Magento\Ui\Component\HtmlContent->getConfiguration()
#45 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout/Generic.php(112): Magento\Framework\View\Layout\Generic->addChildren()
#46 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout/Generic.php(112): Magento\Framework\View\Layout\Generic->addChildren()
#47 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout/Generic.php(74): Magento\Framework\View\Layout\Generic->addChildren()
#48 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout/Generator/Structure.php(46): Magento\Framework\View\Layout\Generic->build()
#49 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-ui/TemplateEngine/Xhtml/Result.php(102): Magento\Framework\View\Layout\Generator\Structure->generate()
#50 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-ui/TemplateEngine/Xhtml/Result.php(124): Magento\Ui\TemplateEngine\Xhtml\Result->appendLayoutConfiguration()
#51 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-ui/Component/Wrapper/UiComponent.php(73): Magento\Ui\TemplateEngine\Xhtml\Result->__toString()
#52 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Ui\Component\Wrapper\UiComponent->_toHtml()
#53 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}()
#54 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#55 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/Ui/Component/Wrapper/UiComponent/Interceptor.php(23): Magento\Framework\View\Element\AbstractBlock->toHtml()
#56 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(591): Magento\Ui\Component\Wrapper\UiComponent\Interceptor->toHtml()
#57 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(553): Magento\Framework\View\Layout->_renderUiComponent()
#58 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#59 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#60 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#61 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#62 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#63 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#64 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#65 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#66 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#67 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#68 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#69 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#70 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#71 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#72 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#73 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#74 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#75 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#76 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#77 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#78 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#79 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#80 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#81 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#82 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#83 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Layout.php(975): Magento\Framework\View\Layout->renderElement()
#84 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/Framework/View/Layout/Interceptor.php(41): Magento\Framework\View\Layout->getOutput()
#85 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Result/Page.php(260): Magento\Framework\View\Layout\Interceptor->getOutput()
#86 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render()
#87 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(32): Magento\Framework\View\Result\Layout->renderResult()
#88 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/App/View.php(221): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult()
#89 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Edit.php(85): Magento\Framework\App\View->renderLayout()
#90 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(58): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit->execute()
#91 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(138): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit\Interceptor->___callParent()
#92 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(153): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit\Interceptor->Magento\Framework\Interception{closure}()
#93 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Edit/Interceptor.php(23): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit\Interceptor->___callPlugins()
#94 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/App/Action/Action.php(111): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit\Interceptor->execute()
#95 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#96 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#97 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(138): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit\Interceptor->___callParent()
#98 /var/www/clients/client1/web5/web/releases/38/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit\Interceptor->Magento\Framework\Interception{closure}()
#99 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()
#100 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(153): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit\Interceptor->Magento\Framework\Interception{closure}()
#101 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Edit/Interceptor.php(32): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit\Interceptor->___callPlugins()
#102 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/App/FrontController.php(245): Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Edit\Interceptor->dispatch()
#103 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#104 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#105 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#106 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#107 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}()
#108 /var/www/clients/client1/web5/web/releases/38/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#109 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#110 /var/www/clients/client1/web5/web/releases/38/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#111 /var/www/clients/client1/web5/web/releases/38/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#112 {main} [] []

Additional information

Possible Solution:

diff --git a/vendor/magento/module-admin-adobe-ims/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php b/vendor/magento/module-admin-adobe-ims/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php
index dd5ad60..63fed9e 100644
--- a/vendor/magento/module-admin-adobe-ims/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php
+++ b/vendor/magento/module-admin-adobe-ims/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php
@@ -36,7 +36,7 @@ class RemovePasswordAndUserConfirmationFormFieldsPlugin
      * @SuppressWarnings(PHPMD.CyclomaticComplexity)
      * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
-    public function afterGetForm(WidgetForm $subject, DataForm $result): DataForm
+    public function afterGetForm(WidgetForm $subject, DataForm|null $result): DataForm|null
     {
         if ($this->adminImsConfig->enabled() === false) {
             return $result;

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”.
@m2-assistant
Copy link

m2-assistant bot commented Sep 15, 2022

Hi @mohammedTBB. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@engcom-Hotel engcom-Hotel added Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it Reported on 2.4.5 Indicates original Magento version for the Issue report. labels Sep 15, 2022
@engcom-Hotel engcom-Hotel self-assigned this Sep 16, 2022
@m2-assistant
Copy link

m2-assistant bot commented Sep 16, 2022

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

Hello @mohammedTBB,

Thanks for the report and collaboration!

We have tried to reproduce the issue in Magento 2.4-develop branch but it is not reproducible for us. Can you please confirm if this issue can be reproducible without amasty/module-xcoupon v1.1.16 because this is the third-party module and not maintained by Magento?

Also, we have checked the plugin mentioned in the main description i.e.:

public function afterGetForm(WidgetForm $subject, DataForm $result): DataForm
{
if ($this->adminImsConfig->enabled() === false) {
return $result;
}
if ($result->getElement('base_fieldset')) {
foreach ($result->getElement('base_fieldset')->getElements() as $element) {

Which is created on:

public function getForm()
{
return $this->_form;
}

The above function is returning the object of type \Magento\Framework\Data\Form, so as the plugin.

And also you can also let us know your use case in which this plugin can return null.

Thanks

@engcom-Hotel engcom-Hotel added the Issue: needs update Additional information is require, waiting for response label Sep 16, 2022
@mohammedTBB
Copy link
Author

Hello @engcom-Hotel

the error is not reproducible without the plugin amasty/module-xcoupon v1.1.16

In all cases, whenever you try to add new cart rule, the plugin return null.

@engcom-Hotel
Copy link
Contributor

Hello @mohammedTBB,

Thanks for the reply!

In that case, I would like to suggest you connect with the developers of amasty/module-xcoupon v1.1.16 for this issue. As this module is not maintained by Magento, you need to connect with them.

Thanks

@dongyi-chun
Copy link

I have a same issue with different extension(Mageplaza_RequestForQuote).
But it is good to solved as @mohammedTBB suggested.

@engcom-Hotel
Copy link
Contributor

Hello @dongyi-chun,

Thanks for the report!

As I mentioned earlier also that amasty/module-xcoupon and Mageplaza_RequestForQuote are not maintained by Magento. But still, I need to ask you in which scenario/use case this plugin can return null.

This will help in identifying if this issue is related to Magento or some third-party extensions.

Thanks

@mohammedTBB
Copy link
Author

Hi @dongyi-chun

I have managed to fix the error by applying a patch from Amasty for the plugin coupons.
Hope it helps!

Plus Consider updating the plugin, this patch may be included in the last version.

#====================================================================================================================================================#
#                This is a patch file. You can apply it using "patch -p2 < diff.patch" or revert it using "patch -R -p2 < diff.patch"                #
#                                                        (c) Created by Amasty Team 19-09-2022                                                       #
#====================================================================================================================================================#
diff --git a/vendor/amasty/module-xcoupon/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php b/vendor/amasty/module-xcoupon/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php
index e69de29..4daae37 100644
--- a/vendor/amasty/module-xcoupon/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php
+++ b/vendor/amasty/module-xcoupon/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+declare(strict_types=1);
+
+namespace Amasty\Xcoupon\Plugin;
+
+use Magento\AdminAdobeIms\Service\ImsConfig;
+use Magento\Backend\Block\Widget\Form as WidgetForm;
+use Magento\Framework\Data\Form as DataForm;
+
+class RemovePasswordAndUserConfirmationFormFieldsPlugin
+{
+    /**
+     * @var ImsConfig
+     */
+    private ImsConfig $adminImsConfig;
+
+    /**
+     * @param ImsConfig $adminImsConfig
+     */
+    public function __construct(ImsConfig $adminImsConfig)
+    {
+        $this->adminImsConfig = $adminImsConfig;
+    }
+
+    /**
+     * Remove user password and confirmation field and hide the user verification fieldset
+     *
+     * @param WidgetForm $subject
+     * @param DataForm $result
+     * @return DataForm
+     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+     */
+    public function afterGetForm(WidgetForm $subject, ?DataForm $result): ?DataForm
+    {
+        if ($this->adminImsConfig->enabled() === false) {
+            return $result;
+        }
+
+        if ($result->getElement('base_fieldset')) {
+            foreach ($result->getElement('base_fieldset')->getElements() as $element) {
+                if ($element->getId() === 'email') {
+                    $element->setData('note', __('Use the same email user has in Adobe IMS organization.'));
+                }
+                if ($element->getId() === 'password') {
+                    $result->getElement('base_fieldset')->removeField($element->getId());
+                }
+
+                if ($element->getId() === 'confirmation') {
+                    $result->getElement('base_fieldset')->removeField($element->getId());
+                }
+            }
+        }
+
+        if ($result->getElement('current_user_verification_fieldset')) {
+            foreach ($result->getElement('current_user_verification_fieldset')->getElements() as $element) {
+                if ($element->getId() === 'current_password') {
+                    $element->setType('hidden');
+                    $element->setClass('');
+
+                    /**
+                     * We can set the value to "randomPassword", because it must just pass the input validation rules
+                     *  we also don't use this value anymore and also don't save this anywhere
+                     *  because we are using the access_token for the verification and not the current user password
+                     */
+                    $element->setData('value', 'randomPassword');
+                }
+            }
+        }
+
+        return $result;
+    }
+}
\ No newline at end of file
diff --git a/vendor/amasty/module-xcoupon/etc/adminhtml/di.xml b/vendor/amasty/module-xcoupon/etc/adminhtml/di.xml
index ef743d9..0823dbf 100644
--- a/vendor/amasty/module-xcoupon/etc/adminhtml/di.xml
+++ b/vendor/amasty/module-xcoupon/etc/adminhtml/di.xml
@@ -26,6 +26,13 @@
                 type="Amasty\Xcoupon\Plugin\SalesRule\ResourceModel\Coupon" />
     </type>
 
+    <type name="Magento\Backend\Block\Widget\Form">
+        <plugin name="remove_password_and_user_confirmation_form_fields"
+                type="Magento\AdminAdobeIms\Plugin\RemovePasswordAndUserConfirmationFormFieldsPlugin" disabled="true"/>
+        <plugin name="remove_password_and_user_confirmation_form_fields"
+                type="Amasty\Xcoupon\Plugin\RemovePasswordAndUserConfirmationFormFieldsPlugin" />
+    </type>
+
     <preference for="Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid"
                 type="Amasty\Xcoupon\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Grid"/>
 </config>

@dongyi-chun
Copy link

Basically this is originated by latest PHP's null param issue.
So, I've workaround by creating a null check in Form class which was just empty.

use Magento\Backend\Block\Widget\Form\Generic;

/**
 * Class Form
 * @package Mageplaza\RequestForQuote\Block\Adminhtml\Requests\Edit
 */
class Form extends Generic
{
    public function getForm()
    {
        if ($this->_form == null) {
            return $this->_formFactory->create();
        } else {
            return $this->_form;
        }
    }
}

FYI, Mageplaza's support is not good, they are not interested about version compatibility issues. :(

@engcom-Hotel
Copy link
Contributor

Hello @mohammedTBB @dongyi-chun,

Can we close this issue now? or we can remain open for more discussion. Please suggest.

Thanks

matteorossi-thespacesm added a commit to matteorossi-thespacesm/magento2-extension that referenced this issue Mar 24, 2023
Added override of \Magento\Backend\Block\Widget\Form method getForm to resolve Error: "RemovePasswordAndUserConfirmationFormFieldsPlugin::afterGetForm(): Argument m2epro#2 ($result) must be of type Magento\Framework\Data\Form, null" in magento 2.4.5, as addressed in magento/magento2#36145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.5 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

No branches or pull requests

3 participants