Skip to content

Commit 0e62945

Browse files
author
Mohan Ahuja
committed
ACP2E-711: "Invalid Form Key. Please refresh the page." error occurs when changing the product limit in categories
- Fixing static build failures
1 parent 77ae3ff commit 0e62945

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/code/Magento/PageCache/ViewModel/FormKeyProvider.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class FormKeyProvider implements ArgumentInterface
1919
/**
2020
* XML PATH to enable/disable saving toolbar parameters to session
2121
*/
22-
const XML_PATH_CATALOG_REMEMBER_PAGINATION = 'catalog/frontend/remember_pagination';
22+
private const XML_PATH_CATALOG_REMEMBER_PAGINATION = 'catalog/frontend/remember_pagination';
2323

2424
/**
2525
* @var Config
@@ -53,6 +53,11 @@ public function isFullPageCacheEnabled(): bool
5353
return $this->config->isEnabled();
5454
}
5555

56+
/**
57+
* Is category pagination cache enabled
58+
*
59+
* @return bool
60+
*/
5661
public function isPaginationCacheEnabled(): bool
5762
{
5863
return $this->scopeConfig->isSetFlag(self::XML_PATH_CATALOG_REMEMBER_PAGINATION);

app/code/Magento/PageCache/view/frontend/templates/form_key_provider.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ if ($block->getFormKeyProvider()->isFullPageCacheEnabled()): ?>
88
{
99
"*": {
1010
"Magento_PageCache/js/form-key-provider": {
11-
"isPaginationCacheEnabled": <?= /* @noEscape */ $block->getFormKeyProvider()->isPaginationCacheEnabled() ?>
11+
"isPaginationCacheEnabled":
12+
<?= /* @noEscape */ (int)$block->getFormKeyProvider()->isPaginationCacheEnabled() ?>
1213
}
1314
}
1415
}

0 commit comments

Comments
 (0)