Skip to content

2.2 develop-update branch #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 176 commits into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
7d44656
magento/magento2#12970: Can't add grouped product, with out of stock …
p-bystritsky Jan 5, 2018
42b4f3c
magento/magento2#12970: Can't add grouped product, with out of stock …
p-bystritsky Jan 5, 2018
da05e92
magento/magento2#12970: Can't add grouped product, with out of stock …
p-bystritsky Jan 9, 2018
40600b9
magento/magento2#12970: Can't add grouped product, with out of stock …
p-bystritsky Jan 9, 2018
63c7fc9
magento/magento2#12970: Can't add grouped product, with out of stock …
p-bystritsky Jan 9, 2018
26b6a27
magento/magento2#12970: Can't add grouped product, with out of stock …
p-bystritsky Apr 2, 2018
03e7de4
FIX for issue #14849 - In Sales Emails no translation using order.get…
phoenix128 Apr 30, 2018
5d2b5be
FIX cs & docblock
phoenix128 May 28, 2018
1c9ce84
FIX CS
phoenix128 May 29, 2018
99c1408
Fix blocked a frame with origin
iGerchak Jul 17, 2018
e9451e0
Fix addExpressionFieldToSelect method generated columns get overwrite…
Aug 24, 2018
29680f7
Fix integration test
Sep 4, 2018
5a702ef
Fix variable name in test class too long
Sep 4, 2018
85660e6
magento/magento2#16887 Fix blocked a frame with origin
ihor-sviziev Sep 14, 2018
3bf066a
magento/magento2#16887 Fix blocked a frame with origin
ihor-sviziev Sep 14, 2018
7b4fc48
ENGCOM-2973: Fix blocked a frame with origin #16887
magento-engcom-team Sep 14, 2018
2556962
MAGETWO-95411: [Backport 2.2.x] Add the ability to install Magento wi…
Oct 2, 2018
775fd67
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-95411
Oct 2, 2018
000b459
MAGETWO-95411: [Backport 2.2.x] Add the ability to install Magento wi…
Oct 2, 2018
e603eda
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-95411
Oct 3, 2018
a6c1627
ENGCOM-3086: Fix/add expresion #17915
magento-engcom-team Oct 3, 2018
ee004f4
MAGETWO-93985: Magnifier does not work with Windows Chrome/FF
iivashchenko Sep 26, 2018
7aea9ef
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-93985
iivashchenko Oct 5, 2018
03698da
fix Fatal Error when save configurable product in Magento 2.2.5 #18082
thiagolima-bm Oct 8, 2018
38854b5
18082 fix phpunit
thiagolima-bm Oct 10, 2018
ac9e6e7
Merge remote-tracking branch 'origin/2.2-develop' into ENGCOM-970-mag…
p-bystritsky Oct 10, 2018
3e8d72a
ENGCOM-970: Fix integration test failures.
p-bystritsky Oct 10, 2018
0e45fe9
Merge branch '2.2-develop' into ENGCOM-970-magento-engcom-magento2ce-…
p-bystritsky Oct 11, 2018
382e550
issue #18617 in v2.2.6
mahesh-rajawat Oct 16, 2018
365df7e
MAGETWO-95497: Please check the shipping address information. Invalid…
viktym Oct 17, 2018
001788b
Merge branch 'MAGETWO-93985' into mpi-fix-1810
Oct 18, 2018
a077c31
Merge branch 'MAGETWO-95497' into mpi-fix-1810
Oct 18, 2018
4234492
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-95411
Oct 22, 2018
e40b9c7
Added tier price logic for special price
gelanivishal Oct 22, 2018
451b6ba
Fixed code standard error
gelanivishal Oct 23, 2018
b6ae756
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-95411
Oct 23, 2018
edf09b3
Update Tierprice.php
gelanivishal Oct 23, 2018
4209ac3
MAGETWO-94860: Moving Category generate duplicate url_rewrite when 4t…
rostyslav-hymon Oct 24, 2018
18ca5f0
Rework without method's contract modification for BW compatibility
phoenix128 Oct 24, 2018
bd80b1a
Missing strict compare in new method
phoenix128 Oct 24, 2018
2e634e4
Missing fallback on AREA_FRONTEND when area is not set
phoenix128 Oct 25, 2018
f0d6a81
MAGETWO-93947: Recently viewed block shows the product which is curre…
rostyslav-hymon Oct 25, 2018
102196b
MAGETWO-93988: Product Review "Save and Next" and "Save and Previous"…
yelahin-serhiy Oct 25, 2018
bf700aa
Issue #18150 fixed for 2.2.6
mahesh-rajawat Oct 25, 2018
d43759c
Backport [PR 18772] Remove unnecesary "header" block redeclaration
samuel27m Oct 25, 2018
2b2d4e2
Merge pull request #3 from samuel27m/samuel27m-patch-3
samuel27m Oct 25, 2018
992dfb6
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-93988
yelahin-serhiy Oct 26, 2018
5b0bab5
MAGETWO-93780: CAPTCHA does not appear in "Log in" popup window
yelahin-serhiy Oct 26, 2018
043d202
ENGCOM-3279: Issue Fixed: Backups error from User Roles Permission 2.…
magento-engcom-team Oct 26, 2018
5a84c5a
Fixed - Default tax region/state appears in customer & order data #16684
nirav-kadiya Oct 27, 2018
e4b430a
Update code for fixed issue #16684
nirav-kadiya Oct 29, 2018
a4bb0da
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-93988
yelahin-serhiy Oct 29, 2018
7ceea96
MAGETWO-93988: Product Review "Save and Next" and "Save and Previous"…
yelahin-serhiy Oct 29, 2018
0d2f7d4
ENGCOM-1429: FIX for issue #14849 - In Sales Emails no translation us…
magento-engcom-team Oct 29, 2018
ea8da0d
MAGETWO-93072: Value of Customer Address Attribute is not shown in th…
Oct 29, 2018
1f0e88c
Merge branch '2.2-develop' of github.com:magento/magento2ce into mpi-…
Oct 29, 2018
1226cb3
MAGETWO-69766: [Magento Cloud] - Cant flush Images cache in admin
yelahin-serhiy Oct 29, 2018
38164c3
merge magento/2.2-develop into magento-mpi/mpi-fix-1810
Oct 30, 2018
e94a423
ENGCOM-970: Fixed cast to integer.
p-bystritsky Oct 30, 2018
724b183
ENGCOM-3086: Fix/add expresion #17915
nmalevanec Oct 30, 2018
b51e3be
fixed js translation
torhoehn Oct 30, 2018
5b2560e
ENGCOM-3086: Fix/add expresion #17915. Add integration tests.
nmalevanec Oct 31, 2018
3cf8c8b
ENGCOM-3340: fixed js translation #18959
magento-engcom-team Oct 31, 2018
57c8546
ENGCOM-3341: Backport [PR 18772] Remove unnecesary 'header' block re…
magento-engcom-team Oct 31, 2018
ce1fd07
Merge branch '2.2-develop' into MAGETWO-93780
serhii-balko Oct 31, 2018
48e8b6d
Merge branch '2.2-develop' into MAGETWO-94860
serhii-balko Oct 31, 2018
070a6c1
MAGETWO-95846: Customer Cart Checkout error
Oct 31, 2018
4f602cc
MAGETWO-95846: Customer Cart Checkout error
Oct 31, 2018
729879a
Merge branch '2.2-develop' into MAGETWO-93780
serhii-balko Nov 1, 2018
6629445
Added form fieldset before html to \Magento\Framework\Data\Form\Eleme…
Oct 25, 2018
aee1626
ENGCOM-3359: [Backport] Added form fieldset before html data to \Mage…
magento-engcom-team Nov 1, 2018
54913bd
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-93072
Nov 1, 2018
927ba83
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-93780
yelahin-serhiy Nov 1, 2018
09bd229
Update Tierprice.php
gelanivishal Nov 1, 2018
468f245
Merge pull request #1 from magento/2.2-develop
RostislavS Nov 1, 2018
8984894
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-93780
yelahin-serhiy Nov 1, 2018
f6eb7fb
Fix translations of category design theme not being applied
cezary-zeglen Aug 24, 2018
8c98e82
Remove duplicated selector
dmytro-ch Oct 28, 2018
1c7b6cc
MAGETWO-95461: Cannot save product with Tier Prices
nikita-shcherbatykh Nov 2, 2018
0a1a807
MAGETWO-95461: Cannot save product with Tier Prices
nikita-shcherbatykh Nov 2, 2018
2a44ced
Merge remote-tracking branch 'origin/MAGETWO-69766' into 2.2-develop-pr8
serhii-balko Nov 2, 2018
c8d3560
Merge remote-tracking branch 'origin/MAGETWO-93988' into 2.2-develop-pr8
serhii-balko Nov 2, 2018
eaf6daf
Merge remote-tracking branch 'origin/MAGETWO-93947' into 2.2-develop-pr8
serhii-balko Nov 2, 2018
b6c7278
Merge remote-tracking branch 'origin/MAGETWO-95846' into 2.2-develop-pr8
serhii-balko Nov 2, 2018
4c13ad7
#18348 - In admin, last swatch option set to default upon save
RostislavS Nov 2, 2018
9240974
Merge remote-tracking branch 'origin/MAGETWO-95461' into 2.2-develop-pr8
serhii-balko Nov 2, 2018
995b847
Merge branch '2.2-develop' into 2.2-develop-pr8
serhii-balko Nov 2, 2018
429815b
magento/magento2#18323: Order confirmation email for guest checkout d…
Nov 2, 2018
52bfffc
magento/magento2#14007:
vpodorozh Nov 2, 2018
b56dc3d
Merge branch '2.2-develop' into 2.2-develop-pr8
serhii-balko Nov 5, 2018
ea8eed3
Merge branch '2.2-develop' of github.com:magento/magento2ce into mpi-…
Nov 5, 2018
d3c36ea
MAGETWO-94423: Admin users are deleted from role upon Role save
Nov 5, 2018
cd04622
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-94423
Nov 5, 2018
945ae9d
ENGCOM-3383: #18348 - In admin, last swatch option set to default upo…
magento-engcom-team Nov 5, 2018
825b3a9
ENGCOM-3385: magento/magento2#18323: Order confirmation email for gue…
magento-engcom-team Nov 5, 2018
35cadc6
ENGCOM-3388: [2.2-develop] magento/magento2#14007: 'Use in Layered Na…
magento-engcom-team Nov 5, 2018
9bce70e
MAGETWO-94423: Admin users are deleted from role upon Role save
Nov 5, 2018
806f784
ENGCOM-3319: Fixed - Default tax region/state appears in customer & o…
magento-engcom-team Nov 5, 2018
dbd0ede
ENGCOM-3392: Fixed tierprice discount not calculated correctly if has…
magento-engcom-team Nov 5, 2018
2dd7aad
ENGCOM-3394: Issue Fixed: Missing Fixed Product Tax total on PDF #18649
magento-engcom-team Nov 5, 2018
0d99fa8
Merge pull request #3385 from magento-mpi/mpi-fix-1810
Nov 5, 2018
c8ead23
magento/magento2#19071: Password strength indicator shows No Password…
dimasalamatov Nov 5, 2018
0dedb75
merge magento/2.2-develop into magento-tsg-csl3/2.2-develop-pr8
Nov 6, 2018
a5a0b0b
fix issue 12399
Mardl Oct 6, 2018
3bb920a
ENGCOM-3396: [Backport] Fix for #12399: Exception Error in Catalog Pr…
magento-engcom-team Nov 6, 2018
b224170
ENGCOM-3385: magento/magento2#18323: Order confirmation email for gue…
Nov 6, 2018
9539ede
ENGCOM-3383: #18348 - In admin, last swatch option set to default upo…
Nov 6, 2018
8223ea0
ENGCOM-3341: Backport [PR 18772] Remove unnecesary "header" block re…
Nov 6, 2018
961a58f
ENGCOM-3319: Fixed - Default tax region/state appears in customer & o…
Nov 6, 2018
461b64a
ENGCOM-2973: Fix blocked a frame with origin #16887
Nov 6, 2018
13c1f7d
ENGCOM-970: magento/magento2#12970: Can't add grouped product, with o…
Nov 6, 2018
8d15424
Merge branch '2.2-develop' into 2.2-develop-pr8
serhii-balko Nov 6, 2018
b1fcdca
Merge remote-tracking branch 'origin/2.2-develop-pr8' into 2.2-develo…
serhii-balko Nov 6, 2018
1c3e2a9
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-93780
yelahin-serhiy Nov 6, 2018
0901682
magento-engcom/magento2ce#2308: Code style fixes
Nov 6, 2018
2f791bb
ENGCOM-3400: [Backport] Remove duplicated CSS selector #19002
magento-engcom-team Nov 6, 2018
965a522
magento-engcom/magento2ce#2308: Code style fixes
Nov 6, 2018
87c76df
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Nov 6, 2018
a651b31
magento/magento#18901: Forgot password form should not available whil…
Nov 6, 2018
d2392b1
MQE-1339: Bump MFTF version in Magento
KevinBKozan Nov 6, 2018
9b784ba
ENGCOM-3404: magento/magento2#19071: Password strength indicator show…
magento-engcom-team Nov 7, 2018
5f66391
ENGCOM-3405: magento/magento#18901: Forgot password form should not a…
magento-engcom-team Nov 7, 2018
b3c356d
ENGCOM-3135: fix Fatal Error when save configurable product in Magen…
magento-engcom-team Nov 7, 2018
fe08289
Merge branch '2.2-develop' into 2.2-develop-pr8
serhii-balko Nov 7, 2018
0822bd7
Merge pull request #3416 from magento-tsg-csl3/2.2-develop-pr8
viktym Nov 7, 2018
1070432
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-93780
yelahin-serhiy Nov 7, 2018
e67d688
MAGETWO-93780: CAPTCHA does not appear in "Log in" popup window
yelahin-serhiy Nov 7, 2018
101c16c
MAGETWO-95990: Customer address issue when creating or updating via API
yelahin-serhiy Nov 7, 2018
8967c15
ENGCOM-3400: [Backport] Remove duplicated CSS selector #19002
Nov 7, 2018
72397c0
ENGCOM-3396: [Backport] Fix for #12399: Exception Error in Catalog Pr…
Nov 7, 2018
55a63c8
ENGCOM-3388: [2.2-develop] magento/magento2#14007: "Use in Layered Na…
Nov 7, 2018
cad3223
ENGCOM-3359: [Backport] Added form fieldset before html data to \Mage…
Nov 7, 2018
512ad88
MAGETWO-94860: Moving Category generate duplicate url_rewrite when 4t…
serhii-balko Nov 7, 2018
27dc8e8
Fixed static failure
Nov 7, 2018
106fe00
ENGCOM-1429: Fix order history status.
p-bystritsky Nov 7, 2018
ca21231
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Nov 7, 2018
252a0ed
magento/magento2#18840: Invalid Unit Test Annotations.
Nov 7, 2018
35c2345
Add additional check if password hash is empty in auth process
progreg Nov 5, 2018
ee5bf49
ENGCOM-3410: magento/magento2#18840: Invalid Unit Test Annotations. #…
magento-engcom-team Nov 8, 2018
16e2280
ENGCOM-3411: [Backport] Add additional check if password hash is empt…
magento-engcom-team Nov 8, 2018
e2c229f
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-95411
Nov 8, 2018
740f9d2
Add/update newsletter messages in translation file
arnoudhgz Nov 2, 2018
ade482b
ENGCOM-3414: [Backport] Add/update newsletter messages in translation…
magento-engcom-team Nov 8, 2018
3985d62
ENGCOM-3415: Fix translations of category design theme not being appl…
magento-engcom-team Nov 8, 2018
3c868a5
ENGCOM-3411: [Backport] Add additional check if password hash is empt…
Nov 9, 2018
566291b
ENGCOM-3410: magento/magento2#18840: Invalid Unit Test Annotations. #…
Nov 9, 2018
40e7e50
ENGCOM-3405: magento/magento#18901: Forgot password form should not a…
Nov 9, 2018
5283582
ENGCOM-3404: magento/magento2#19071: Password strength indicator show…
Nov 9, 2018
9daf711
ENGCOM-3394: Issue Fixed: Missing Fixed Product Tax total on PDF #18649
Nov 9, 2018
1da0438
ENGCOM-3279: Issue Fixed: Backups error from User Roles Permission 2.…
Nov 9, 2018
03a7cbb
ENGCOM-3135: fix Fatal Error when save configurable product in Magen…
Nov 9, 2018
c825d3a
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Nov 9, 2018
17f7686
Merge pull request #3339 from magento-thunder/MAGETWO-95411
Nov 9, 2018
5dd5cc0
Merge remote-tracking branch 'origin/2.2-develop' into 2.2-dev-pan-2.…
KevinBKozan Nov 9, 2018
51aa64f
MQE-1339: Bump MFTF version in Magento
KevinBKozan Nov 9, 2018
e98a94f
MQE-1339: Bump MFTF version in Magento
KevinBKozan Nov 9, 2018
135c0b8
ENGCOM-3415: Fix translations of category design theme not being appl…
Nov 12, 2018
a934881
ENGCOM-3414: [Backport] Add/update newsletter messages in translation…
Nov 12, 2018
4adab69
ENGCOM-3392: Fixed tierprice discount not calculated correctly if has…
Nov 12, 2018
4aa7957
ENGCOM-3340: fixed js translation #18959
Nov 12, 2018
4c86381
ENGCOM-3086: Fix/add expresion #17915
Nov 12, 2018
77cabe8
ENGCOM-1429: FIX for issue #14849 - In Sales Emails no translation us…
Nov 12, 2018
c5571ed
MAGETWO-94860: Moving Category generate duplicate url_rewrite when 4t…
serhii-balko Nov 12, 2018
066c396
Merge branch 'MAGETWO-94860' into 2.2-develop-pr11
serhii-balko Nov 12, 2018
784940c
Merge remote-tracking branch 'origin/MAGETWO-94423' into 2.2-develop-…
serhii-balko Nov 12, 2018
0be69c9
Merge remote-tracking branch 'origin/MAGETWO-93072' into 2.2-develop-…
serhii-balko Nov 12, 2018
f286e17
Merge remote-tracking branch 'origin/MAGETWO-93780' into 2.2-develop-…
serhii-balko Nov 12, 2018
2365286
Merge remote-tracking branch 'origin/MAGETWO-95990' into 2.2-develop-…
serhii-balko Nov 12, 2018
7695e8d
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Nov 12, 2018
d540a3c
Merge branch '2.2-develop' into 2.2-develop-pr9
serhii-balko Nov 12, 2018
878082b
merge magento/2.2-develop into magento-pangolin/2.2-dev-pan-2.3.10
magento-cicd2 Nov 12, 2018
0fa19b7
Merge pull request #3422 from magento-pangolin/2.2-dev-pan-2.3.10
okolesnyk Nov 12, 2018
28ac31a
Merge branch '2.2-develop' into 2.2-develop-pr9
serhii-balko Nov 13, 2018
1dcba87
Merge pull request #3439 from magento-tsg-csl3/2.2-develop-pr9
viktym Nov 13, 2018
c864c30
MQE-1339: Bump MFTF version in Magento
KevinBKozan Nov 13, 2018
06aca23
Merge pull request #3446 from magento-pangolin/2.2-dev-pan-2.3.11
okolesnyk Nov 13, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/code/Magento/Backup/Controller/Adminhtml/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class Index extends \Magento\Backend\App\Action
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Backend::backup';
const ADMIN_RESOURCE = 'Magento_Backup::backup';

