55 */
66namespace Magento \Customer \Block \Account ;
77
8+ use Magento \Framework \App \ObjectManager ;
89use Magento \Customer \Model \Form ;
910use Magento \Store \Model \ScopeInterface ;
1011use Magento \Customer \Model \Context ;
12+ use Magento \Framework \App \Http \Context as HttpContext ;
1113
1214/**
1315 * @api
@@ -25,21 +27,29 @@ class AuthenticationPopup extends \Magento\Framework\View\Element\Template
2527 */
2628 private $ serializer ;
2729
30+ /**
31+ * @var HttpContext
32+ */
33+ private $ httpContext ;
34+
2835 /**
2936 * @param \Magento\Framework\View\Element\Template\Context $context
3037 * @param array $data
3138 * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
39+ * @param HttpContext $httpContext
3240 * @throws \RuntimeException
3341 */
3442 public function __construct (
3543 \Magento \Framework \View \Element \Template \Context $ context ,
3644 array $ data = [],
37- ?\Magento \Framework \Serialize \Serializer \Json $ serializer = null
45+ ?\Magento \Framework \Serialize \Serializer \Json $ serializer = null ,
46+ HttpContext $ httpContext = null
3847 ) {
3948 parent ::__construct ($ context , $ data );
4049 $ this ->jsLayout = isset ($ data ['jsLayout ' ]) && is_array ($ data ['jsLayout ' ]) ? $ data ['jsLayout ' ] : [];
4150 $ this ->serializer = $ serializer ?: \Magento \Framework \App \ObjectManager::getInstance ()
4251 ->get (\Magento \Framework \Serialize \Serializer \Json::class);
52+ $ this ->httpContext = $ httpContext ?: ObjectManager::getInstance ()->get (HttpContext::class);
4353 }
4454
4555 /**
@@ -54,7 +64,7 @@ public function getJsLayout()
5464 Form::XML_PATH_CUSTOMER_CAPTCHA_ENABLED ,
5565 ScopeInterface::SCOPE_STORE
5666 ) && !$ this ->isLoggedIn ()) {
57- if (isset ($ this ->jsLayout ['components ' ]['authenticationPopup ' ]['children ' ]['captcha ' ])) {
67+ if (isset ($ this ->jsLayout ['components ' ]['authenticationPopup ' ]['children ' ]['captcha ' ])) {
5868 unset($ this ->jsLayout ['components ' ]['authenticationPopup ' ]['children ' ]['captcha ' ]);
5969 }
6070 }
0 commit comments