Skip to content

Commit 94c6d81

Browse files
committed
Resolved conflict of CancelOrder file
2 parents bc1c7ba + 329b557 commit 94c6d81

File tree

13 files changed

+460
-23
lines changed

13 files changed

+460
-23
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,7 @@ private function getProductsCountFromCategoryTable(Category $item, string $websi
568568
*/
569569
private function getProductsCountQuery(array $categoryIds, $addVisibilityFilter = true): Select
570570
{
571-
$connections = $this->_resource->getConnection();
572-
$categoryTable = $connections->getTableName('catalog_category_product_index');
571+
$categoryTable = $this->_resource->getTableName('catalog_category_product_index');
573572
$select = $this->_conn->select()
574573
->from(
575574
['cat_index' => $categoryTable],

app/code/Magento/Config/Console/Command/ConfigSetCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public function __construct(
9292
$this->changeDetector = $changeDetector;
9393
$this->processorFacadeFactory = $processorFacadeFactory;
9494
$this->deploymentConfig = $deploymentConfig;
95-
$this->localeEmulator = $localeEmulator ??
96-
ObjectManager::getInstance()->get(LocaleEmulatorInterface::class);
95+
$this->localeEmulator = $localeEmulator;
9796

9897
parent::__construct();
9998
}

app/code/Magento/Config/Console/Command/ConfigShowCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ public function __construct(
126126
?: ObjectManager::getInstance()->get(PathValidatorFactory::class);
127127
$this->emulatedAreaProcessor = $emulatedAreaProcessor
128128
?: ObjectManager::getInstance()->get(EmulatedAdminhtmlAreaProcessor::class);
129-
$this->localeEmulator = $localeEmulator
130-
?: ObjectManager::getInstance()->get(LocaleEmulatorInterface::class);
129+
$this->localeEmulator = $localeEmulator;
131130
}
132131

133132
/**

app/code/Magento/Config/etc/di.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<preference for="Magento\Framework\App\Config\ConfigResource\ConfigInterface" type="Magento\Config\Model\ResourceModel\Config" />
1212
<preference for="Magento\Framework\App\Config\CommentParserInterface" type="Magento\Config\Model\Config\Parser\Comment" />
1313
<preference for="Magento\Config\Model\Config\Structure\ElementVisibilityInterface" type="Magento\Config\Model\Config\Structure\ElementVisibilityComposite" />
14-
<preference for="Magento\Config\Console\Command\LocaleEmulatorInterface" type="Magento\Config\Console\Command\LocaleEmulator\Proxy" />
14+
<preference for="Magento\Config\Console\Command\LocaleEmulatorInterface" type="Magento\Config\Console\Command\LocaleEmulator" />
1515
<type name="Magento\Config\Model\Config\Structure\ElementVisibilityComposite">
1616
<arguments>
1717
<argument name="visibility" xsi:type="array">
@@ -310,6 +310,12 @@
310310
<type name="Magento\Config\Console\Command\ConfigShowCommand">
311311
<arguments>
312312
<argument name="configSource" xsi:type="object">configShowSourceAggregated</argument>
313+
<argument name="localeEmulator" xsi:type="object">Magento\Config\Console\Command\LocaleEmulatorInterface\Proxy</argument>
314+
</arguments>
315+
</type>
316+
<type name="Magento\Config\Console\Command\ConfigSetCommand">
317+
<arguments>
318+
<argument name="localeEmulator" xsi:type="object">Magento\Config\Console\Command\LocaleEmulatorInterface\Proxy</argument>
313319
</arguments>
314320
</type>
315321
<type name="Magento\Framework\Console\CommandListInterface">

app/code/Magento/OrderCancellationGraphQl/Model/Resolver/CancelOrder.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ public function resolve(
107107
];
108108
}
109109

110+
if ($order->hasShipments()) {
111+
return [
112+
'error' => __('Order with one or more items shipped cannot be cancelled'),
113+
'order' => $this->orderFormatter->format($order)
114+
];
115+
}
116+
110117
if (!$this->config->isOrderCancellationEnabledForStore((int)$order->getStoreId())) {
111118
return [
112119
'error' => __('Order cancellation is not enabled for requested store.')

app/code/Magento/PageCache/Controller/Block.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
8+
79
namespace Magento\PageCache\Controller;
810

911
use Magento\Framework\Serialize\Serializer\Base64Json;
1012
use Magento\Framework\Serialize\Serializer\Json;
1113
use Magento\Framework\Validator\RegexFactory;
1214
use Magento\Framework\App\ObjectManager;
1315
use Magento\Framework\View\Layout\LayoutCacheKeyInterface;
16+
use Magento\Framework\App\Config\ScopeConfigInterface;
1417

1518
abstract class Block extends \Magento\Framework\App\Action\Action
1619
{
@@ -51,21 +54,33 @@ abstract class Block extends \Magento\Framework\App\Action\Action
5154
*/
5255
private const VALIDATION_RULE_PATTERN = '/^[a-z0-9]+[a-z0-9_]*$/i';
5356

57+
/**
58+
* @var ScopeConfigInterface
59+
*/
60+
private $config;
61+
62+
/**
63+
* Handle size system name
64+
*/
65+
private const XML_HANDLES_SIZE = 'system/full_page_cache/handles_size';
66+
5467
/**
5568
* @param \Magento\Framework\App\Action\Context $context
5669
* @param \Magento\Framework\Translate\InlineInterface $translateInline
5770
* @param Json $jsonSerializer
5871
* @param Base64Json $base64jsonSerializer
5972
* @param LayoutCacheKeyInterface $layoutCacheKey
6073
* @param RegexFactory|null $regexValidatorFactory
74+
* @param ScopeConfigInterface|null $scopeConfig
6175
*/
6276
public function __construct(
6377
\Magento\Framework\App\Action\Context $context,
6478
\Magento\Framework\Translate\InlineInterface $translateInline,
6579
Json $jsonSerializer = null,
6680
Base64Json $base64jsonSerializer = null,
6781
LayoutCacheKeyInterface $layoutCacheKey = null,
68-
?RegexFactory $regexValidatorFactory = null
82+
?RegexFactory $regexValidatorFactory = null,
83+
ScopeConfigInterface $scopeConfig = null
6984
) {
7085
parent::__construct($context);
7186
$this->translateInline = $translateInline;
@@ -77,6 +92,8 @@ public function __construct(
7792
?: ObjectManager::getInstance()->get(LayoutCacheKeyInterface::class);
7893
$this->regexValidatorFactory = $regexValidatorFactory
7994
?: ObjectManager::getInstance()->get(RegexFactory::class);
95+
$this->config = $scopeConfig
96+
?: ObjectManager::getInstance()->get(ScopeConfigInterface::class);
8097
}
8198

8299
/**
@@ -94,6 +111,11 @@ protected function _getBlocks()
94111
}
95112
$blocks = $this->jsonSerializer->unserialize($blocks);
96113
$handles = $this->base64jsonSerializer->unserialize($handles);
114+
115+
$handleSize = (int) $this->config->getValue(self::XML_HANDLES_SIZE);
116+
$handles = ($handleSize && count($handles) > $handleSize)
117+
? array_splice($handles, 0, $handleSize) : $handles;
118+
97119
if (!$this->validateHandleParam($handles)) {
98120
return [];
99121
}

app/code/Magento/PageCache/etc/adminhtml/system.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
<comment>Public content cache lifetime in seconds. If field is empty default value 86400 will be saved. </comment>
7979
<backend_model>Magento\PageCache\Model\System\Config\Backend\Ttl</backend_model>
8080
</field>
81+
<field id="handles_size" type="text" translate="label comment" sortOrder="5" showInDefault="1" canRestore="1">
82+
<label>Handles params size</label>
83+
<comment>Handles params size. For better performance use handles parameter size between 50 and 100. </comment>
84+
</field>
8185
</group>
8286
</section>
8387
</system>

app/code/Magento/PageCache/etc/config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<path>varnish4.vcl</path>
2525
</varnish4>
2626
<ttl>86400</ttl>
27+
<handles_size>100</handles_size>
2728
<caching_application>1</caching_application>
2829
<default>
2930
<access_list>localhost</access_list>

app/code/Magento/PageCache/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<type name="Magento\PageCache\Controller\Block">
3636
<arguments>
3737
<argument name="layoutCacheKey" xsi:type="object">Magento\Framework\View\Layout\LayoutCacheKeyInterface</argument>
38+
<argument name="scopeConfig" xsi:type="object">Magento\Framework\App\Config\ScopeConfigInterface\Proxy</argument>
3839
</arguments>
3940
</type>
4041
<type name="Magento\Framework\App\Cache\RuntimeStaleCacheStateModifier">

0 commit comments

Comments
 (0)