mobilpay / Magento

MAGENTO implementation - CARD Processing @mobilPay
11 stars 15 forks source link

Module for Magento 2.4 has a configuration issue #18

Closed shuffless closed 3 years ago

shuffless commented 3 years ago

Solving #17 by the solution given in the issue description will not render the module to work though.

Tested on M2.4.1 with PHP 7.3.

Upon further testing several sections of the backend will result in the following error that dissapears once $ bin/magento module:disable Netopia_Netcard is ran so the issue is triggered by the module.

I have reported this previously in #14 however the issue was dismissed due to the fact that the module was ran on M2.3.3. The symptoms were the same as the one given below.

Will test with a fresh new install of M2.4 and come back with a status.

1 exception(s):
Exception #0 (Exception): Notice: Undefined index: label in /home/489102.cloudwaysapps.com/vqpvkjmmdk/public_html/vendor/magento/framework/Data/Form/Element/Select.php on line 90

Exception #0 (Exception): Notice: Undefined index: label in /home/489102.cloudwaysapps.com/vqpvkjmmdk/public_html/vendor/magento/framework/Data/Form/Element/Select.php on line 90
<pre>#1 Magento\Framework\Data\Form\Element\Select->getElementHtml() called at [vendor/magento/module-config/Block/System/Config/Form/Field.php:51]
#2 Magento\Config\Block\System\Config\Form\Field->_getElementHtml(&Magento\Framework\Data\Form\Element\Select#000000004b3ac3f5000000001cc1c2ee#) called at [vendor/magento/module-config/Block/System/Config/Form/Field.php:104]
#3 Magento\Config\Block\System\Config\Form\Field->_renderValue(&Magento\Framework\Data\Form\Element\Select#000000004b3ac3f5000000001cc1c2ee#) called at [vendor/magento/module-config/Block/System/Config/Form/Field.php:78]
#4 Magento\Config\Block\System\Config\Form\Field->render(&Magento\Framework\Data\Form\Element\Select#000000004b3ac3f5000000001cc1c2ee#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#5 Magento\Config\Block\System\Config\Form\Field\Interceptor->___callParent('render', array(&Magento\Framework\Data\Form\Element\Select#000000004b3ac3f5000000001cc1c2ee#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#6 Magento\Config\Block\System\Config\Form\Field\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\Data\Form\Element\Select#000000004b3ac3f5000000001cc1c2ee#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#7 Magento\Config\Block\System\Config\Form\Field\Interceptor->___callPlugins('render', array(&Magento\Framework\Data\Form\Element\Select#000000004b3ac3f5000000001cc1c2ee#), array(array('Amasty_Base::rep...'))) called at [generated/code/Magento/Config/Block/System/Config/Form/Field/Interceptor.php:23]
#8 Magento\Config\Block\System\Config\Form\Field\Interceptor->render(&Magento\Framework\Data\Form\Element\Select#000000004b3ac3f5000000001cc1c2ee#) called at [vendor/magento/framework/Data/Form/Element/AbstractElement.php:543]
#9 Magento\Framework\Data\Form\Element\AbstractElement->getHtml() called at [vendor/magento/framework/Data/Form/Element/AbstractElement.php:557]
#10 Magento\Framework\Data\Form\Element\AbstractElement->toHtml() called at [vendor/magento/module-config/Block/System/Config/Form/Fieldset.php:98]
#11 Magento\Config\Block\System\Config\Form\Fieldset->_getChildrenElementsHtml(&Magento\Framework\Data\Form\Element\Fieldset#000000004b3ac3f1000000001cc1c2ee#) called at [vendor/magento/module-config/Block/System/Config/Form/Fieldset.php:76]
#12 Magento\Config\Block\System\Config\Form\Fieldset->render(&Magento\Framework\Data\Form\Element\Fieldset#000000004b3ac3f1000000001cc1c2ee#) called at [vendor/magento/framework/Data/Form/Element/AbstractElement.php:543]
#13 Magento\Framework\Data\Form\Element\AbstractElement->getHtml() called at [vendor/magento/framework/Data/Form/Element/AbstractElement.php:557]
#14 Magento\Framework\Data\Form\Element\AbstractElement->toHtml() called at [vendor/magento/framework/Data/Form.php:329]
#15 Magento\Framework\Data\Form->toHtml() called at [vendor/magento/framework/Data/Form.php:344]
#16 Magento\Framework\Data\Form->getHtml() called at [vendor/magento/module-backend/Block/Widget/Form.php:113]
#17 Magento\Backend\Block\Widget\Form->getFormHtml() called at [vendor/magento/module-backend/view/adminhtml/templates/widget/form.phtml:13]
#18 include('/home/489102.clo...') called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#19 Magento\Framework\View\TemplateEngine\Php->render(&Magento\Config\Block\System\Config\Form#000000004b3ac830000000001cc1c2ee#, '/home/489102.clo...', array('csp' => &Magento\Csp\Api\InlineUtilInterface\Proxy#000000004b3ac695000000001cc1c2ee#, 'secureRenderer' => &Magento\Framework\View\Helper\SecureHtmlRenderer\Proxy#000000004b3ac693000000001cc1c2ee#, 'escaper' => &Magento\Framework\Escaper#000000004b3accd9000000001cc1c2ee#)) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#20 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent('render', array(&Magento\Config\Block\System\Config\Form#000000004b3ac830000000001cc1c2ee#, '/home/489102.clo...', array('escaper' => &Magento\Framework\Escaper#000000004b3accd9000000001cc1c2ee#))) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#21 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Config\Block\System\Config\Form#000000004b3ac830000000001cc1c2ee#, '/home/489102.clo...', array()) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#22 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins('render', array(&Magento\Config\Block\System\Config\Form#000000004b3ac830000000001cc1c2ee#, '/home/489102.clo...', array()), array(array('Amasty_Base::Add...'))) called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:23]
#23 Magento\Framework\View\TemplateEngine\Php\Interceptor->render(&Magento\Config\Block\System\Config\Form#000000004b3ac830000000001cc1c2ee#, '/home/489102.clo...', array()) called at [vendor/magento/framework/View/Element/Template.php:273]
#24 Magento\Framework\View\Element\Template->fetchView('/home/489102.clo...') called at [vendor/magento/framework/View/Element/Template.php:303]
#25 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/module-backend/Block/Template.php:141]
#26 Magento\Backend\Block\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1111]
#27 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1115]
#28 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:675]
#29 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:566]
#30 Magento\Framework\View\Layout->_renderBlock('system\config\fo...') called at [vendor/magento/framework/View/Layout.php:542]
#31 Magento\Framework\View\Layout->renderNonCachedElement('system\config\fo...') called at [vendor/magento/framework/View/Layout.php:497]
#32 Magento\Framework\View\Layout->renderElement('system\config\fo...', true) called at [vendor/magento/framework/View/Element/AbstractBlock.php:522]
#33 Magento\Framework\View\Element\AbstractBlock->getChildHtml('form') called at [vendor/magento/module-config/view/adminhtml/templates/system/config/edit.phtml:32]
#34 include('/home/489102.clo...') called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#35 Magento\Framework\View\TemplateEngine\Php->render(&Magento\Config\Block\System\Config\Edit#000000004b3ac85c000000001cc1c2ee#, '/home/489102.clo...', array('csp' => &Magento\Csp\Api\InlineUtilInterface\Proxy#000000004b3ac695000000001cc1c2ee#, 'secureRenderer' => &Magento\Framework\View\Helper\SecureHtmlRenderer\Proxy#000000004b3ac693000000001cc1c2ee#, 'escaper' => &Magento\Framework\Escaper#000000004b3accd9000000001cc1c2ee#)) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#36 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent('render', array(&Magento\Config\Block\System\Config\Edit#000000004b3ac85c000000001cc1c2ee#, '/home/489102.clo...', array('escaper' => &Magento\Framework\Escaper#000000004b3accd9000000001cc1c2ee#))) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#37 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Config\Block\System\Config\Edit#000000004b3ac85c000000001cc1c2ee#, '/home/489102.clo...', array()) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#38 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins('render', array(&Magento\Config\Block\System\Config\Edit#000000004b3ac85c000000001cc1c2ee#, '/home/489102.clo...', array()), array(array('Amasty_Base::Add...'))) called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:23]
#39 Magento\Framework\View\TemplateEngine\Php\Interceptor->render(&Magento\Config\Block\System\Config\Edit#000000004b3ac85c000000001cc1c2ee#, '/home/489102.clo...', array()) called at [vendor/magento/framework/View/Element/Template.php:273]
#40 Magento\Framework\View\Element\Template->fetchView('/home/489102.clo...') called at [vendor/magento/framework/View/Element/Template.php:303]
#41 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/module-backend/Block/Template.php:141]
#42 Magento\Backend\Block\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1111]
#43 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1115]
#44 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:675]
#45 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:566]
#46 Magento\Framework\View\Layout->_renderBlock('system.config.ed...') called at [vendor/magento/framework/View/Layout.php:542]
#47 Magento\Framework\View\Layout->renderNonCachedElement('system.config.ed...') called at [vendor/magento/framework/View/Layout.php:497]
#48 Magento\Framework\View\Layout->renderElement('system.config.ed...', false) called at [vendor/magento/framework/View/Layout.php:594]
#49 Magento\Framework\View\Layout->_renderContainer('content', false) called at [vendor/magento/framework/View/Layout.php:544]
#50 Magento\Framework\View\Layout->renderNonCachedElement('content') called at [vendor/magento/framework/View/Layout.php:497]
#51 Magento\Framework\View\Layout->renderElement('content', false) called at [vendor/magento/framework/View/Layout.php:594]
#52 Magento\Framework\View\Layout->_renderContainer('admin.scope.col....', false) called at [vendor/magento/framework/View/Layout.php:544]
#53 Magento\Framework\View\Layout->renderNonCachedElement('admin.scope.col....') called at [vendor/magento/framework/View/Layout.php:497]
#54 Magento\Framework\View\Layout->renderElement('admin.scope.col....', false) called at [vendor/magento/framework/View/Layout.php:594]
#55 Magento\Framework\View\Layout->_renderContainer('main.col', false) called at [vendor/magento/framework/View/Layout.php:544]
#56 Magento\Framework\View\Layout->renderNonCachedElement('main.col') called at [vendor/magento/framework/View/Layout.php:497]
#57 Magento\Framework\View\Layout->renderElement('main.col', false) called at [vendor/magento/framework/View/Layout.php:594]
#58 Magento\Framework\View\Layout->_renderContainer('page.main.contai...', false) called at [vendor/magento/framework/View/Layout.php:544]
#59 Magento\Framework\View\Layout->renderNonCachedElement('page.main.contai...') called at [vendor/magento/framework/View/Layout.php:497]
#60 Magento\Framework\View\Layout->renderElement('page.main.contai...', false) called at [vendor/magento/framework/View/Layout.php:594]
#61 Magento\Framework\View\Layout->_renderContainer('page.content', false) called at [vendor/magento/framework/View/Layout.php:544]
#62 Magento\Framework\View\Layout->renderNonCachedElement('page.content') called at [vendor/magento/framework/View/Layout.php:497]
#63 Magento\Framework\View\Layout->renderElement('page.content', false) called at [vendor/magento/framework/View/Layout.php:594]
#64 Magento\Framework\View\Layout->_renderContainer('page.wrapper', false) called at [vendor/magento/framework/View/Layout.php:544]
#65 Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper') called at [vendor/magento/framework/View/Layout.php:497]
#66 Magento\Framework\View\Layout->renderElement('page.wrapper', false) called at [vendor/magento/framework/View/Layout.php:594]
#67 Magento\Framework\View\Layout->_renderContainer('backend.page', false) called at [vendor/magento/framework/View/Layout.php:544]
#68 Magento\Framework\View\Layout->renderNonCachedElement('backend.page') called at [vendor/magento/framework/View/Layout.php:497]
#69 Magento\Framework\View\Layout->renderElement('backend.page', false) called at [vendor/magento/framework/View/Layout.php:594]
#70 Magento\Framework\View\Layout->_renderContainer('root', false) called at [vendor/magento/framework/View/Layout.php:544]
#71 Magento\Framework\View\Layout->renderNonCachedElement('root') called at [vendor/magento/framework/View/Layout.php:497]
#72 Magento\Framework\View\Layout->renderElement('root') called at [vendor/magento/framework/View/Layout.php:963]
#73 Magento\Framework\View\Layout->getOutput() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:41]
#74 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:258]
#75 Magento\Framework\View\Result\Page->render(&Magento\Framework\App\Response\Http\Interceptor#000000004b3acf60000000001cc1c2ee#) called at [vendor/magento/framework/View/Result/Layout.php:171]
#76 Magento\Framework\View\Result\Layout->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000004b3acf60000000001cc1c2ee#) called at [generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php:23]
#77 Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000004b3acf60000000001cc1c2ee#) called at [vendor/magento/framework/App/Http.php:120]
#78 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#79 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000004b3acf62000000001cc1c2ee#) called at [index.php:39]
</pre>
shuffless commented 3 years ago

