Skip to content

Commit

Permalink
Fix functional and static tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalevanec committed Apr 4, 2019
1 parent 7eb567e commit 718bb76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getMainFieldset()
if ($this->_getData('main_fieldset') instanceof \Magento\Framework\Data\Form\Element\Fieldset) {
return $this->_getData('main_fieldset');
}
$mainFieldsetHtmlId = 'options_fieldset' . md5($this->getWidgetType());
$mainFieldsetHtmlId = 'options_fieldset' . hash('sha256', $this->getWidgetType());
$this->setMainFieldsetHtmlId($mainFieldsetHtmlId);
$fieldset = $this->getForm()->addFieldset(
$mainFieldsetHtmlId,
Expand Down Expand Up @@ -141,7 +141,6 @@ protected function _addField($parameter)
{
$form = $this->getForm();
$fieldset = $this->getMainFieldset();
//$form->getElement('options_fieldset');

// prepare element data with values (either from request of from default values)
$fieldName = $parameter->getKey();
Expand All @@ -167,10 +166,12 @@ protected function _addField($parameter)
if (is_array($data['value'])) {
foreach ($data['value'] as &$value) {
if (is_string($value)) {
// phpcs:ignore Magento2.Functions.DiscouragedFunction
$value = html_entity_decode($value);
}
}
} else {
// phpcs:ignore Magento2.Functions.DiscouragedFunction
$data['value'] = html_entity_decode($data['value']);
}

Expand Down
12 changes: 6 additions & 6 deletions lib/internal/Magento/Framework/Data/Form/Element/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* See COPYING.txt for license details.
*/

/**
* Data form abstract class
*
* @author Magento Core Team <[email protected]>
*/
namespace Magento\Framework\Data\Form\Element;

use Magento\Framework\Phrase;

/**
* Label form element.
*/
class Label extends \Magento\Framework\Data\Form\Element\AbstractElement
{
/**
Expand All @@ -37,7 +37,7 @@ public function __construct(
public function getElementHtml()
{
$html = $this->getBold() ? '<div class="control-value special">' : '<div class="control-value">';
if (is_string($this->getValue())) {
if (is_string($this->getValue()) || $this->getValue() instanceof Phrase) {
$html .= $this->getEscapedValue();
}

Expand Down

0 comments on commit 718bb76

Please sign in to comment.