Skip to content

Commit 12e5cc6

Browse files
committed
ACP2E-3043: Re-implement solution from ACP2E-2025 where object manager is used in a wrong place
- Fixed the issue.
1 parent 47b448e commit 12e5cc6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@
44
* See COPYING.txt for license details.
55
*/
66
use Magento\Customer\ViewModel\Customer\Data;
7-
use Magento\Framework\App\ObjectManager;
87
use Magento\Customer\ViewModel\CookieSettings;
98

109
/** @var \Magento\Customer\Block\CustomerData $block */
1110

1211
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper
1312
/** @var Auth $auth */
14-
$auth = $block->getAuth() ?? ObjectManager::getInstance()->get(Auth::class);
13+
$auth = $block->getAuth();
1514
/** @var JsonSerializer $jsonSerializer */
16-
$jsonSerializer = $block->getJsonSerializer() ??
17-
ObjectManager::getInstance()->get(JsonSerializer::class);
15+
$jsonSerializer = $block->getJsonSerializer();
1816
$customerDataUrl = $block->getCustomerDataUrl('customer/account/updateSession');
1917
$expirableSectionNames = $block->getExpirableSectionNames();
2018
/** @var CookieSettings $cookieSettings */

0 commit comments

Comments
 (0)