Tested now with a new deployment of M2.4.0 with sample data installed and PHP 7.4

The module seems to work well with the given setup. Will try to replicate the environment on the dev and come back with an update.

shuffless commented 3 years ago

The dev still does not work with the same kind of setup. Still investigating the issue.

shuffless commented 3 years ago

The issue is triggered at this point by the call of $this->escapeHtml($option['label'])

public function getHtml()
    {
        $html = '<select name="' . $this->_getHtmlName() . '" id="' . $this->_getHtmlId() . '"' . $this->getUiId(
            'filter',
            $this->_getHtmlName()
        ) . 'class="no-changes admin__control-select">';
        $value = $this->getValue();
        foreach ($this->_getOptions() as $option) {
            if (is_array($option['value'])) {
                $html .= '<optgroup label="' . $this->escapeHtml($option['label']) . '">';
                foreach ($option['value'] as $subOption) {
                    $html .= $this->_renderOption($subOption, $value);
                }
                $html .= '</optgroup>';
            } else {
                $html .= $this->_renderOption($option, $value);
            }
        }
        $html .= '</select>';
        return $html;
    }

The portion above is responsible for rendering the following dropdown:

drop

And specifically to the <optgroup label=""> code segment.

Disabling the module to compare it seems that the configuration is messing somehow with the big gruops of payments identified below

