Skip to content

Commit 0ec7742

Browse files
Merge pull request #9613 from magento-gl/marcomprs
[Bluetooth] Community Pull Requests delivery 2.4.8
2 parents 9c05217 + f449e5b commit 0ec7742

File tree

7 files changed

+27
-67
lines changed

7 files changed

+27
-67
lines changed

app/code/Magento/Sales/Helper/Reorder.php

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\Sales\Helper;
@@ -11,12 +11,7 @@
1111
*/
1212
class Reorder extends \Magento\Framework\App\Helper\AbstractHelper
1313
{
14-
const XML_PATH_SALES_REORDER_ALLOW = 'sales/reorder/allow';
15-
16-
/**
17-
* @var \Magento\Customer\Model\Session
18-
*/
19-
protected $customerSession;
14+
public const XML_PATH_SALES_REORDER_ALLOW = 'sales/reorder/allow';
2015

2116
/**
2217
* @var \Magento\Sales\Api\OrderRepositoryInterface
@@ -25,22 +20,21 @@ class Reorder extends \Magento\Framework\App\Helper\AbstractHelper
2520

2621
/**
2722
* @param \Magento\Framework\App\Helper\Context $context
28-
* @param \Magento\Customer\Model\Session $customerSession
2923
* @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository
3024
*/
3125
public function __construct(
3226
\Magento\Framework\App\Helper\Context $context,
33-
\Magento\Customer\Model\Session $customerSession,
3427
\Magento\Sales\Api\OrderRepositoryInterface $orderRepository
3528
) {
3629
$this->orderRepository = $orderRepository;
37-
$this->customerSession = $customerSession;
3830
parent::__construct(
3931
$context
4032
);
4133
}
4234

4335
/**
36+
* Check if reorder is allowed
37+
*
4438
* @return bool
4539
*/
4640
public function isAllow()
@@ -78,10 +72,6 @@ public function canReorder($orderId)
7872
if (!$this->isAllowed($order->getStore())) {
7973
return false;
8074
}
81-
if ($this->customerSession->isLoggedIn()) {
82-
return $order->canReorder();
83-
} else {
84-
return true;
85-
}
75+
return $order->canReorder();
8676
}
8777
}

app/code/Magento/Sales/Test/Unit/Helper/ReorderTest.php

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

88
namespace Magento\Sales\Test\Unit\Helper;
99

10-
use Magento\Customer\Model\Session;
1110
use Magento\Framework\App\Config;
1211
use Magento\Framework\App\Config\ScopeConfigInterface;
1312
use Magento\Framework\App\Helper\Context;
@@ -40,11 +39,6 @@ class ReorderTest extends TestCase
4039
*/
4140
protected $orderMock;
4241

43-
/**
44-
* @var MockObject|Session
45-
*/
46-
protected $customerSessionMock;
47-
4842
/**
4943
* @var OrderRepositoryInterface|MockObject
5044
*/
@@ -66,15 +60,10 @@ protected function setUp(): void
6660
->method('getScopeConfig')
6761
->willReturn($this->scopeConfigMock);
6862

69-
$this->customerSessionMock = $this->getMockBuilder(Session::class)
70-
->disableOriginalConstructor()
71-
->getMock();
72-
7363
$this->repositoryMock = $this->getMockBuilder(OrderRepositoryInterface::class)
7464
->getMockForAbstractClass();
7565
$this->helper = new Reorder(
7666
$contextMock,
77-
$this->customerSessionMock,
7867
$this->repositoryMock
7968
);
8069

@@ -156,40 +145,17 @@ public function testCanReorderStoreNotAllowed()
156145
$this->assertFalse($this->helper->canReorder(1));
157146
}
158147

