Skip to content

Commit 09c0138

Browse files
committed
ACP2E-23: [Magento Cloud] Error message in PDP disappearing quickly
1 parent 501d438 commit 09c0138

File tree

3 files changed

+10
-26
lines changed

3 files changed

+10
-26
lines changed

app/code/Magento/Catalog/view/frontend/web/js/storage-manager.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,15 @@ define([
233233

234234
delete params.typeId;
235235
delete params.url;
236+
this.requestSent = 1;
236237

237238
return utils.ajaxSubmit({
238239
url: url,
239240
data: {
240241
ids: data,
241242
'type_id': typeId
242243
}
243-
}, params)
244-
.done(this.requestHandler.bind(this, name))
245-
.always(this.requestSent = 1);
244+
}, params).done(this.requestHandler.bind(this, name));
246245
}
247246
});
248247
});

app/code/Magento/Theme/CustomerData/Messages.php

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace Magento\Theme\CustomerData;
88

9-
use Magento\Catalog\Model\Product\ProductFrontendAction\Synchronizer;
109
use Magento\Customer\CustomerData\SectionSourceInterface;
1110
use Magento\Framework\App\Config;
1211
use Magento\Framework\App\RequestInterface;
@@ -42,32 +41,24 @@ class Messages implements SectionSourceInterface
4241
*/
4342
private $appConfig;
4443

45-
/**
46-
* @var Synchronizer
47-
*/
48-
private $synchronizer;
49-
5044
/**
5145
* Constructor
5246
*
5347
* @param MessageManager $messageManager
5448
* @param InterpretationStrategyInterface $interpretationStrategy
5549
* @param RequestInterface $request
5650
* @param Config $appConfig
57-
* @param Synchronizer $synchronizer
5851
*/
5952
public function __construct(
6053
MessageManager $messageManager,
6154
InterpretationStrategyInterface $interpretationStrategy,
6255
?RequestInterface $request = null,
63-
?Config $appConfig = null,
64-
?Synchronizer $synchronizer = null
56+
?Config $appConfig = null
6557
) {
6658
$this->messageManager = $messageManager;
6759
$this->interpretationStrategy = $interpretationStrategy;
6860
$this->request = $request ?: ObjectManager::getInstance()->get(RequestInterface::class);
6961
$this->appConfig = $appConfig ?: ObjectManager::getInstance()->get(Config::class);
70-
$this->synchronizer = $synchronizer ?: ObjectManager::getInstance()->get(Synchronizer::class);
7162
}
7263

7364
/**
@@ -103,18 +94,13 @@ private function sectionTimestampFlag(): bool
10394
{
10495
$forceNewSectionTimestampFlg = true;
10596

106-
if ((bool) $this->appConfig->getValue($this->synchronizer::ALLOW_SYNC_WITH_BACKEND_PATH)) {
107-
$sections = $this->request->getParam('sections') ?? null;
108-
$sectionNames = $sections ? explode(',', $sections) : [];
109-
110-
if (in_array('cart', $sectionNames)) {
111-
$forceNewSectionTimestampFlg = false;
112-
$forceNewSectionTimestamp = $this->request->getParam('force_new_section_timestamp')
113-
?? null;
97+
if ((bool) $this->appConfig->getValue('catalog/recently_products/synchronize_with_backend')) {
98+
$forceNewSectionTimestampFlg = false;
99+
$forceNewSectionTimestamp = $this->request->getParam('force_new_section_timestamp')
100+
?? null;
114101

115-
if ('true' === $forceNewSectionTimestamp) {
116-
$forceNewSectionTimestampFlg = true;
117-
}
102+
if ('true' === $forceNewSectionTimestamp) {
103+
$forceNewSectionTimestampFlg = true;
118104
}
119105
}
120106
return $forceNewSectionTimestampFlg;

app/code/Magento/Theme/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"magento/module-require-js": "*",
1717
"magento/module-store": "*",
1818
"magento/module-ui": "*",
19-
"magento/module-widget": "*",
20-
"magento/module-catalog": "*"
19+
"magento/module-widget": "*"
2120
},
2221
"suggest": {
2322
"magento/module-theme-sample-data": "*",

0 commit comments

Comments
 (0)