Skip to content

Commit c75a8b3

Browse files
ENGCOM-5538: No validation 'Sort Order' in 'New Rating' form issue 23984 #23985
- Merge Pull Request #23985 from edenduong/magento2:2.3-bugfix/validation-new-rating-issue23984 - Merged commits: 1. 929cfd2 2. 88545d9
2 parents 4613a93 + 88545d9 commit c75a8b3

File tree

1 file changed

+14
-3
lines changed
  • app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab

1 file changed

+14
-3
lines changed

app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types = 1);
7+
68
namespace Magento\Review\Block\Adminhtml\Rating\Edit\Tab;
79

10+
/**
11+
* Class Magento\Review\Block\Adminhtml\Rating\Edit\Tab\Form
12+
*/
813
class Form extends \Magento\Backend\Block\Widget\Form\Generic
914
{
1015
/**
@@ -227,7 +232,15 @@ protected function addVisibilityFieldset()
227232
['label' => __('Is Active'), 'name' => 'is_active', 'value' => 1]
228233
);
229234
$this->getFieldset('visibility_form')
230-
->addField('position', 'text', ['label' => __('Sort Order'), 'name' => 'position']);
235+
->addField(
236+
'position',
237+
'text',
238+
[
239+
'label' => __('Sort Order'),
240+
'name' => 'position',
241+
'class' => 'validate-not-negative-number'
242+
]
243+
);
231244
}
232245

233246
/**
@@ -242,8 +255,6 @@ protected function initFieldset($formId, array $config)
242255
if (!isset($this->fieldset[$formId])) {
243256
if (!$this->getForm()->getElement($formId)) {
244257
$this->fieldset[$formId] = $this->getForm()->addFieldset($formId, $config);
245-
} elseif ($this->getForm()->getElement($formId)) {
246-
//do nothing
247258
}
248259
}
249260
}

0 commit comments

Comments
 (0)