Skip to content

Commit da59e5a

Browse files
committed
AC-15208: Attribute Option Label Gets Overwritten When Updating Store Labels
Updated code to preserve the standard style
1 parent 75e1a76 commit da59e5a

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\Eav\Api\Data\AttributeOptionInterface;
1414
use Magento\Eav\Model\AttributeRepository;
1515
use Magento\Eav\Model\ResourceModel\Entity\Attribute;
16-
use Magento\Eav\Model\ResourceModel\Entity\Attribute\Option;
16+
use Magento\Eav\Model\ResourceModel\Entity\Attribute\Option as AttributeOptionResource;
1717
use Magento\Framework\App\ObjectManager;
1818
use Magento\Framework\Exception\InputException;
1919
use Magento\Framework\Exception\NoSuchEntityException;
@@ -35,24 +35,24 @@ class OptionManagement implements AttributeOptionManagementInterface, AttributeO
3535
protected $resourceModel;
3636

3737
/**
38-
* @var Attribute\Option
38+
* @var AttributeOptionResource
3939
*/
40-
protected Attribute\Option $optionResource;
40+
protected $optionResource;
4141

4242
/**
4343
* @param AttributeRepository $attributeRepository
4444
* @param Attribute $resourceModel
45-
* @param Option|null $optionResource
45+
* @param AttributeOptionResource|null $optionResource
4646
* @codeCoverageIgnore
4747
*/
4848
public function __construct(
4949
AttributeRepository $attributeRepository,
5050
Attribute $resourceModel,
51-
?Attribute\Option $optionResource = null
51+
?AttributeOptionResource $optionResource = null
5252
) {
5353
$this->attributeRepository = $attributeRepository;
5454
$this->resourceModel = $resourceModel;
55-
$this->optionResource = $optionResource ?: ObjectManager::getInstance()->get(Attribute\Option::class);
55+
$this->optionResource = $optionResource ?: ObjectManager::getInstance()->get(AttributeOptionResource::class);
5656
}
5757

5858
/**

app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/**
99
* Entity attribute option resource model
10+
*
11+
* @author Magento Core Team <core@magentocommerce.com>
1012
*/
1113
class Option extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
1214
{

app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/OptionManagementTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Eav\Model\Entity\Attribute\Source\SourceInterface;
1717
use Magento\Eav\Model\Entity\Attribute\Source\Table as EavAttributeSource;
1818
use Magento\Eav\Model\ResourceModel\Entity\Attribute;
19+
use Magento\Eav\Model\ResourceModel\Entity\Attribute\Option as AttributeOptionResource;
1920
use Magento\Framework\Exception\InputException;
2021
use Magento\Framework\Exception\NoSuchEntityException;
2122
use Magento\Framework\Exception\StateException;
@@ -45,7 +46,7 @@ class OptionManagementTest extends TestCase
4546
protected $resourceModelMock;
4647

4748
/**
48-
* @var MockObject|Attribute\Option
49+
* @var MockObject|AttributeOptionResource
4950
*/
5051
protected $optionResourceMock;
5152

@@ -56,7 +57,7 @@ protected function setUp(): void
5657
{
5758
$this->attributeRepositoryMock = $this->createMock(AttributeRepository::class);
5859
$this->resourceModelMock = $this->createMock(Attribute::class);
59-
$this->optionResourceMock = $this->createMock(Attribute\Option::class);
60+
$this->optionResourceMock = $this->createMock(AttributeOptionResource::class);
6061
$this->model = new OptionManagement(
6162
$this->attributeRepositoryMock,
6263
$this->resourceModelMock,

0 commit comments

Comments
 (0)