Skip to content

Commit c896f2c

Browse files
Merge pull request #1671 from magento-engcom/2.2-develop-prs
[EngCom] Public Pull Requests - 2.2-develop - MAGETWO-83279: Magento 2.2.0 Solution for Cross-sell product placeholder image size … #12018 - MAGETWO-83270: 11700: "Something Went Wrong" error for limited access admin user #11993 - MAGETWO-83085: fix #8846: avoid duplicated attribute option values #11785
2 parents df73677 + 9c0585a commit c896f2c

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

app/code/Magento/Catalog/Model/Product/Attribute/OptionManagement.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ public function getItems($attributeCode)
4040
*/
4141
public function add($attributeCode, $option)
4242
{
43+
/** @var \Magento\Eav\Api\Data\AttributeOptionInterface[] $currentOptions */
44+
$currentOptions = $this->getItems($attributeCode);
45+
if (is_array($currentOptions)) {
46+
array_walk($currentOptions, function (&$attributeOption) {
47+
/** @var \Magento\Eav\Api\Data\AttributeOptionInterface $attributeOption */
48+
$attributeOption = $attributeOption->getLabel();
49+
});
50+
if (in_array($option->getLabel(), $currentOptions)) {
51+
return false;
52+
}
53+
}
4354
return $this->eavOptionManagement->add(
4455
\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE,
4556
$attributeCode,

app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ private function validateAclResource($dataProviderConfigData)
127127
{
128128
if (isset($dataProviderConfigData['aclResource'])) {
129129
if (!$this->_authorization->isAllowed($dataProviderConfigData['aclResource'])) {
130-
$this->_redirect('admin/denied');
130+
if (!$this->_request->isAjax()) {
131+
$this->_redirect('admin/denied');
132+
}
133+
131134
return false;
132135
}
133136
}

app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,13 @@ public function testExecuteAjaxRequestWithoutPermissions(array $dataProviderConf
279279
$this->requestMock->expects($this->any())
280280
->method('getParams')
281281
->willReturn([]);
282+
if ($isAllowed === false) {
283+
$this->requestMock->expects($this->once())
284+
->method('isAjax')
285+
->willReturn(true);
286+
}
287+
$this->responseMock->expects($this->never())
288+
->method('setRedirect');
282289
$this->responseMock->expects($this->any())
283290
->method('appendBody')
284291
->with($renderedData);

app/design/frontend/Magento/blank/etc/view.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<width>140</width>
1313
<height>140</height>
1414
</image>
15-
<image id="cart_cross_sell_products" type="thumbnail">
16-
<width>152</width>
17-
<height>188</height>
15+
<image id="cart_cross_sell_products" type="small_image">
16+
<width>240</width>
17+
<height>300</height>
1818
</image>
1919
<image id="cart_page_product_thumbnail" type="small_image">
2020
<width>110</width>

app/design/frontend/Magento/luma/etc/view.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<width>140</width>
1313
<height>140</height>
1414
</image>
15-
<image id="cart_cross_sell_products" type="thumbnail">
16-
<width>200</width>
17-
<height>248</height>
15+
<image id="cart_cross_sell_products" type="small_image">
16+
<width>240</width>
17+
<height>300</height>
1818
</image>
1919
<image id="cart_page_product_thumbnail" type="small_image">
2020
<width>165</width>

0 commit comments

Comments
 (0)