Skip to content

[Backport] Fix meta title property #1

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

Closed
wants to merge 180 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
a97cc6d
prevent layout cache corruption
scottsb Nov 15, 2017
ae09d7d
Fixed condition with usage isPost method
pusachev Dec 11, 2017
95b2c36
Add wrapper function for newrelic_set_appname
mpchadwick Dec 31, 2017
48066b2
Add setting
mpchadwick Dec 31, 2017
7ceace8
Add method to consult setting
mpchadwick Dec 31, 2017
0b68496
Add mechanics for separate appnames
mpchadwick Dec 31, 2017
e186221
Add type hint
mpchadwick Feb 27, 2018
dc48306
Log exceptions
mpchadwick Feb 27, 2018
bef36de
Update returns
mpchadwick Feb 27, 2018
edd6062
Add a link to the success message when adding a product to the compar…
avstudnitz Feb 27, 2018
6c17f99
Renaming to avoid duplication
avstudnitz Feb 27, 2018
8141f17
Add a test
mpchadwick Mar 2, 2018
06fd0cc
MAGETWO-84109: Prevent layout cache corruption in edge case #12314
magento-engcom-team Apr 24, 2018
4c1bd49
Merge branch '2.2-develop' into compare-success-message
avstudnitz Apr 25, 2018
0d35081
[TASK] Solve issue #14966 - Disabling product does not remove it from…
lewisvoncken May 5, 2018
c6196d7
[TASK] Cleaned up incorrect dependency injection
lewisvoncken May 5, 2018
2d6fb62
[TASK] Updated according to Codacy/PR Quality Review
lewisvoncken May 6, 2018
38bd9d3
[TASK] Updated the Unit Test according to issue-14966
lewisvoncken May 6, 2018
219024c
Disabling product doesn't remove from flat table
ishakhsuvarov May 7, 2018
965dc7e
ENGCOM-1463: [TASK] Solve issue #14966 - Disabling product does not r…
magento-engcom-team May 7, 2018
ca36872
ENGCOM-1463: Merge branch '2.2-develop' of github.com:magento-engcom/…
ishakhsuvarov May 10, 2018
d514d3e
MAGETWO-84109: Merge branch '2.2-develop' of github.com:magento-engco…
ishakhsuvarov May 10, 2018
8c9f80b
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 15, 2018
ee371d8
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi May 16, 2018
01414fc
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 16, 2018
d43ef9c
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 16, 2018
72ce41b
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 16, 2018
db0610a
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 17, 2018
2807b40
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi May 17, 2018
9eb81c7
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 17, 2018
ab15b4b
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 17, 2018
d6ad92b
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 17, 2018
eb5cd29
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 17, 2018
becbf6a
Fix typo in test method's name and test result
dmytro-ch May 18, 2018
e695b68
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi May 18, 2018
d357f04
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 18, 2018
6ad9c03
issue/14056 - Coupon API not working for guest user
May 18, 2018
788485a
ISSUE-11477 - fixed Swagger response for searchCriteria - added zero …
May 18, 2018
704db1b
ENGCOM-1589: Fix typo in test method's name and test result #15297
magento-engcom-team May 20, 2018
c72586c
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi May 23, 2018
161b17a
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 23, 2018
8b7bb58
issue/14056 - Coupon API not working for guest user - adjusted unit t…
May 24, 2018
59e03c1
FIX fo rissue #15510 - First PDF download / export after login
phoenix128 May 26, 2018
24d7d4a
Fix indentation
mpchadwick May 28, 2018
eae2159
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi May 29, 2018
4e1c50c
MAGETWO-91840: Unable to log in when guest checkout is disabled and C…
May 29, 2018
2a42863
MAGETWO-91840: Unable to log in when guest checkout is disabled and C…
May 29, 2018
5ccd995
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGE…
May 29, 2018
a87d8f1
MAGETWO-89971: [B2B] The product total price value on the second webs…
viktym May 25, 2018
9c59b1e
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi May 30, 2018
1ae4336
MAGETWO-91840: Unable to log in when guest checkout is disabled and C…
May 30, 2018
8d680e5
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGE…
May 31, 2018
6f74b6e
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 31, 2018
2d2a166
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi May 31, 2018
e503bce
MAGETWO-91840: Unable to log in when guest checkout is disabled and C…
May 31, 2018
7b96714
MAGETWO-91840: Unable to log in when guest checkout is disabled and C…
May 31, 2018
d16e29c
MAGETWO-89220: Cart rule using subselection condition incorrectly giv…
viktym May 31, 2018
56bcffb
Merge pull request #2 from magento/2.2-develop
ankurvr Jun 1, 2018
c25c648
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi May 31, 2018
bd86e37
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi Jun 1, 2018
312e47c
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi Jun 1, 2018
5471bc3
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi Jun 1, 2018
169b45e
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi Jun 1, 2018
697a5fd
MAGETWO-91840: Unable to log in when guest checkout is disabled and C…
Jun 1, 2018
b859387
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGE…
Jun 1, 2018
1c1e277
Wrong Last orders amount on dashboard #15660
ankurvr Jun 1, 2018
1847901
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi Jun 1, 2018
718c71f
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi Jun 1, 2018
59f6edb
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi Jun 1, 2018
7b8fe3d
#15588
StevenGuapaBV Jun 2, 2018
629f650
Merge branch '2.2-develop' into fix/2.2-typo-in-test-method-name-and-…
dmytro-ch Jun 2, 2018
7715d65
Restore the deprecated method
dmytro-ch Jun 2, 2018
498047c
#15588 Refactor for code neatness Travis CI.
StevenGuapaBV Jun 2, 2018
cf7176d
Add missing property, add missing throws to PHPDocs
dmytro-ch Jun 2, 2018
63ed864
Update for Codacy removed whitespace
StevenGuapaBV Jun 3, 2018
9e003e6
ENGCOM-1785: [Backport 2.2] Fix minor issues in ui export converter c…
magento-engcom-team Jun 3, 2018
83ad777
#15588 Fixed incorrect image urls sitemap
StevenGuapaBV Jun 3, 2018
67778cd
[Resolved : Styling <select> by changing less variables in Luma theme…
hitesh-wagento Jun 4, 2018
605dca2
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGE…
Jun 4, 2018
f0adee4
ENGCOM-1805: [Resolved : Styling <select> by changing less variables …
magento-engcom-team Jun 4, 2018
64f074a
MAGETWO-87969: Newsletter subscription is not correctly updated when …
Jun 4, 2018
af93797
MAGETWO-91840: Unable to log in when guest checkout is disabled and C…
Jun 4, 2018
8a72af8
Fix translations #15623 Backport 2.2
VitaliyBoyko Jun 4, 2018
1cd748f
Removed unnecessary css.
chirag-wagento Jun 5, 2018
b646e61
Removed unused class from forms less file.
chirag-wagento Jun 5, 2018
9923e6a
Remove double semicolon from the style sheets.
sanganinamrata Jun 5, 2018
b31d31d
Merge branch 'MAGETWO-89971' into MPI-PR-060618
Jun 5, 2018
e68df31
Merge branch 'MAGETWO-89220' into MPI-PR-060618
Jun 5, 2018
cc32f91
ENGCOM-1850: Remove double semicolon from the style sheets. #15795
magento-engcom-team Jun 5, 2018
27f1c88
ENGCOM-1853: Removed unused class from forms less file. #15791
magento-engcom-team Jun 5, 2018
c0670a7
ENGCOM-1855: [Backport 2.2]Fix translations #15782
magento-engcom-team Jun 5, 2018
73afa84
Added @see tag to the deprecated method
rogyar Jun 5, 2018
7950e1b
ENGCOM-1858: FIX fo rissue #15510 - First PDF download / export after…
magento-engcom-team Jun 5, 2018
68e516c
ENGCOM-1860: Add Ability To Separate Frontend / Adminhtml in New Reli…
magento-engcom-team Jun 5, 2018
bc0cccd
ENGCOM-1861: Removed unnecessary css. #15789
magento-engcom-team Jun 5, 2018
83a8dea
Add missing table aliases to fields mapping for Customer Group filter…
Jun 5, 2018
e5acc92
Fixed set template syntax issue
sanganinamrata Jun 5, 2018
a868d0d
ENGCOM-1864: Add missing table aliases to fields mapping for Customer…
magento-engcom-team Jun 5, 2018
4af80a2
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi Jun 4, 2018
44084c9
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi Jun 5, 2018
f7a1413
ENGCOM-1867: Fixed Wrong order amount on dashboard on Last orders lis…
magento-engcom-team Jun 5, 2018
79d1ede
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi Jun 5, 2018
7d2d8cc
Fix for issue 911 found on MSI project - Cannot read property source_…
phoenix128 Apr 22, 2018
e9cac53
ENGCOM-1869: [Backport] Fix for issue 911 found on MSI project - Cann…
magento-engcom-team Jun 5, 2018
3bbc3a0
Fix for css check.
VladimirZaets Jun 5, 2018
ed03001
ENGCOM-1858: FIX fo rissue #15510 - First PDF download / export after…
Jun 5, 2018
0910051
ENGCOM-1853: Removed unused class from forms less file. #15791
Jun 5, 2018
ab48069
ENGCOM-1850: Remove double semicolon from the style sheets. #15795
Jun 5, 2018
bc146a5
ENGCOM-1805: [Resolved : Styling <select> by changing less variables …
Jun 5, 2018
0e9c2fc
ENGCOM-1785: [Backport 2.2] Fix minor issues in ui export converter c…
Jun 5, 2018
ad6355d
[EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Jun 5, 2018
06961c2
Merge remote-tracking branch 'origin/MAGETWO-87969' into pr1
Jun 5, 2018
f587cf0
Merge remote-tracking branch 'origin/MAGETWO-91840' into pr1
Jun 5, 2018
0844268
ENGCOM-1875: Fixed condition with usage 'hack' isPostRequest method #…
magento-engcom-team Jun 5, 2018
25253bb
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi Jun 5, 2018
8bf7999
Fixed return type hinting in DocBlocks
rogyar Jun 5, 2018
18a56b9
ENGCOM-1863: Fixed set template syntax issue #15825
magento-engcom-team Jun 5, 2018
19446be
ENGCOM-1878: [Backport 2.2] Fixed return type hinting in DocBlocks fo…
magento-engcom-team Jun 5, 2018
66a09a3
MAGETWO-92468: Make PR tests namespace-agnostic to support testing ex…
pdohogne-magento Jun 5, 2018
ce6cc31
chore: remove unused less import
DanielRuf Jun 5, 2018
4e69546
ENGCOM-1880: chore: remove unused less import #15871
magento-engcom-team Jun 5, 2018
6a490a8
#15588 Fixed incorrect image urls in multistore xml sitemap
StevenGuapaBV Jun 6, 2018
0536a7e
ENGCOM-1885: issue/14056 - Coupon API not working for guest user #15320
magento-engcom-team Jun 6, 2018
cfacf04
ENGCOM-1887: ISSUE-11477 - fixed Swagger response for searchCriteria …
magento-engcom-team Jun 6, 2018
f1dd4e8
magento/magento2#15588: Remove extra line from if
dmanners Jun 6, 2018
725433a
MAGETWO-84109: Prevent layout cache corruption in edge case #12314
Jun 6, 2018
7131513
ENGCOM-1880: chore: remove unused less import #15871
Jun 6, 2018
a2fb71e
ENGCOM-1878: [Backport 2.2] Fixed return type hinting in DocBlocks fo…
Jun 6, 2018
5172253
ENGCOM-1869: [Backport] Fix for issue 911 found on MSI project - Cann…
Jun 6, 2018
e152f73
ENGCOM-1863: Fixed set template syntax issue #15825
Jun 6, 2018
56b585a
ENGCOM-1861: Removed unnecessary css. #15789
Jun 6, 2018
1ae4aa6
ENGCOM-1855: [Backport 2.2]Fix translations #15782
Jun 6, 2018
d325d84
MAGETWO-86125: Sorting on price of configurable products in catalog n…
dhorytskyi Jun 6, 2018
d792627
Merge branch '2.2-develop' of github.com:magento/magento2ce into MPI-…
Jun 6, 2018
0eff39c
Correct typo correction js files
Jun 6, 2018
b7f8d28
magento/magenot2#15588: add dependency in a backwards compatible way
dmanners Jun 6, 2018
ec41e34
ENGCOM-1866: #15588 Fixed incorrect image urls in multistore xml site…
magento-engcom-team Jun 6, 2018
0757a81
No need to pass method parameter as method definition does not requir…
Jun 6, 2018
811bf10
Wrong annotation in _toOptionArray : lib\internal\Magento\Framework\D…
sanganinamrata Jun 6, 2018
27df0e9
Wrong annotation in _toOptionArray : lib\internal\Magento\Framework\D…
sanganinamrata Jun 6, 2018
1693e09
ENGCOM-1853: Removed unused class from forms less file. #15791
Jun 6, 2018
0d9a4e3
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
VladimirZaets Jun 6, 2018
cdf5c1d
ENGCOM-1897: Correct typo correction js files #15888
magento-engcom-team Jun 6, 2018
019f17d
ENGCOM-1887: ISSUE-11477 - fixed Swagger response for searchCriteria …
Jun 7, 2018
b65ce53
ENGCOM-1885: issue/14056 - Coupon API not working for guest user #15320
Jun 7, 2018
524ebd1
ENGCOM-1875: Fixed condition with usage "hack" isPostRequest method #…
Jun 7, 2018
62c437c
ENGCOM-1867: Fixed Wrong order amount on dashboard on Last orders lis…
Jun 7, 2018
b39e534
ENGCOM-1866: #15588 Fixed incorrect image urls in multistore xml site…
Jun 7, 2018
dc3d9fd
ENGCOM-1864: Add missing table aliases to fields mapping for Customer…
Jun 7, 2018
c038410
ENGCOM-1860: Add Ability To Separate Frontend / Adminhtml in New Reli…
Jun 7, 2018
7ecb8e4
ENGCOM-1463: [TASK] Solve issue #14966 - Disabling product does not r…
Jun 7, 2018
bf87d09
Merge remote-tracking branch 'origin/ENGCOM-1589-magento-magento2-152…
Jun 7, 2018
2f1a57e
ENGCOM-1051: Add compare list link to success message after adding a …
magento-engcom-team Jun 7, 2018
62e6d54
ENGCOM-1589: Fix typo in test method's name and test result #15297
magento-engcom-team Jun 7, 2018
6d1ac43
Merge remote-tracking branch 'origin/ENGCOM-1589-magento-magento2-152…
Jun 7, 2018
00c6b48
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
VladimirZaets Jun 7, 2018
e40e86a
Merge branch '2.2-develop' of github.com:magento/magento2ce into MPI-…
Jun 7, 2018
5899dc1
Merge remote-tracking branch 'mainline/2.2-develop' into pr1
Jun 7, 2018
343aeef
ENGCOM-1915: Wrong annotation in _toOptionArray : lib\internal\Magent…
magento-engcom-team Jun 7, 2018
ba5d5b1
ENGCOM-1916: Remove parameter from method calling #15891
magento-engcom-team Jun 7, 2018
2730aac
ENGCOM-1916: Remove parameter from method calling #15891
Jun 7, 2018
cfef507
ENGCOM-1915: Wrong annotation in _toOptionArray : lib\internal\Magent…
Jun 7, 2018
b72091d
ENGCOM-1897: Correct typo correction js files #15888
Jun 7, 2018
e994129
ENGCOM-1051: Add compare list link to success message after adding a …
Jun 7, 2018
c6dcbb0
Merge pull request #2655 from magento-chaika/pr1
Jun 7, 2018
7e853f8
Merge branch '2.2-develop' of github.com:magento/magento2ce into MPI-…
YevSent Jun 7, 2018
e7c3df4
[EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Jun 7, 2018
9ba75c8
Merge pull request #2662 from magento-mpi/MPI-PR-060618
viktym Jun 7, 2018
aef96bb
[EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Jun 7, 2018
cf3e439
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-9246…
pdohogne-magento Jun 7, 2018
1ff3ca5
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
Jun 7, 2018
717e973
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-9246…
pdohogne-magento Jun 7, 2018
71a42d2
MAGETWO-92468: Blacklisting non-Magento code directories from copyrig…
pdohogne-magento Jun 7, 2018
eb9042c
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
dhorytskyi Jun 8, 2018
8369afa
Merge pull request #2667 from magento-tango/MAGETWO-86125
dhorytskyi Jun 8, 2018
4dea3b6
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-9246…
pdohogne-magento Jun 8, 2018
38d7977
Merge pull request #2674 from magento-borg/MAGETWO-92468-make-tests-n…
pdohogne-magento Jun 9, 2018
dccfcff
Fix meta title property
slackerzz Oct 11, 2017
30af437
Update unit test
slackerzz Oct 12, 2017
ab06129
Fix coding standards
slackerzz Oct 12, 2017
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
6 changes: 6 additions & 0 deletions app/code/Magento/Backend/App/AbstractAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)
$this->_view->loadLayout(['default', 'adminhtml_denied'], true, true, false);
$this->_view->renderLayout();
$this->_request->setDispatched(true);

return $this->_response;
}

Expand All @@ -226,6 +227,11 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)

$this->_processLocaleSettings();

// Need to preload isFirstPageAfterLogin (see https://github.com/magento/magento2/issues/15510)
if ($this->_auth->isLoggedIn()) {
$this->_auth->getAuthStorage()->isFirstPageAfterLogin();
}

return parent::dispatch($request);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ public function __construct(
$this->_storeManager = $storeManager;
$this->_currencyLocator = $currencyLocator;
$this->_localeCurrency = $localeCurrency;
$defaultBaseCurrencyCode = $this->_scopeConfig->getValue(
\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE,
'default'
);
$defaultBaseCurrencyCode = $currencyLocator->getDefaultCurrency($this->_request);
$this->_defaultBaseCurrency = $currencyFactory->create()->load($defaultBaseCurrencyCode);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Checkbox extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Op
/**
* @var string
*/
protected $_template = 'product/composite/fieldset/options/type/checkbox.phtml';
protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/checkbox.phtml';

/**
* @param string $elementId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Multi extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio
/**
* @var string
*/
protected $_template = 'product/composite/fieldset/options/type/multi.phtml';
protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/multi.phtml';

/**
* @param string $elementId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Radio extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio
/**
* @var string
*/
protected $_template = 'product/composite/fieldset/options/type/radio.phtml';
protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/radio.phtml';

/**
* @param string $elementId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Select extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Opti
/**
* @var string
*/
protected $_template = 'product/composite/fieldset/options/type/select.phtml';
protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/select.phtml';

/**
* @param string $elementId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Bundle extends \Magento\Backend\Block\Widget implements \Magento\Backend\B
/**
* @var string
*/
protected $_template = 'product/edit/bundle.phtml';
protected $_template = 'Magento_Bundle::product/edit/bundle.phtml';

/**
* Core registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Option extends \Magento\Backend\Block\Widget
/**
* @var string
*/
protected $_template = 'product/edit/bundle/option.phtml';
protected $_template = 'Magento_Bundle::product/edit/bundle/option.phtml';

/**
* Core registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Search extends \Magento\Backend\Block\Widget
/**
* @var string
*/
protected $_template = 'product/edit/bundle/option/search.phtml';
protected $_template = 'Magento_Bundle::product/edit/bundle/option/search.phtml';

/**
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Selection extends \Magento\Backend\Block\Widget
/**
* @var string
*/
protected $_template = 'product/edit/bundle/option/selection.phtml';
protected $_template = 'Magento_Bundle::product/edit/bundle/option/selection.phtml';

/**
* Catalog data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class Checkbox extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Op
/**
* @var string
*/
protected $_template = 'catalog/product/view/type/bundle/option/checkbox.phtml';
protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/checkbox.phtml';
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Multi extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio
/**
* @var string
*/
protected $_template = 'catalog/product/view/type/bundle/option/multi.phtml';
protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/multi.phtml';

/**
* @inheritdoc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class Radio extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio
/**
* @var string
*/
protected $_template = 'catalog/product/view/type/bundle/option/radio.phtml';
protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/radio.phtml';
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class Select extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Opti
/**
* @var string
*/
protected $_template = 'catalog/product/view/type/bundle/option/select.phtml';
protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/select.phtml';
}
43 changes: 27 additions & 16 deletions app/code/Magento/Captcha/Model/Customer/Plugin/AjaxLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Captcha\Model\Customer\Plugin;

use Magento\Captcha\Helper\Data as CaptchaHelper;
Expand Down Expand Up @@ -81,27 +82,37 @@ public function aroundExecute(
if ($content) {
$loginParams = $this->serializer->unserialize($content);
}
$username = isset($loginParams['username']) ? $loginParams['username'] : null;
$captchaString = isset($loginParams[$captchaInputName]) ? $loginParams[$captchaInputName] : null;
$loginFormId = isset($loginParams[$captchaFormIdField]) ? $loginParams[$captchaFormIdField] : null;
$username = $loginParams['username'] ?? null;
$captchaString = $loginParams[$captchaInputName] ?? null;
$loginFormId = $loginParams[$captchaFormIdField] ?? null;

foreach ($this->formIds as $formId) {
$captchaModel = $this->helper->getCaptcha($formId);
if ($captchaModel->isRequired($username) && !in_array($loginFormId, $this->formIds)) {
$resultJson = $this->resultJsonFactory->create();
return $resultJson->setData(['errors' => true, 'message' => __('Provided form does not exist')]);
}
if (!in_array($loginFormId, $this->formIds) && $this->helper->getCaptcha($loginFormId)->isRequired($username)) {
return $this->returnJsonError(__('Provided form does not exist'));
}

if ($formId == $loginFormId) {
$captchaModel->logAttempt($username);
if (!$captchaModel->isCorrect($captchaString)) {
$this->sessionManager->setUsername($username);
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultJsonFactory->create();
return $resultJson->setData(['errors' => true, 'message' => __('Incorrect CAPTCHA')]);
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'));
}
}
}
}
return $proceed();
}

/**
*
* @param \Magento\Framework\Phrase $phrase
* @return \Magento\Framework\Controller\Result\Json
*/
private function returnJsonError(\Magento\Framework\Phrase $phrase): \Magento\Framework\Controller\Result\Json
{
$resultJson = $this->resultJsonFactory->create();
return $resultJson->setData(['errors' => true, 'message' => $phrase]);
}
}
16 changes: 10 additions & 6 deletions app/code/Magento/Captcha/Model/DefaultModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Captcha\Model;

use Magento\Captcha\Helper\Data;

/**
* Implementation of \Zend\Captcha\Image
*
Expand All @@ -29,7 +31,7 @@ class DefaultModel extends \Zend\Captcha\Image implements \Magento\Captcha\Model
const DEFAULT_WORD_LENGTH_TO = 5;

/**
* @var \Magento\Captcha\Helper\Data
* @var Data
* @since 100.2.0
*/
protected $captchaData;
Expand Down Expand Up @@ -125,8 +127,8 @@ public function getBlockName()
*/
public function isRequired($login = null)
{
if ($this->isUserAuth()
&& !$this->isShownToLoggedInUser()
if (($this->isUserAuth()
&& !$this->isShownToLoggedInUser())
|| !$this->isEnabled()
|| !in_array(
$this->formId,
Expand Down Expand Up @@ -431,12 +433,14 @@ public function getWordLen()
*/
private function isShowAlways()
{
if ((string)$this->captchaData->getConfig('mode') == \Magento\Captcha\Helper\Data::MODE_ALWAYS) {
$captchaMode = (string)$this->captchaData->getConfig('mode');

if ($captchaMode === Data::MODE_ALWAYS) {
return true;
}

if ((string)$this->captchaData->getConfig('mode') == \Magento\Captcha\Helper\Data::MODE_AFTER_FAIL
&& $this->getAllowedAttemptsForSameLogin() == 0
if ($captchaMode === Data::MODE_AFTER_FAIL
&& $this->getAllowedAttemptsForSameLogin() === 0
) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Captcha\Test\Unit\Model\Customer\Plugin;

class AjaxLoginTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \PHPUnit_Framework_MockObject_MockObject
* @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Checkout\Model\Session
*/
protected $sessionManagerMock;

/**
* @var \PHPUnit_Framework_MockObject_MockObject
* @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Captcha\Helper\Data
*/
protected $captchaHelperMock;

/**
* @var \PHPUnit_Framework_MockObject_MockObject
* @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Controller\Result\JsonFactory
*/
protected $jsonFactoryMock;

Expand All @@ -38,12 +39,12 @@ class AjaxLoginTest extends \PHPUnit\Framework\TestCase
protected $requestMock;

/**
* @var \PHPUnit_Framework_MockObject_MockObject
* @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Controller\Ajax\Login
*/
protected $loginControllerMock;

/**
* @var \PHPUnit_Framework_MockObject_MockObject
* @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Serialize\Serializer\Json
*/
protected $serializerMock;

Expand Down Expand Up @@ -72,8 +73,12 @@ protected function setUp()

$this->loginControllerMock->expects($this->any())->method('getRequest')
->will($this->returnValue($this->requestMock));
$this->captchaHelperMock->expects($this->once())->method('getCaptcha')
->with('user_login')->will($this->returnValue($this->captchaMock));

$this->captchaHelperMock
->expects($this->exactly(1))
->method('getCaptcha')
->will($this->returnValue($this->captchaMock));

$this->formIds = ['user_login'];
$this->serializerMock = $this->createMock(\Magento\Framework\Serialize\Serializer\Json::class);

Expand Down Expand Up @@ -103,11 +108,18 @@ public function testAroundExecute()
$this->captchaMock->expects($this->once())->method('logAttempt')->with($username);
$this->captchaMock->expects($this->once())->method('isCorrect')->with($captchaString)
->will($this->returnValue(true));
$this->serializerMock->expects(($this->once()))->method('unserialize')->will($this->returnValue($requestData));
$this->serializerMock->expects($this->once())->method('unserialize')->will($this->returnValue($requestData));

$closure = function () {
return 'result';
};

$this->captchaHelperMock
->expects($this->exactly(1))
->method('getCaptcha')
->with('user_login')
->will($this->returnValue($this->captchaMock));

$this->assertEquals('result', $this->model->aroundExecute($this->loginControllerMock, $closure));
}

Expand All @@ -128,18 +140,21 @@ public function testAroundExecuteIncorrectCaptcha()
$this->captchaMock->expects($this->once())->method('logAttempt')->with($username);
$this->captchaMock->expects($this->once())->method('isCorrect')
->with($captchaString)->will($this->returnValue(false));
$this->serializerMock->expects(($this->once()))->method('unserialize')->will($this->returnValue($requestData));
$this->serializerMock->expects($this->once())->method('unserialize')->will($this->returnValue($requestData));

$this->sessionManagerMock->expects($this->once())->method('setUsername')->with($username);
$this->jsonFactoryMock->expects($this->once())->method('create')
->will($this->returnValue($this->resultJsonMock));

$this->resultJsonMock->expects($this->once())->method('setData')
->with(['errors' => true, 'message' => __('Incorrect CAPTCHA')])->will($this->returnValue('response'));
$this->resultJsonMock
->expects($this->once())
->method('setData')
->with(['errors' => true, 'message' => __('Incorrect CAPTCHA')])
->will($this->returnSelf());

$closure = function () {
};
$this->assertEquals('response', $this->model->aroundExecute($this->loginControllerMock, $closure));
$this->assertEquals($this->resultJsonMock, $this->model->aroundExecute($this->loginControllerMock, $closure));
}

/**
Expand All @@ -151,7 +166,7 @@ public function testAroundExecuteCaptchaIsNotRequired($username, $requestContent
{
$this->requestMock->expects($this->once())->method('getContent')
->will($this->returnValue(json_encode($requestContent)));
$this->serializerMock->expects(($this->once()))->method('unserialize')
$this->serializerMock->expects($this->once())->method('unserialize')
->will($this->returnValue($requestContent));

$this->captchaMock->expects($this->once())->method('isRequired')->with($username)
Expand All @@ -168,16 +183,39 @@ public function testAroundExecuteCaptchaIsNotRequired($username, $requestContent
/**
* @return array
*/
public function aroundExecuteCaptchaIsNotRequired()
public function aroundExecuteCaptchaIsNotRequired(): array
{
return [
[
'username' => 'name',
'requestData' => ['username' => 'name', 'captcha_string' => 'string'],
],
[
'username' => 'name',
'requestData' =>
[
'username' => 'name',
'captcha_string' => 'string',
'captcha_form_id' => $this->formIds[0]
],
],
[
'username' => null,
'requestData' => ['captcha_string' => 'string'],
'requestData' =>
[
'username' => null,
'captcha_string' => 'string',
'captcha_form_id' => $this->formIds[0]
],
],
[
'username' => 'name',
'requestData' =>
[
'username' => 'name',
'captcha_string' => 'string',
'captcha_form_id' => null
],
],
];
}
Expand Down
Loading