-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: WidgetFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releasegood first issue
Description
Preconditions
- Magento version: 2.2.3 (I haven't yet tested other versions)
Steps to reproduce
- Create a widget with a parameter of
xsi:type="text"
orxsi:type="block"
with a textarea block - Add the widget to the content of a CMS page
- Enter a string containing a
+
character into the text field of the widget
Expected result
- The
+
character appears on the rendered page
Actual result
- The
+
character is missing from the rendered page. It is still present in the page content stored in the database, and appears when editing the widget.
Example widget parameter declaration
<parameter name="title" xsi:type="text" visible="true">
<label translate="true">Title</label>
</parameter>
<parameter name="content" xsi:type="block" required="true" visible="true">
<label translate="true">Content</label>
<block class="<vendor>\<module>\Block\Adminhtml\Widget\TextArea"/>
</parameter>
Example TextArea block
<?php
namespace <vendor>\<module>\Block\Adminhtml\Widget;
use Magento\Backend\Block\Template\Context;
use Magento\Backend\Block\Widget\Form\Element;
use Magento\Cms\Model\Wysiwyg\Config;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Data\Form\Element\Factory;
class TextArea extends Element
{
protected $_elementFactory;
/**
* @param Context $context
* @param Factory $elementFactory
* @param array $data
* @param Config $config
*/
public function __construct(Context $context, Factory $elementFactory, Config $config, array $data = [])
{
$this->_elementFactory = $elementFactory;
$this->_wysiwygConfig = $config;
parent::__construct($context, $data);
}
/**
* Prepare chooser element HTML.
*
* @param AbstractElement $element Form Element
*
* @return AbstractElement
*/
public function prepareElementHtml(AbstractElement $element)
{
$input = $this->_elementFactory->create('textarea', ['data' => $element->getData()])
->setId($element->getId())
->setClass('widget-option input-textarea admin__control-text')
->setForm($element->getForm());
if ($element->getRequired()) {
$input->addClass('required-entry');
}
$element->setData('after_element_html', $input->getElementHtml());
return $element;
}
}
Metadata
Metadata
Assignees
Labels
Component: WidgetFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releasegood first issue