Skip to content

Commit

Permalink
Merge pull request magento#1671 from magento-engcom/2.2-develop-prs
Browse files Browse the repository at this point in the history
[EngCom] Public Pull Requests - 2.2-develop
 - MAGETWO-83279: Magento 2.2.0 Solution for Cross-sell product placeholder image size … magento#12018
 - MAGETWO-83270: 11700: "Something Went Wrong" error for limited access admin user magento#11993
 - MAGETWO-83085: fix magento#8846: avoid duplicated attribute option values magento#11785
  • Loading branch information
ishakhsuvarov authored Nov 7, 2017
2 parents df73677 + 9c0585a commit c896f2c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ public function getItems($attributeCode)
*/
public function add($attributeCode, $option)
{
/** @var \Magento\Eav\Api\Data\AttributeOptionInterface[] $currentOptions */
$currentOptions = $this->getItems($attributeCode);
if (is_array($currentOptions)) {
array_walk($currentOptions, function (&$attributeOption) {
/** @var \Magento\Eav\Api\Data\AttributeOptionInterface $attributeOption */
$attributeOption = $attributeOption->getLabel();
});
if (in_array($option->getLabel(), $currentOptions)) {
return false;
}
}
return $this->eavOptionManagement->add(
\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE,
$attributeCode,
Expand Down
5 changes: 4 additions & 1 deletion app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ private function validateAclResource($dataProviderConfigData)
{
if (isset($dataProviderConfigData['aclResource'])) {
if (!$this->_authorization->isAllowed($dataProviderConfigData['aclResource'])) {
$this->_redirect('admin/denied');
if (!$this->_request->isAjax()) {
$this->_redirect('admin/denied');
}

return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ public function testExecuteAjaxRequestWithoutPermissions(array $dataProviderConf
$this->requestMock->expects($this->any())
->method('getParams')
->willReturn([]);
if ($isAllowed === false) {
$this->requestMock->expects($this->once())
->method('isAjax')
->willReturn(true);
}
$this->responseMock->expects($this->never())
->method('setRedirect');
$this->responseMock->expects($this->any())
->method('appendBody')
->with($renderedData);
Expand Down
6 changes: 3 additions & 3 deletions app/design/frontend/Magento/blank/etc/view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<width>140</width>
<height>140</height>
</image>
<image id="cart_cross_sell_products" type="thumbnail">
<width>152</width>
<height>188</height>
<image id="cart_cross_sell_products" type="small_image">
<width>240</width>
<height>300</height>
</image>
<image id="cart_page_product_thumbnail" type="small_image">
<width>110</width>
Expand Down
6 changes: 3 additions & 3 deletions app/design/frontend/Magento/luma/etc/view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<width>140</width>
<height>140</height>
</image>
<image id="cart_cross_sell_products" type="thumbnail">
<width>200</width>
<height>248</height>
<image id="cart_cross_sell_products" type="small_image">
<width>240</width>
<height>300</height>
</image>
<image id="cart_page_product_thumbnail" type="small_image">
<width>165</width>
Expand Down

0 comments on commit c896f2c

Please sign in to comment.