hyva-themes / magento2-hyva-admin

This module aims to make creating grids and forms in the Magento 2 adminhtml area joyful and fast.
https://hyva-themes.github.io/magento2-hyva-admin/
BSD 3-Clause "New" or "Revised" License
168 stars 39 forks source link

Notice: Undefined variable: secureRenderer in #28

Closed navinbhudiya closed 3 years ago

navinbhudiya commented 3 years ago

I have installed the magento2-hyva-admin.

Update my product grid xml like vendor/magento/module-catalog/view/adminhtml/layout/catalog_product_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="hyva_admin_grid"/>
    <body>
        <referenceBlock name="menu">
            <action method="setActive">
                <argument name="itemId" xsi:type="string">Magento_Catalog::catalog_products</argument>
            </action>
        </referenceBlock>
        <referenceBlock name="page.title">
            <action method="setTitleClass">
                <argument name="class" xsi:type="string">complex</argument>
            </action>
        </referenceBlock>
        <referenceContainer name="content">
            <uiComponent name="product_listing"/>
            <block class="Magento\Catalog\Block\Adminhtml\Product" name="products_list"/>
        </referenceContainer>
    </body>
</page>

Getting error like this

exception(s): Exception #0 (Exception): Notice: Undefined variable: secureRenderer in pub/developer/app/code/Hyva/Admin/view/adminhtml/templates/page/js/require_js.phtml on line 16

Exception #0 (Exception): Notice: Undefined variable: secureRenderer in pub/developer/app/code/Hyva/Admin/view/adminhtml/templates/page/js/require_js.phtml on line 16

#1 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#2 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#3 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#4 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#5 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:26]
#6 Magento\Framework\View\TemplateEngine\Php\Interceptor->render() called at [vendor/magento/framework/View/Element/Template.php:271]
#7 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:301]
#8 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1100]
#9 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1104]
#10 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:674]
#11 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Result/Page.php:249]
#12 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:171]
#13 Magento\Framework\View\Result\Layout->renderResult() called at [generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php:193]
#14 Magento\Backend\Model\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/Http.php:120]
#15 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#16 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#17 Magento\Framework\App\Bootstrap->run() called at [index.php:39]            
paugnu commented 3 years ago

Hi @https://github.com/navinbhudiya

I don't think you have used Hyva Admin Grids in the way you're supposed to do so.

It's pretty straight forward to use:

Check the example module, it's the best way to go: https://github.com/hyva-themes/hyva-admin-test-module

Vinai commented 3 years ago

Please also refer to the documentation at https://github.com/hyva-themes/magento2-hyva-admin/tree/main/doc/1.%20Overview/3.%20Walkthrough

Vinai commented 3 years ago

Seems like this issue has resolved itself.

senders commented 3 years ago

I am getting the same error in magento 2.3.6 with your test extension: https://github.com/hyva-themes/hyva-admin-test-module

Vinai commented 3 years ago

I'll reopen the issue and add a polyfill in the next release. Unfortunately I've got myself in a bit of a uncomfortable situation where I can't simply create a new release right now because:

  1. Automatic backports to php7.3 with rector is no longer an option
  2. I have a lot of work in the hyva-forms branch.

Because of 1) I want to backport the main branch to 7.3 manually and then use that for releases. But backporting the main branch now would cause major conflicts when the hyva-forms branch is ready to be merged.

I see two possible ways forward:

  1. Merge hyva-forms now, with half-finished forms support
  2. Backprt to 7.3, implement the polyfill and make a release
  3. Continue hyva-forms development

or

  1. Continue hyva-forms development
  2. Merge when done
  3. Backport, implement polyfill and release
Vinai commented 3 years ago

I followed through with the first option. Please upgrade to release 1.1.4 which includes the SecureHtmlRenderere polyfill.