Skip to content

Commit be24d90

Browse files
committed
add check for attribute option values
1 parent 9cc293e commit be24d90

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private function checkUniqueOption(DataObject $response, array $options = null)
252252
private function checkEmptyOption(DataObject $response, array $optionsForCheck = null)
253253
{
254254
foreach ($optionsForCheck as $optionValues) {
255-
if (isset($optionValues[0]) && $optionValues[0] == '') {
255+
if (isset($optionValues[0]) && trim($optionValues[0]) == '') {
256256
$this->setMessageToResponse($response, [__("The value of Admin scope can't be empty.")]);
257257
$response->setError(true);
258258
}

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ define([
106106
errorOption,
107107
allOptions = [];
108108

109+
newOption.label = $.trim(option.label);
109110
if (_.isEmpty(newOption.label)) {
110111
return false;
111112
}

0 commit comments

Comments
 (0)