159-
/**
160-
* Tests what happens if the customer is not logged in and the store does allow re-orders.
161-
*
162-
* @return void
163-
*/
164-
public function testCanReorderCustomerNotLoggedIn()
165-
{
166-
$this->setupOrderMock(true);
167-
168-
$this->customerSessionMock->expects($this->once())
169-
->method('isLoggedIn')
170-
->willReturn(false);
171-
$this->repositoryMock->expects($this->once())
172-
->method('get')
173-
->with(1)
174-
->willReturn($this->orderMock);
175-
$this->assertTrue($this->helper->canReorder(1));
176-
}
177-
178148
/**
179149
* Tests what happens if the customer is logged in and the order does or does not allow reorders.
180150
*
181151
* @param bool $orderCanReorder
182152
* @return void
183153
* @dataProvider getOrderCanReorder
184154
*/
185-
public function testCanReorderCustomerLoggedInAndOrderCanReorder($orderCanReorder)
155+
public function testCanReorder($orderCanReorder)
186156
{
187157
$this->setupOrderMock(true);
188158

189-
$this->customerSessionMock->expects($this->once())
190-
->method('isLoggedIn')
191-
->willReturn(true);
192-
193159
$this->orderMock->expects($this->once())
194160
->method('canReorder')
195161
->willReturn($orderCanReorder);

app/code/Magento/SalesRule/Model/Rule/Condition/Product.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2017 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\SalesRule\Model\Rule\Condition;
77

@@ -23,7 +23,7 @@ protected function _addSpecialAttributes(array &$attributes)
2323
$attributes['quote_item_price'] = __('Price in cart');
2424
$attributes['quote_item_row_total'] = __('Row total in cart');
2525

26-
$attributes['parent::category_ids'] = __('Category (Parent only)');
26+
$attributes['parent::category_ids'] = __('Category (Parent Only)');
2727
$attributes['children::category_ids'] = __('Category (Children Only)');
2828
}
2929

@@ -72,8 +72,8 @@ public function loadAttributeOptions()
7272
}
7373
$frontLabel = $attribute->getFrontendLabel();
7474
$attributes[$attribute->getAttributeCode()] = $frontLabel;
75-
$attributes['parent::' . $attribute->getAttributeCode()] = $frontLabel . __('(Parent Only)');
76-
$attributes['children::' . $attribute->getAttributeCode()] = $frontLabel . __('(Children Only)');
75+
$attributes['parent::' . $attribute->getAttributeCode()] = __('%1 (Parent Only)', $frontLabel);
76+
$attributes['children::' . $attribute->getAttributeCode()] = __('%1 (Children Only)', $frontLabel);
7777
}
7878

7979
$this->_addSpecialAttributes($attributes);

app/code/Magento/SalesRule/i18n/en_US.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,7 @@ Apply,Apply
174174
"Code Quantity Limit","Code Quantity Limit"
175175
"For better performance max value allowed is 250,000. Set 0 to disable it.","For better performance max value allowed is 250,000. Set 0 to disable it."
176176
"coupon exceeds usage limit.","coupon exceeds usage limit."
177+
"Category (Parent Only)","Category (Parent Only)"
178+
"Category (Children Only)","Category (Children Only)"
179+
"%1 (Parent Only)","%1 (Parent Only)"
180+
"%1 (Children Only)","%1 (Children Only)"

app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// /**
2-
// * Copyright © Magento, Inc. All rights reserved.
3-
// * See COPYING.txt for license details.
2+
// * Copyright 2025 Adobe
3+
// * All Rights Reserved.
44
// */
55

66
//
@@ -43,7 +43,7 @@
4343
max-width: 100%;
4444
padding-bottom: 1rem;
4545
padding-top: @data-grid-header-row__indent;
46-
overflow-x: auto
46+
overflow-x: visible
4747
}
4848

4949
.admin__data-grid-loading-mask {

lib/internal/Magento/Framework/Filesystem/Driver/Http.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2017 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\Framework\Filesystem\Driver;
@@ -36,7 +36,7 @@ public function isExists($path)
3636
$status = $headers[1];
3737
}
3838

39-
return !(strpos($status, '200 OK') === false);
39+
return !(strpos($status, '200') === false);
4040
}
4141

4242
/**

lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2017 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -62,7 +62,7 @@ public function testIsExists(string $status, bool $result): void
6262
*/
6363
public static function dataProviderForTestIsExists(): array
6464
{
65-
return [['200 OK', true], ['404 Not Found', false]];
65+
return [['200 OK', true], ['200', true], ['404 Not Found', false]];
6666
}
6767

6868
/**

0 commit comments

Comments
 (0)