-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3531 from magento-borg/BugFixPR
[2.3-develop] Bug Fixes
- Loading branch information
Showing
49 changed files
with
1,300 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\Captcha\CustomerData; | ||
|
||
use Magento\Customer\CustomerData\SectionSourceInterface; | ||
|
||
/** | ||
* Captcha section | ||
*/ | ||
class Captcha extends \Magento\Framework\DataObject implements SectionSourceInterface | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $formIds; | ||
|
||
/** | ||
* @var \Magento\Captcha\Helper\Data | ||
*/ | ||
private $helper; | ||
|
||
/** | ||
* @param \Magento\Captcha\Helper\Data $helper | ||
* @param array $formIds | ||
* @param array $data | ||
* @codeCoverageIgnore | ||
*/ | ||
public function __construct( | ||
\Magento\Captcha\Helper\Data $helper, | ||
array $formIds, | ||
array $data = [] | ||
) { | ||
parent::__construct($data); | ||
$this->helper = $helper; | ||
$this->formIds = $formIds; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getSectionData() :array | ||
{ | ||
$data = []; | ||
|
||
foreach ($this->formIds as $formId) { | ||
$captchaModel = $this->helper->getCaptcha($formId); | ||
$data[$formId] = [ | ||
'isRequired' => $captchaModel->isRequired(), | ||
'timestamp' => time() | ||
]; | ||
} | ||
|
||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="StorefrontCustomerSignInPopupFormSection"> | ||
<element name="captchaField" type="input" selector="#captcha_user_login"/> | ||
<element name="captchaImg" type="block" selector=".captcha-img"/> | ||
<element name="captchaReload" type="block" selector=".captcha-reload"/> | ||
</section> | ||
</sections> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.