/**
* Core registry
Expand Down
30 changes: 20 additions & 10 deletions app/code/Magento/Captcha/Model/Customer/Plugin/AjaxLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
namespace Magento\Captcha\Model\Customer\Plugin;

use Magento\Captcha\Helper\Data as CaptchaHelper;
use Magento\Framework\Session\SessionManagerInterface;
use Magento\Customer\Controller\Ajax\Login;
use Magento\Framework\Controller\Result\Json;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Framework\Session\SessionManagerInterface;

/**
* The plugin for ajax login controller.
*/
class AjaxLogin
{
/**
Expand Down Expand Up @@ -61,14 +66,14 @@ public function __construct(
}

/**
* @param \Magento\Customer\Controller\Ajax\Login $subject
* Validates captcha during request execution.
*
* @param Login $subject
* @param \Closure $proceed
* @return $this
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function aroundExecute(
\Magento\Customer\Controller\Ajax\Login $subject,
Login $subject,
\Closure $proceed
) {
$captchaFormIdField = 'captcha_form_id';
Expand All @@ -93,26 +98,31 @@ public function aroundExecute(
foreach ($this->formIds as $formId) {
if ($formId === $loginFormId) {
$captchaModel = $this->helper->getCaptcha($formId);

if ($captchaModel->isRequired($username)) {
$captchaModel->logAttempt($username);
if (!$captchaModel->isCorrect($captchaString)) {
$this->sessionManager->setUsername($username);
return $this->returnJsonError(__('Incorrect CAPTCHA'));
$captchaModel->logAttempt($username);
return $this->returnJsonError(__('Incorrect CAPTCHA'), true);
}
}

$captchaModel->logAttempt($username);
}
}
return $proceed();
}

/**
* Gets Json response.
*
* @param \Magento\Framework\Phrase $phrase
* @return \Magento\Framework\Controller\Result\Json
* @param bool $isCaptchaRequired
* @return Json
*/
private function returnJsonError(\Magento\Framework\Phrase $phrase): \Magento\Framework\Controller\Result\Json
private function returnJsonError(\Magento\Framework\Phrase $phrase, bool $isCaptchaRequired = false): Json
{
$resultJson = $this->resultJsonFactory->create();
return $resultJson->setData(['errors' => true, 'message' => $phrase]);
return $resultJson->setData(['errors' => true, 'message' => $phrase, 'captcha' => $isCaptchaRequired]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function testAroundExecuteIncorrectCaptcha()
$this->resultJsonMock
->expects($this->once())
->method('setData')
->with(['errors' => true, 'message' => __('Incorrect CAPTCHA')])
->with(['errors' => true, 'message' => __('Incorrect CAPTCHA'), 'captcha' => true])
->will($this->returnSelf());

$closure = function () {
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Captcha/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</arguments>
</type>
<type name="Magento\Customer\Controller\Ajax\Login">
<plugin name="configurable_product" type="Magento\Captcha\Model\Customer\Plugin\AjaxLogin" sortOrder="50" />
<plugin name="captcha_validation" type="Magento\Captcha\Model\Customer\Plugin\AjaxLogin" sortOrder="50" />
</type>
<type name="Magento\Captcha\Model\Customer\Plugin\AjaxLogin">
<arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ define([
imageSource: ko.observable(captchaData.imageSrc),
visibility: ko.observable(false),
captchaValue: ko.observable(null),
isRequired: captchaData.isRequired,
isRequired: ko.observable(captchaData.isRequired),
isCaseSensitive: captchaData.isCaseSensitive,
imageHeight: captchaData.imageHeight,
refreshUrl: captchaData.refreshUrl,
Expand All @@ -41,7 +41,7 @@ define([
* @return {Boolean}
*/
getIsVisible: function () {
return this.visibility;
return this.visibility();
},

/**
Expand All @@ -55,14 +55,14 @@ define([
* @return {Boolean}
*/
getIsRequired: function () {
return this.isRequired;
return this.isRequired();
},

/**
* @param {Boolean} flag
*/
setIsRequired: function (flag) {
this.isRequired = flag;
this.isRequired(flag);
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ define([
return this.currentCaptcha !== null ? this.currentCaptcha.getIsRequired() : false;
},

/**
* @param {Boolean} flag
*/
setIsRequired: function (flag) {
this.currentCaptcha.setIsRequired(flag);
},

/**
* @return {Boolean}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,44 @@
*/

define([
'Magento_Captcha/js/view/checkout/defaultCaptcha',
'Magento_Captcha/js/model/captchaList',
'Magento_Customer/js/action/login'
],
function (defaultCaptcha, captchaList, loginAction) {
'use strict';

return defaultCaptcha.extend({
/** @inheritdoc */
initialize: function () {
var self = this,
currentCaptcha;

this._super();
currentCaptcha = captchaList.getCaptchaByFormId(this.formId);

if (currentCaptcha != null) {
currentCaptcha.setIsVisible(true);
this.setCurrentCaptcha(currentCaptcha);

loginAction.registerLoginCallback(function (loginData) {
if (loginData['captcha_form_id'] &&
loginData['captcha_form_id'] == self.formId //eslint-disable-line eqeqeq
) {
'underscore',
'Magento_Captcha/js/view/checkout/defaultCaptcha',
'Magento_Captcha/js/model/captchaList',
'Magento_Customer/js/action/login'
],
function (_, defaultCaptcha, captchaList, loginAction) {
'use strict';

return defaultCaptcha.extend({
/** @inheritdoc */
initialize: function () {
var self = this,
currentCaptcha;

this._super();
currentCaptcha = captchaList.getCaptchaByFormId(this.formId);

if (currentCaptcha != null) {
currentCaptcha.setIsVisible(true);
this.setCurrentCaptcha(currentCaptcha);

loginAction.registerLoginCallback(function (loginData, response) {
if (!loginData['captcha_form_id'] || loginData['captcha_form_id'] !== self.formId) {
return;
}

if (_.isUndefined(response) || !response.errors) {
return;
}

// check if captcha should be required after login attempt
if (!self.isRequired() && response.captcha && self.isRequired() !== response.captcha) {
self.setIsRequired(response.captcha);
}

self.refresh();
}
});
});
}
}
}
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
* See COPYING.txt for license details.
*/
-->
<!-- ko if: (getIsVisible())-->
<input name="captcha_form_id" type="hidden" data-bind="value: formId, attr: {'data-scope': dataScope}" />
<!-- /ko -->
<!-- ko if: (isRequired() && getIsVisible())-->
<div class="field captcha required" data-bind="blockLoader: getIsLoading()">
<label data-bind="attr: {for: 'captcha_' + formId}" class="label"><span data-bind="i18n: 'Please type the letters and numbers below'"></span></label>
<div class="control captcha">
<input name="captcha_string" type="text" class="input-text required-entry" data-bind="value: captchaValue(), attr: {id: 'captcha_' + formId, 'data-scope': dataScope}" autocomplete="off"/>
<input name="captcha_form_id" type="hidden" data-bind="value: formId, attr: {'data-scope': dataScope}" />
<input name="captcha_string" type="text" class="input-text required-entry" data-bind="value: captchaValue(), attr: {'data-scope': dataScope}" autocomplete="off"/>
<div class="nested">
<div class="field captcha no-label">
<div class="control captcha-image">
Expand Down
19 changes: 13 additions & 6 deletions app/code/Magento/Catalog/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Store\Model\ScopeInterface;
use Magento\Customer\Model\Session as CustomerSession;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Pricing\PriceCurrencyInterface;
Expand Down Expand Up @@ -269,7 +270,8 @@ public function setStoreId($store)

/**
* Return current category path or get it from current category
* and creating array of categories|product paths for breadcrumbs
*
* Creating array of categories|product paths for breadcrumbs
*
* @return array
*/
Expand Down Expand Up @@ -378,6 +380,7 @@ public function getLastViewedUrl()

/**
* Split SKU of an item by dashes and spaces
*
* Words will not be broken, unless this length is greater than $length
*
* @param string $sku
Expand Down Expand Up @@ -406,14 +409,15 @@ public function getAttributeHiddenFields()
/**
* Retrieve Catalog Price Scope
*
* @return int
* @return int|null
*/
public function getPriceScope()
{
return $this->scopeConfig->getValue(
$priceScope = $this->scopeConfig->getValue(
self::XML_PATH_PRICE_SCOPE,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
ScopeInterface::SCOPE_STORE
);
return isset($priceScope) ? (int)$priceScope : null;
}

/**
Expand Down Expand Up @@ -449,7 +453,7 @@ public function isUrlDirectivesParsingAllowed()
{
return $this->scopeConfig->isSetFlag(
self::CONFIG_PARSE_URL_DIRECTIVES,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
ScopeInterface::SCOPE_STORE,
$this->_storeId
);
}
Expand All @@ -466,19 +470,22 @@ public function getPageTemplateProcessor()

/**
* Whether to display items count for each filter option
*
* @param int $storeId Store view ID
* @return bool
*/
public function shouldDisplayProductCountOnLayer($storeId = null)
{
return $this->scopeConfig->isSetFlag(
self::XML_PATH_DISPLAY_PRODUCT_COUNT,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
ScopeInterface::SCOPE_STORE,
$storeId
);
}

/**
* Convert tax address array to address data object with country id and postcode
*
* @param array $taxAddress
* @return \Magento\Customer\Api\Data\AddressInterface|null
*/
Expand Down
13 changes: 12 additions & 1 deletion app/code/Magento/Catalog/Model/Design.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Catalog\Model;

use \Magento\Framework\TranslateInterface;

/**
* Catalog Custom Category design Model
*
Expand All @@ -31,6 +33,11 @@ class Design extends \Magento\Framework\Model\AbstractModel
*/
protected $_localeDate;

/**
* @var TranslateInterface
*/
private $translator;

/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
Expand All @@ -47,10 +54,13 @@ public function __construct(
\Magento\Framework\View\DesignInterface $design,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
array $data = [],
TranslateInterface $translator = null
) {
$this->_localeDate = $localeDate;
$this->_design = $design;
$this->translator = $translator ?:
\Magento\Framework\App\ObjectManager::getInstance()->get(TranslateInterface::class);
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}

Expand All @@ -63,6 +73,7 @@ public function __construct(
public function applyCustomDesign($design)
{
$this->_design->setDesignTheme($design);
$this->translator->loadData(null, true);
return $this;
}

Expand Down
Loading