Skip to content

Commit f43937b

Browse files
committed
MC-34156: Cannot save product in store view scope without Magento_Catalog::edit_product_design ACL
1 parent 8a091cc commit f43937b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/code/Magento/Catalog/Model/Product/Authorization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function authorizeSavingOf(ProductInterface $product): void
159159
if (!$savedProduct->getSku()) {
160160
throw NoSuchEntityException::singleField('id', $product->getId());
161161
}
162-
$oldData = $product->getOrigData();
162+
$oldData = $savedProduct->getData();
163163
}
164164
}
165165
if ($this->hasProductChanged($product, $oldData)) {

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/AuthorizationTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
/**
2121
* Verify additional authorization for product operations
22+
*
23+
* @magentoAppArea adminhtml
2224
*/
2325
class AuthorizationTest extends TestCase
2426
{
@@ -43,7 +45,7 @@ class AuthorizationTest extends TestCase
4345
private $productRepository;
4446

4547
/**
46-
* @inheridoc
48+
* @inheritdoc
4749
*/
4850
protected function setUp(): void
4951
{
@@ -103,7 +105,7 @@ public function postRequestData(): array
103105
'custom_design_to' => '1',
104106
'custom_layout_update_file' => '1',
105107
],
106-
]
108+
],
107109
],
108110
[
109111
[
@@ -118,7 +120,7 @@ public function postRequestData(): array
118120
'custom_layout_update_file' => '__no_update__',
119121
],
120122
'use_default' => null,
121-
]
123+
],
122124
],
123125
];
124126
}
@@ -130,7 +132,6 @@ public function postRequestData(): array
130132
* @param array $data
131133
*
132134
* @dataProvider postRequestDataException
133-
* @throws AuthorizationException
134135
*/
135136
public function testAuthorizedSavingOfWithException(array $data): void
136137
{

0 commit comments

Comments
 (0)