commerce-docs / pagebuilder-examples

Page Builder example modules for you to download, install, and learn from.
Other
101 stars 80 forks source link

FAQ module - Can't edit previous stored faq_item #10

Closed dema501 closed 5 years ago

dema501 commented 5 years ago

In Admin:

  1. Go to a CMS page. Add a "FAQ" element to the page.
  2. Create faq_item click on settings gear 3) Save changes for faq_item 4) click on faq_item settings gear one more time

Expected result: to see settings form again

Actual result: nothing but console error

Uncaught TypeError: Cannot read property 'form' of undefined

Screen Shot 2019-05-16 at 11 46 24 AM
bdenham commented 5 years ago

@dema501. Thanks for reporting this. I’ll take a look and see if I can provide a fix.

benoitrenaud commented 5 years ago

Do you have an update on this bug?

LilyBergonzat commented 5 years ago

This is because the "appearance" select has display: none.

Since there's only one appearance (default), and we don't need a whole visual select for it, I changed the files pagebuilder_faq_form.xml and pagebuilder_faq_item_form.xml so it's just a hidden input:

    <fieldset name="appearance_fieldset" component="Magento_PageBuilder/js/form/element/dependent-fieldset">
        <settings>
            <label />
        </settings>
        <field name="appearance" formElement="hidden" sortOrder="10">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="string">default</item>
                </item>
            </argument>
            <settings>
                <dataType>text</dataType>
            </settings>
        </field>
    </fieldset>

And now it works :) !

antoniocarrion commented 5 years ago

@LilyWonhalf i tried what you suggest but still not working. Which Magento version are you using? COuld you provide the whole pagebuilder_faq_form.xml and pagebuilder_faq_item_form.xml files?

bdenham commented 5 years ago

Sorry guys, this slipped through the cracks. This happens because default appearances are not defined for the FAQ content type. I will fix this soon.

bdenham commented 5 years ago

Resolved by https://github.com/magento-devdocs/pagebuilder-examples/commit/1f2f4cbe38d1cac5fa2cecb3177ed05e5bfa4d90