Skip to content

Commit b1241b8

Browse files
authored
ENGCOM-4083: Fixed validation strategy label in import form #20847
2 parents 1fef35d + 82b6747 commit b1241b8

File tree

2 files changed

+37
-33
lines changed

2 files changed

+37
-33
lines changed

app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic
1818
/**
1919
* Basic import model
2020
*
21-
* @var \Magento\ImportExport\Model\Import
21+
* @var Import
2222
*/
2323
protected $_importModel;
2424

@@ -77,8 +77,10 @@ protected function _prepareForm()
7777
);
7878

7979
// base fieldset
80-
$fieldsets['base'] = $form->addFieldset('base_fieldset', ['legend' => __('Import Settings')]);
81-
$fieldsets['base']->addField(
80+
$fieldsets['base'] = $form->addFieldset(
81+
'base_fieldset',
82+
['legend' => __('Import Settings')]
83+
)->addField(
8284
'entity',
8385
'select',
8486
[
@@ -95,12 +97,11 @@ protected function _prepareForm()
9597
// add behaviour fieldsets
9698
$uniqueBehaviors = $this->_importModel->getUniqueEntityBehaviors();
9799
foreach ($uniqueBehaviors as $behaviorCode => $behaviorClass) {
98-
$fieldsets[$behaviorCode] = $form->addFieldset(
100+
$fieldset = $form->addFieldset(
99101
$behaviorCode . '_fieldset',
100102
['legend' => __('Import Behavior'), 'class' => 'no-display']
101103
);
102-
/** @var $behaviorSource \Magento\ImportExport\Model\Source\Import\AbstractBehavior */
103-
$fieldsets[$behaviorCode]->addField(
104+
$fieldset->addField(
104105
$behaviorCode,
105106
'select',
106107
[
@@ -116,13 +117,13 @@ protected function _prepareForm()
116117
'after_element_html' => $this->getImportBehaviorTooltip(),
117118
]
118119
);
119-
$fieldsets[$behaviorCode]->addField(
120-
$behaviorCode . \Magento\ImportExport\Model\Import::FIELD_NAME_VALIDATION_STRATEGY,
120+
$fieldset->addField(
121+
$behaviorCode . Import::FIELD_NAME_VALIDATION_STRATEGY,
121122
'select',
122123
[
123-
'name' => \Magento\ImportExport\Model\Import::FIELD_NAME_VALIDATION_STRATEGY,
124-
'title' => __(' '),
125-
'label' => __(' '),
124+
'name' => Import::FIELD_NAME_VALIDATION_STRATEGY,
125+
'title' => __('Validation Strategy'),
126+
'label' => __('Validation Strategy'),
126127
'required' => true,
127128
'class' => $behaviorCode,
128129
'disabled' => true,
@@ -133,11 +134,11 @@ protected function _prepareForm()
133134
'after_element_html' => $this->getDownloadSampleFileHtml(),
134135
]
135136
);
136-
$fieldsets[$behaviorCode]->addField(
137-
$behaviorCode . '_' . \Magento\ImportExport\Model\Import::FIELD_NAME_ALLOWED_ERROR_COUNT,
137+
$fieldset->addField(
138+
$behaviorCode . '_' . Import::FIELD_NAME_ALLOWED_ERROR_COUNT,
138139
'text',
139140
[
140-
'name' => \Magento\ImportExport\Model\Import::FIELD_NAME_ALLOWED_ERROR_COUNT,
141+
'name' => Import::FIELD_NAME_ALLOWED_ERROR_COUNT,
141142
'label' => __('Allowed Errors Count'),
142143
'title' => __('Allowed Errors Count'),
143144
'required' => true,
@@ -149,11 +150,11 @@ protected function _prepareForm()
149150
),
150151
]
151152
);
152-
$fieldsets[$behaviorCode]->addField(
153-
$behaviorCode . '_' . \Magento\ImportExport\Model\Import::FIELD_FIELD_SEPARATOR,
153+
$fieldset->addField(
154+
$behaviorCode . '_' . Import::FIELD_FIELD_SEPARATOR,
154155
'text',
155156
[
156-
'name' => \Magento\ImportExport\Model\Import::FIELD_FIELD_SEPARATOR,
157+
'name' => Import::FIELD_FIELD_SEPARATOR,
157158
'label' => __('Field separator'),
158159
'title' => __('Field separator'),
159160
'required' => true,
@@ -162,11 +163,11 @@ protected function _prepareForm()
162163
'value' => ',',
163164
]
164165
);
165-
$fieldsets[$behaviorCode]->addField(
166-
$behaviorCode . \Magento\ImportExport\Model\Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR,
166+
$fieldset->addField(
167+
$behaviorCode . Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR,
167168
'text',
168169
[
169-
'name' => \Magento\ImportExport\Model\Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR,
170+
'name' => Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR,
170171
'label' => __('Multiple value separator'),
171172
'title' => __('Multiple value separator'),
172173
'required' => true,
@@ -175,11 +176,11 @@ protected function _prepareForm()
175176
'value' => Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR,
176177
]
177178
);
178-
$fieldsets[$behaviorCode]->addField(
179-
$behaviorCode . \Magento\ImportExport\Model\Import::FIELD_EMPTY_ATTRIBUTE_VALUE_CONSTANT,
179+
$fieldset->addField(
180+
$behaviorCode . Import::FIELD_EMPTY_ATTRIBUTE_VALUE_CONSTANT,
180181
'text',
181182
[
182-
'name' => \Magento\ImportExport\Model\Import::FIELD_EMPTY_ATTRIBUTE_VALUE_CONSTANT,
183+
'name' => Import::FIELD_EMPTY_ATTRIBUTE_VALUE_CONSTANT,
183184
'label' => __('Empty attribute value constant'),
184185
'title' => __('Empty attribute value constant'),
185186
'required' => true,
@@ -188,28 +189,29 @@ protected function _prepareForm()
188189
'value' => Import::DEFAULT_EMPTY_ATTRIBUTE_VALUE_CONSTANT,
189190
]
190191
);
191-
$fieldsets[$behaviorCode]->addField(
192-
$behaviorCode . \Magento\ImportExport\Model\Import::FIELDS_ENCLOSURE,
192+
$fieldset->addField(
193+
$behaviorCode . Import::FIELDS_ENCLOSURE,
193194
'checkbox',
194195
[
195-
'name' => \Magento\ImportExport\Model\Import::FIELDS_ENCLOSURE,
196+
'name' => Import::FIELDS_ENCLOSURE,
196197
'label' => __('Fields enclosure'),
197198
'title' => __('Fields enclosure'),
198199
'value' => 1,
199200
]
200201
);
202+
$fieldsets[$behaviorCode] = $fieldset;
201203
}
202204

203205
// fieldset for file uploading
204-
$fieldsets['upload'] = $form->addFieldset(
206+
$fieldset = $form->addFieldset(
205207
'upload_file_fieldset',
206208
['legend' => __('File to Import'), 'class' => 'no-display']
207209
);
208-
$fieldsets['upload']->addField(
209-
\Magento\ImportExport\Model\Import::FIELD_NAME_SOURCE_FILE,
210+
$fieldset->addField(
211+
Import::FIELD_NAME_SOURCE_FILE,
210212
'file',
211213
[
212-
'name' => \Magento\ImportExport\Model\Import::FIELD_NAME_SOURCE_FILE,
214+
'name' => Import::FIELD_NAME_SOURCE_FILE,
213215
'label' => __('Select File to Import'),
214216
'title' => __('Select File to Import'),
215217
'required' => true,
@@ -219,11 +221,11 @@ protected function _prepareForm()
219221
),
220222
]
221223
);
222-
$fieldsets['upload']->addField(
223-
\Magento\ImportExport\Model\Import::FIELD_NAME_IMG_FILE_DIR,
224+
$fieldset->addField(
225+
Import::FIELD_NAME_IMG_FILE_DIR,
224226
'text',
225227
[
226-
'name' => \Magento\ImportExport\Model\Import::FIELD_NAME_IMG_FILE_DIR,
228+
'name' => Import::FIELD_NAME_IMG_FILE_DIR,
227229
'label' => __('Images File Directory'),
228230
'title' => __('Images File Directory'),
229231
'required' => false,
@@ -234,6 +236,7 @@ protected function _prepareForm()
234236
),
235237
]
236238
);
239+
$fieldsets['upload'] = $fieldset;
237240

238241
$form->setUseContainer(true);
239242
$this->setForm($form);

app/code/Magento/ImportExport/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Import,Import
1818
"Import Settings","Import Settings"
1919
"Import Behavior","Import Behavior"
2020
" "," "
21+
"Validation Strategy","Validation Strategy"
2122
"Stop on Error","Stop on Error"
2223
"Skip error entries","Skip error entries"
2324
"Allowed Errors Count","Allowed Errors Count"

0 commit comments

Comments
 (0)