Magento2: Admin classes being used on the frontend

Created on 8 Jun 2018  路  7Comments  路  Source: magento/magento2

The recently viewed widgets template contains admin classes that render on the front-end, no admin classes should be used on the front-end as they're intended to be admin specific.

Preconditions

  1. Magento 2.2.3 EE

Steps to reproduce

  1. Create a static block
  2. Include a widget to render the recently viewed products. The code generated for me is {{widget type="Magento\Catalog\Block\Widget\RecentlyViewed" uiComponent="widget_recently_viewed" page_size="6" show_attributes="image" show_buttons="add_to_cart" template="product/widget/viewed/grid.phtml"}}
  3. Call this static block anywhere, I added the following code to default.xml:
<block class="Magento\Cms\Block\Block" name="recently.viewed.widget">
    <arguments>
        <argument name="block_id" xsi:type="string">recently-viewed</argument>
    </arguments>
</block>
  1. Once rendered on the front-end you'll see the classes admin__data-grid-outer-wrap and admin__data-grid-loading-mask as they're hardcoded inside vendor/magento/module-ui/view/base/ui_component/templates/listing/default.xhtml:9

Expected result

  1. Elements should use classes consistent with the rest of the front-end

Actual result

  1. Classes contain references to the admin

screen shot 2018-06-08 at 12 38 00

Widget Confirmed P3 ready for dev Reproduced on 2.2.x Reproduced on 2.3.x S3 Dev.Experience

Most helpful comment

Can we have the push request here please? So we can fix this in earlier versions?

All 7 comments

HI @BenSpace48 thank you for your report. Please follow these guidelines for proper tracking of your issue. You can report Commerce-related issues in one of two ways:
You can use the Support portal associated with your account
or
If you are a Partner reporting on behalf of a merchant, use the Partner portal.

GitHub is intended for Magento Open Source users to report on issues related to Open Source only. There are no account management services associated with GitHub.

I believe this is a bug hence why I am raising it here, when users create a recently viewed widget there should not be admin files loading on the front-end. Recently viewed is also available in open source isn't it?

@engcom-backlog-nazar if you refuse to resolve the issue can you at least explain why admin files are loading on the front-end?

@BenSpace48 ok. Its reproduce on Ce version, but remove EE lable and set the CE
thank you for your report.
We've acknowledged the issue and added to our backlog.

Can we have the push request here please? So we can fix this in earlier versions?

For those wondering... If you just fill in the template with the same path it will take the frontend html
Example for a frontend checkbox arguments :

            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="formElement" xsi:type="string">checkbox</item>
                    <item name="source" xsi:type="string">your_source</item>
                    <item name="default" xsi:type="number">1</item>
                    <item name="template" xsi:type="string">ui/form/element/checkbox</item>
                </item>
            </argument>

This will also not break on the update when they fix what is causing it taking the base template instead of the frontend template

@engcom-backlog-nazar Any progress on this issue? It's still a problem in Magento 2.3.2

Was this page helpful?
0 / 5 - 0 ratings