Skip to content

Commit 718bb76

Browse files
committed
Fix functional and static tests.
1 parent 7eb567e commit 718bb76

File tree

2 files changed

+9
-8
lines changed
  • app/code/Magento/Widget/Block/Adminhtml/Widget
  • lib/internal/Magento/Framework/Data/Form/Element

2 files changed

+9
-8
lines changed

app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function getMainFieldset()
9191
if ($this->_getData('main_fieldset') instanceof \Magento\Framework\Data\Form\Element\Fieldset) {
9292
return $this->_getData('main_fieldset');
9393
}
94-
$mainFieldsetHtmlId = 'options_fieldset' . md5($this->getWidgetType());
94+
$mainFieldsetHtmlId = 'options_fieldset' . hash('sha256', $this->getWidgetType());
9595
$this->setMainFieldsetHtmlId($mainFieldsetHtmlId);
9696
$fieldset = $this->getForm()->addFieldset(
9797
$mainFieldsetHtmlId,
@@ -141,7 +141,6 @@ protected function _addField($parameter)
141141
{
142142
$form = $this->getForm();
143143
$fieldset = $this->getMainFieldset();
144-
//$form->getElement('options_fieldset');
145144

146145
// prepare element data with values (either from request of from default values)
147146
$fieldName = $parameter->getKey();
@@ -167,10 +166,12 @@ protected function _addField($parameter)
167166
if (is_array($data['value'])) {
168167
foreach ($data['value'] as &$value) {
169168
if (is_string($value)) {
169+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
170170
$value = html_entity_decode($value);
171171
}
172172
}
173173
} else {
174+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
174175
$data['value'] = html_entity_decode($data['value']);
175176
}
176177

lib/internal/Magento/Framework/Data/Form/Element/Label.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* Data form abstract class
9-
*
10-
* @author Magento Core Team <[email protected]>
11-
*/
127
namespace Magento\Framework\Data\Form\Element;
138

9+
use Magento\Framework\Phrase;
10+
11+
/**
12+
* Label form element.
13+
*/
1414
class Label extends \Magento\Framework\Data\Form\Element\AbstractElement
1515
{
1616
/**
@@ -37,7 +37,7 @@ public function __construct(
3737
public function getElementHtml()
3838
{
3939
$html = $this->getBold() ? '<div class="control-value special">' : '<div class="control-value">';
40-
if (is_string($this->getValue())) {
40+
if (is_string($this->getValue()) || $this->getValue() instanceof Phrase) {
4141
$html .= $this->getEscapedValue();
4242
}
4343

0 commit comments

Comments
 (0)