Skip to content

Commit b8086d2

Browse files
committed
MAGETWO-75326: #10611 Ignore request key check for error page to avoid redirect loop #10921
- Merge Pull Request #10921 from lbajsarowicz/magento2:bug/10611-redirect-loop - Merged commits: 1. 2f422ad
2 parents d844e31 + 2f422ad commit b8086d2

File tree

11,370 files changed

+135323
-94132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11,370 files changed

+135323
-94132
lines changed

.github/.htaccess

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Order deny,allow
2+
Deny from all

.github/CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/
File renamed without changes.
File renamed without changes.
File renamed without changes.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/.metadata
44
/.project
55
/.settings
6+
/.vscode
67
atlassian*
78
/nbproject
89
/robots.txt

.htaccess

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,6 @@
234234
order allow,deny
235235
deny from all
236236
</Files>
237-
<Files CONTRIBUTING.md>
238-
order allow,deny
239-
deny from all
240-
</Files>
241237
<Files COPYING.txt>
242238
order allow,deny
243239
deny from all

.htaccess.sample

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,6 @@
210210
order allow,deny
211211
deny from all
212212
</Files>
213-
<Files CONTRIBUTING.md>
214-
order allow,deny
215-
deny from all
216-
</Files>
217213
<Files COPYING.txt>
218214
order allow,deny
219215
deny from all

.travis.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
sudo: required
22
dist: trusty
3+
group: edge
34
addons:
45
apt:
56
packages:
@@ -28,8 +29,7 @@ env:
2829
- TEST_SUITE=integration INTEGRATION_INDEX=1
2930
- TEST_SUITE=integration INTEGRATION_INDEX=2
3031
- TEST_SUITE=integration INTEGRATION_INDEX=3
31-
- TEST_SUITE=functional ACCEPTANCE_INDEX=1
32-
- TEST_SUITE=functional ACCEPTANCE_INDEX=2
32+
- TEST_SUITE=functional
3333
matrix:
3434
exclude:
3535
- php: 7.0
@@ -39,9 +39,7 @@ matrix:
3939
- php: 7.0
4040
env: TEST_SUITE=js GRUNT_COMMAND=static
4141
- php: 7.0
42-
env: TEST_SUITE=functional ACCEPTANCE_INDEX=1
43-
- php: 7.0
44-
env: TEST_SUITE=functional ACCEPTANCE_INDEX=2
42+
env: TEST_SUITE=functional
4543
cache:
4644
apt: true
4745
directories:
@@ -50,13 +48,14 @@ cache:
5048
- $HOME/node_modules
5149
- $HOME/yarn.lock
5250
before_install: ./dev/travis/before_install.sh
53-
install: composer install --no-interaction --prefer-dist
51+
install: composer install --no-interaction
5452
before_script: ./dev/travis/before_script.sh
5553
script:
5654
# Set arguments for variants of phpunit based tests; '|| true' prevents failing script when leading test fails
5755
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
5856
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true
5957

6058
# The scripts for grunt/phpunit type tests
61-
- if [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
59+
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
60+
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
6261
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi

app/bootstrap.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@
6262

6363
date_default_timezone_set('UTC');
6464

65-
/* Adjustment of precision value for several versions of PHP */
66-
ini_set('precision', 17);
67-
ini_set('serialize_precision', 17);
65+
/* For data consistency between displaying (printing) and serialization a float number */
66+
ini_set('precision', 14);
67+
ini_set('serialize_precision', 14);

app/code/Magento/AdminNotification/Block/Inbox.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
/**
1111
* @api
12+
* @since 100.0.2
1213
*/
1314
class Inbox extends \Magento\Backend\Block\Widget\Grid\Container
1415
{

app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
/**
1111
* @api
12+
* @since 100.0.2
1213
*/
1314
class UnreadMessagePopup extends \Magento\Backend\Block\Template
1415
{

app/code/Magento/AdminNotification/Block/ToolbarEntry.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*
1212
* @api
1313
* @author Magento Core Team <[email protected]>
14+
* @since 100.0.2
1415
*/
1516
class ToolbarEntry extends \Magento\Backend\Block\Template
1617
{

app/code/Magento/AdminNotification/Block/Window.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
/**
1111
* @api
12+
* @since 100.0.2
1213
*/
1314
class Window extends \Magento\Backend\Block\Template
1415
{

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
*/
88
namespace Magento\AdminNotification\Controller\Adminhtml;
99

10+
/**
11+
* @api
12+
* @since 100.0.2
13+
*/
1014
abstract class Notification extends \Magento\Backend\App\AbstractAction
1115
{
1216
/**

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/AjaxMarkAsRead.php

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,35 @@
66
*/
77
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;
88

9+
use Magento\Backend\App\Action;
10+
use Magento\Framework\Controller\ResultFactory;
11+
912
class AjaxMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Notification
1013
{
14+
/**
15+
* @var \Magento\AdminNotification\Model\NotificationService
16+
*/
17+
private $notificationService;
18+
19+
/**
20+
* @param Action\Context $context
21+
* @param \Magento\AdminNotification\Model\NotificationService|null $notificationService
22+
* @throws \RuntimeException
23+
*/
24+
public function __construct(
25+
Action\Context $context,
26+
\Magento\AdminNotification\Model\NotificationService $notificationService = null
27+
) {
28+
parent::__construct($context);
29+
$this->notificationService = $notificationService?: \Magento\Framework\App\ObjectManager::getInstance()
30+
->get(\Magento\AdminNotification\Model\NotificationService::class);
31+
}
32+
1133
/**
1234
* Mark notification as read (AJAX action)
1335
*
14-
* @return void
36+
* @return \Magento\Framework\Controller\Result\Json|void
37+
* @throws \InvalidArgumentException
1538
*/
1639
public function execute()
1740
{
@@ -21,17 +44,15 @@ public function execute()
2144
$notificationId = (int)$this->getRequest()->getPost('id');
2245
$responseData = [];
2346
try {
24-
$this->_objectManager->create(
25-
\Magento\AdminNotification\Model\NotificationService::class
26-
)->markAsRead(
27-
$notificationId
28-
);
47+
$this->notificationService->markAsRead($notificationId);
2948
$responseData['success'] = true;
3049
} catch (\Exception $e) {
3150
$responseData['success'] = false;
3251
}
33-
$this->getResponse()->representJson(
34-
$this->_objectManager->create(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($responseData)
35-
);
52+
53+
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
54+
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
55+
$resultJson->setData($responseData);
56+
return $resultJson;
3657
}
3758
}

app/code/Magento/AdminNotification/Model/Config/Source/Frequency.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* AdminNotification update frequency source
1010
*
1111
* @codeCoverageIgnore
12+
* @api
13+
* @since 100.0.2
1214
*/
1315
class Frequency implements \Magento\Framework\Option\ArrayInterface
1416
{

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*
1313
* @author Magento Core Team <[email protected]>
1414
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
15+
* @api
16+
* @since 100.0.2
1517
*/
1618
class Feed extends \Magento\Framework\Model\AbstractModel
1719
{

app/code/Magento/AdminNotification/Model/Inbox.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
/**
1313
* AdminNotification Inbox model
1414
*
15-
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox _getResource()
16-
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox getResource()
1715
* @method int getSeverity()
1816
* @method \Magento\AdminNotification\Model\Inbox setSeverity(int $value)
1917
* @method string getDateAdded()
@@ -29,7 +27,8 @@
2927
* @method int getIsRemove()
3028
* @method \Magento\AdminNotification\Model\Inbox setIsRemove(int $value)
3129
*
32-
* @author Magento Core Team <[email protected]>
30+
* @api
31+
* @since 100.0.2
3332
*/
3433
class Inbox extends \Magento\Framework\Model\AbstractModel implements NotifierInterface, InboxInterface
3534
{

app/code/Magento/AdminNotification/Model/InboxInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* AdminNotification Inbox interface
1010
*
1111
* @author Magento Core Team <[email protected]>
12+
* @api
13+
* @since 100.0.2
1214
*/
1315
interface InboxInterface
1416
{

app/code/Magento/AdminNotification/Model/NotificationService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* Notification service model
1010
*
1111
* @author Magento Core Team <[email protected]>
12+
* @api
13+
* @since 100.0.2
1214
*/
1315
class NotificationService
1416
{

app/code/Magento/AdminNotification/Model/ResourceModel/Grid/Collection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
*/
1212
namespace Magento\AdminNotification\Model\ResourceModel\Grid;
1313

14+
/**
15+
* @api
16+
* @since 100.0.2
17+
*/
1418
class Collection extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
1519
{
1620
/**

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
namespace Magento\AdminNotification\Model\ResourceModel;
77

88
/**
9-
* AdminNotification Inbox model
10-
*
11-
* @author Magento Core Team <[email protected]>
9+
* @api
10+
* @since 100.0.2
1211
*/
1312
class Inbox extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
1413
{

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*
1111
* @api
1212
* @author Magento Core Team <[email protected]>
13+
* @api
14+
* @since 100.0.2
1315
*/
1416
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
1517
{

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection/Critical.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
*/
88
namespace Magento\AdminNotification\Model\ResourceModel\Inbox\Collection;
99

10+
/**
11+
* @api
12+
* @since 100.0.2
13+
*/
1014
class Critical extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
1115
{
1216
/**

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection/Unread.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
*/
1212
namespace Magento\AdminNotification\Model\ResourceModel\Inbox\Collection;
1313

14+
/**
15+
* @api
16+
* @since 100.0.2
17+
*/
1418
class Unread extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
1519
{
1620
/**

app/code/Magento/AdminNotification/Model/ResourceModel/System/Message.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
namespace Magento\AdminNotification\Model\ResourceModel\System;
77

8+
/**
9+
* @api
10+
* @since 100.0.2
11+
*/
812
class Message extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
913
{
1014
/**

app/code/Magento/AdminNotification/Model/ResourceModel/System/Message/Collection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
namespace Magento\AdminNotification\Model\ResourceModel\System\Message;
77

8+
/**
9+
* @api
10+
* @since 100.0.2
11+
*/
812
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
913
{
1014
/**

app/code/Magento/AdminNotification/Model/ResourceModel/System/Message/Collection/Synchronized.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
namespace Magento\AdminNotification\Model\ResourceModel\System\Message\Collection;
77

8+
/**
9+
* @api
10+
* @since 100.0.2
11+
*/
812
class Synchronized extends \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection
913
{
1014
/**

app/code/Magento/AdminNotification/Model/System/Message.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/**
99
* @codeCoverageIgnore
10+
* @api
11+
* @since 100.0.2
1012
*/
1113
class Message extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\Notification\MessageInterface
1214
{

app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Store\Model\Store;
1010

1111
/**
12-
* @deprecated
12+
* @deprecated 100.1.0
1313
*/
1414
class Baseurl implements \Magento\Framework\Notification\MessageInterface
1515
{

0 commit comments

Comments
 (0)