Magenerds / PageDesigner

92 stars 41 forks source link

Update Magento 2.2.0 #15

Closed lmathieu32 closed 5 years ago

lmathieu32 commented 7 years ago

Hello,

Recently magento has released magento 2.2.0, I applied the update to my website that uses PageDesigner, however the module does not seem to be compatible with this version. When I want to edit a page I have http error 500.

Do you have a solution or have you ever encountered this problem?

Thank you.

sydekumf commented 7 years ago

Hi, 500 means there is a server error. Look into the Magento/Server Logs please for possible errors.

cagartner commented 7 years ago

Here`s the problem that occurs when installed in Magento 2.2

Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Framework\View\Element\UiComponentFactory::argumentsResolver() must be of the type array, null given, called in /Users/cagartner/workspace/magento2/vendor/magento/framework/View/Element/UiComponentFactory.php on line 212 and defined in /Users/cagartner/workspace/magento2/vendor/magento/framework/View/Element/UiComponentFactory.php:164 Stack trace: #0 /Users/cagartner/workspace/magento2/vendor/magento/framework/View/Element/UiComponentFactory.php(212): Magento\Framework\View\Element\UiComponentFactory->argumentsResolver('page-designer', NULL) #1 /Users/cagartner/workspace/magento2/vendor/magento/module-ui/Component/Form/Field.php(84): Magento\Framework\View\Element\UiComponentFactory->create('page-designer', 'page_designer', Array) #2 /Users/cagartner/workspace/magento2/vendor/magento/framework/View/Layout/Generator/UiComponent.php(159): Magento\Ui\Component\Form\Field->prepare() #3 /Users/cagartner/workspace/magento2/vendor/magento/framework/View/Layout/Generat in /Users/cagartner/workspace/magento2/vendor/magento/framework/View/Element/UiComponentFactory.php on line 164
sydekumf commented 7 years ago

Currently this extension does not support Magento 2.2 but will be updated in the future. As this extension is open source, anyone can participate migrating it to 2.2 :-)

cagartner commented 7 years ago

Now I'm trying to migrating to make work, if I success, will make a PR :)

sydekumf commented 7 years ago

That would be awesome!!! Would be very helpful :-)

rrroulio commented 7 years ago

Any news for 2.2 compatibility?

diskocedric commented 7 years ago

To fix it you have to change the page-designer field definition in ui-component "cms_block_form.xml" and "cms_page_form.xml" to this:


<!-- page designer -->
        <field name="page-designer" formElement="component">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string"/>
                    <item name="source" xsi:type="string">block</item>
                    <item name="dataScope" xsi:type="string">page_designer_json</item>
                    <item name="component" xsi:type="string">Magenerds_PageDesigner/js/page_designer</item>
                    <item name="class" xsi:type="string">Magenerds\PageDesigner\Component\PageDesigner</item>
                </item>
            </argument>
        </field>
cagartner commented 7 years ago

@diskocedric Thank you for the tip.

Created PR, On 2.2 working well, I haven't tested on 2.1, if anyone can help on tests I'll appreciate.

gewaechshaus commented 7 years ago

Does work so far after applying the fix above by @diskocedric thx

sydekumf commented 7 years ago

Could anybody save cms pages successfuly? I described an issue here: https://github.com/Magenerds/PageDesigner/pull/16

gewaechshaus commented 7 years ago

@sydekumf - I can edit and save excisting cms pages... I didn't check the related tables, but it looks like the content doesn't get updated in frontend (after cleaning/flushing all related caches ;)), so something is going on there :)

To verify that it's just the content which isn't getting updated, I changed the layout which did change as usual.

rrroulio commented 7 years ago

@diskocedric It works for pages thanks but not for cms blocks.

gewaechshaus commented 7 years ago

@rrroulio - I think you forgot to update cms_block_form.xml + cmsstaging_block_update...xml, take a look at this repo

https://github.com/cagartner/PageDesigner

jwohlfeil commented 7 years ago

@gewaechshaus Thanks for the changes for mage 2.2 at https://github.com/cagartner/PageDesigner/tree/feature/magento-2.2, working nicly! 👍

twosg commented 6 years ago

For me it is not working on M2.2.1, I get:

page_designer.js:361 Uncaught TypeError: Cannot read property 'click' of undefined
    at UiClass.onColumnContentSet (page_designer.js:361)
    at UiClass.retrieveColumnContent (pdClass.js:918)
    at UiClass.<anonymous> (pdClass.js:310)
    at HTMLDivElement.<anonymous> (pdClass.js:1181)
    at HTMLDivElement.dispatch (jquery.js:5226)
    at HTMLDivElement.elemData.handle (jquery.js:4878)

Code is wysControl.find('.mceButton.mce_magentowidget').get(0).click(); - when I replace that with wysControl.find('.action-add-widget').get(0).click(); then the insert widget modal opens and I can set up a widget, but after clicking insert it is not added to the content in the column.

Also I can't add columns on pages (just nothing happens, also no JS error).