magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.36k stars 9.28k forks source link

Multiple HTML attributes not editable on Categories #38843

Open adamlavery opened 1 week ago

adamlavery commented 1 week ago

Preconditions and environment

CE 2.4.7

Needs a custom category text attribute to be added that uses the WYSIWYG editor. See the web for example of how to do that.

This arose after upgrading from 2.4.3 to 2.4.7. Upgrade went through 2.4.4, 2.4.5 & 2.4.6 so no idea what version this bug appeared in.

Steps to reproduce

  1. Add a custom text category attribute e.g. https://developer.adobe.com/commerce/frontend-core/ui-components/howto/add-category-attribute/

  2. Add to the category edit page as wysiwyg i.e.

        <field name="custom_description" template="ui/form/field" sortOrder="100" formElement="wysiwyg">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="wysiwygConfigData" xsi:type="array">
                        <item name="height" xsi:type="string">100px</item>
                        <item name="add_variables" xsi:type="boolean">false</item>
                        <item name="add_widgets" xsi:type="boolean">false</item>
                        <item name="add_images" xsi:type="boolean">true</item>
                        <item name="add_directives" xsi:type="boolean">true</item>
                    </item>
                    <item name="source" xsi:type="string">category</item>
                </item>
            </argument>
            <settings>
                <label translate="true">Below Description</label>
                <dataScope>custom_description</dataScope>
            </settings>
            <formElements>
                <wysiwyg class="Magento\Catalog\Ui\Component\Category\Form\Element\Wysiwyg">
                    <settings>
                        <rows>8</rows>
                        <wysiwyg>true</wysiwyg>
                    </settings>
                </wysiwyg>
            </formElements>
        </field>
  1. Try to edit the field on the category - it won't save. Note in our case our custom fields already have values that display on the frontend but do not show on the backend. Changes do not save,

  2. Change the sort order of the field to 49 and try again., This time you can edit and save the custom attribute but not the normal Description field.

  3. Change the sort order back to 100 and make the field a basic textarea field e.g.

<field name="custom_description" sortOrder="100" formElement="textarea">
    <settings>
        <dataType>string</dataType>
        <label translate="true">My Text Attribute</label>
    </settings>
</field>

Now you can edit and save the field as text.

Expected result

We are able to edit all HTML fields on the category page.,

Actual result

We can only edit the first HTML field that appears on the category page.

Additional information

Custom attribute editor empty: image

Move custom attribute before core description, now description empty: image

Make custom attribute a standard textarea and works ok: image

Release note

Fix bug introduced in 2.4.? that prevents editing of additional custom HTML attributes on categories.

Triage and priority

m2-assistant[bot] commented 1 week ago

Hi @adamlavery. Thank you for your report. To speed up processing of this issue, 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:

adamlavery commented 1 week ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 week ago

Hi @adamlavery. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 week ago

Hi @adamlavery, here is your Magento Instance: https://12a2515e68f0a3e05523ef31d44dfa90.instances-prod.magento-community.engineering Admin access: https://12a2515e68f0a3e05523ef31d44dfa90.instances-prod.magento-community.engineering/admin_f260 Login: a7d8dd33 Password: c32eb466d8d3

adamlavery commented 1 week ago

How do we get SSH access to this to be able to add a test module?

m2-assistant[bot] commented 1 week ago

Hi @engcom-Dash. 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: :point_down:


m2-assistant[bot] commented 4 days ago

Hi @engcom-Delta. 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: :point_down:

GamesmenJordan commented 15 hours ago

+1 to this issue.