Skip to content

Commit 7627e3a

Browse files
committed
ACP2E-2025: Refix ACP2E-1445 for multiple store views in the frontend.
- Fixed the CR comments.
1 parent 173e581 commit 7627e3a

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

app/code/Magento/Customer/Test/Unit/ViewModel/Customer/JsonSerializerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ protected function setUp(): void
4040
}
4141

4242
/**
43-
* Test json encode value.
43+
* Test serialize value.
4444
*
4545
* @return void
4646
*/
47-
public function testJsonEncode(): void
47+
public function testSerialize(): void
4848
{
4949
$this->jsonEncoderMock->expects($this->once())
5050
->method('serialize')
@@ -60,7 +60,7 @@ function ($value) {
6060
'http://example.com/customer/section/load/'
6161
]
6262
),
63-
$this->model->jsonEncode(['http://example.com/customer/section/load/'])
63+
$this->model->serialize(['http://example.com/customer/section/load/'])
6464
);
6565
}
6666
}

app/code/Magento/Customer/ViewModel/Customer/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ public function __construct(
3131
*/
3232
public function isLoggedIn(): bool|null
3333
{
34-
return $this->httpContext->getValue(Context::CONTEXT_AUTH);
34+
return $this->httpContext->getValue(Context::CONTEXT_AUTH) ?? false;
3535
}
3636
}

app/code/Magento/Customer/ViewModel/Customer/JsonSerializer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ public function __construct(
2424
}
2525

2626
/**
27-
* Encode the mixed $valueToEncode into the JSON format
27+
* Encode the mixed $value into the JSON format
2828
*
29-
* @param mixed $valueToEncode
29+
* @param mixed $value
3030
* @return string
3131
*/
32-
public function jsonEncode($valueToEncode): string
32+
public function serialize(mixed $value): string
3333
{
34-
return $this->jsonEncoder->serialize($valueToEncode);
34+
return $this->jsonEncoder->serialize($value);
3535
}
3636
}

app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $expirableSectionNames = $block->getExpirableSectionNames();
2323
"Magento_Customer/js/customer-data": {
2424
"sectionLoadUrl": "<?= $block->escapeJs($block->getCustomerDataUrl('customer/section/load')) ?>",
2525
"expirableSectionLifetime": <?= (int)$block->getExpirableSectionLifetime() ?>,
26-
"expirableSectionNames": <?= /* @noEscape */ $jsonSerializer->jsonEncode(
26+
"expirableSectionNames": <?= /* @noEscape */ $jsonSerializer->serialize(
2727
$expirableSectionNames
2828
) ?>,
2929
"cookieLifeTime": "<?= $block->escapeJs($block->getCookieLifeTime()) ?>",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,4 @@
4747
<preference for="Magento\PageCache\Model\VclGeneratorInterface" type="Magento\PageCache\Model\Varnish\VclGenerator"/>
4848
<preference for="Magento\PageCache\Model\VclTemplateLocatorInterface" type="Magento\PageCache\Model\Varnish\VclTemplateLocator"/>
4949
<preference for="Magento\PageCache\Model\Spi\PageCacheTagsPreprocessorInterface" type="Magento\PageCache\Model\PageCacheTagsPreprocessorComposite"/>
50-
<preference for="Magento\Framework\App\PageCache\IdentifierInterface" type="Magento\Framework\App\PageCache\Identifier"/>
5150
</config>

app/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,4 +2003,5 @@
20032003
</arguments>
20042004
</type>
20052005
<preference for="Magento\Framework\Filter\Input\PurifierInterface" type="Magento\Framework\Filter\Input\Purifier"/>
2006+
<preference for="Magento\Framework\App\PageCache\IdentifierInterface" type="Magento\Framework\App\PageCache\Identifier"/>
20062007
</config>

lib/internal/Magento/Framework/App/PageCache/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Kernel
7878
* @param \Magento\Framework\Serialize\SerializerInterface|null $serializer
7979
* @param AppState|null $state
8080
* @param \Magento\PageCache\Model\Cache\Type|null $fullPageCache
81-
* @param \Magento\Framework\App\PageCache\IdentifierInterface $identifierForSave
81+
* @param \Magento\Framework\App\PageCache\IdentifierInterface $identifierForSave|null
8282
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8383
*/
8484
public function __construct(

0 commit comments

Comments
 (0)