scr2

respectively this code

<optgroup label="Offline Payment Methods">

If we replace in the code the following portion

$html .= '<optgroup label="' . $this->escapeHtml($option['label']) . '">';

to this

$html .= '<optgroup label="label">';

We can see the Netopia CC method is placed under its own payment methods group that is not actually defined, hence the error.

scr3

shuffless commented 3 years ago

The issue is not affecting only the backend but also the front-end given the fact that the payment step is blocked in a loading state when a user goes to payment step

screen

shuffless commented 3 years ago

Tested now with a new deployment of M2.4.0 with sample data installed and PHP 7.4

The module seems to work well with the given setup. Will try to replicate the environment on the dev and come back with an update.

Tested again and the transactions tab does not appear in the order details, yet the error does not trigger on this page.

screenshot-magento-507585-1611230 cloudwaysapps com-2020 11 25-01_49_22

The transaction is present but the table is not displayed, therefore I cannot replicate the payment method filter from the other instance.

shuffless commented 3 years ago

Fixable by this pull https://github.com/mobilpay/Magento/pull/19/files

navid59 commented 3 years ago

Dear Shuffless

First of all thank you for using our Magento Module & testing it so well ;-) Sorry , for late answering you . I just see you already solved your problem. Yes , exactly was missing payment.xml Please, update the git, because, group ID is changed

We going to check other issue .