-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom widget with wysiwyg problem on insert widget via pages or blocks #13409
Comments
@deagleka , thank you for your report. |
@deagleka, thank you for your report. |
Hi, |
I just spotted this issue after opening #19742. Has there been any progress with finding a solution, or any workaround someone could recommend? |
Hello everyone, we close this ticket and postpone the discussion to the new one ->#19742 |
This PR is a potential fix for issues magento#19742 and magento#13409 (Thanks to @EduardTd for pointing me in the right direction). I've tested this briefly in my own install and it appears to resolve the issue. Submitting this PR so that the issue can be tested fully.
Preconditions
Magento v2.2.2
Cache disabled
Steps to reproduce
1.created a custom widget with text field using editor to activate wysiwyg
widget.xml file:
<parameter name="custom_title" xsi:type="block" visible="true" required="true"> <label translate="true">Title</label><block class="VendorName\NameSpace\Block\Adminhtml\Widget\TextAreaField"/></parameter>
TextAreaField block:
$editor = $this->_factoryElement->create('editor', ['data' => $element->getData()])->setLabel('')->setWysiwyg(true) ->setConfig($this->getWysiwygConfig($element))->setForceLoad(true) ->setForm($element->getForm());
a. via Admin -> Content -> Widgets : This works fine, everything is ok.
b. via Admin -> Content -> Pages -> Home Page -> Content -> Insert Widget : Problem starting from here.
Expected result
{{widget type="VendorName\NameSpace\Block\Widget\CustomWidget" custom_title="abc" template="VendorName_NameSpace::widget/master-template.phtml"}}
Actual result
If I turn off wysiwyg on my custom widget: it works fine.
If I turn wysiwyg on: Image and Code doesnt show up.
If I turn off wysiwyg and make my widget code appear -> then edit it by double click on the image -> change the text into wysiwyg -> save.
The image still there, however if checking the value : content not change -> there is another widget image appear in the content if turn on wysiwyg.
Note
I think it is some kind of duplicate wysiwyg command mceInsertContent in lib/web/mage/adminhtml/wysiwyg/widget.js line 383
this.getWysiwyg().execCommand('mceInsertContent', false, content);
Hope this help. Have been stucked for this problem more than 2 days. Need help. Thank you.
The text was updated successfully, but these errors were encountered: