Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Commit

Permalink
Merge pull request #6 from magento/2.3-develop
Browse files Browse the repository at this point in the history
2.3 develop
  • Loading branch information
julienanquetil authored Apr 26, 2018
2 parents c09c8d5 + 18a7e29 commit 82d0491
Show file tree
Hide file tree
Showing 4,790 changed files with 170,323 additions and 33,772 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 9 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,15 @@
Require all denied
</IfVersion>
</Files>
<Files auth.json>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>

# For 404s and 403s that aren't handled by the application, show plain 404 response
ErrorDocument 404 /pub/errors/404.php
Expand Down
9 changes: 9 additions & 0 deletions .htaccess.sample
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,15 @@
Require all denied
</IfVersion>
</Files>
<Files auth.json>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>

# For 404s and 403s that aren't handled by the application, show plain 404 response
ErrorDocument 404 /pub/errors/404.php
Expand Down
4 changes: 2 additions & 2 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/

/**
* Pre-commit hook installation:
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
* PHP Coding Standards fixer configuration
*/

$finder = PhpCsFixer\Finder::create()
->name('*.phtml')
->exclude('dev/tests/functional/generated')
Expand Down
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ addons:
firefox: "46.0"
hosts:
- magento2.travis
services:
- rabbitmq
- elasticsearch
language: php
php:
- 7.0
- 7.1
- 7.2
env:
global:
- COMPOSER_BIN_DIR=~/bin
Expand All @@ -32,13 +35,13 @@ env:
- TEST_SUITE=functional
matrix:
exclude:
- php: 7.0
- php: 7.1
env: TEST_SUITE=static
- php: 7.0
- php: 7.1
env: TEST_SUITE=js GRUNT_COMMAND=spec
- php: 7.0
- php: 7.1
env: TEST_SUITE=js GRUNT_COMMAND=static
- php: 7.0
- php: 7.1
env: TEST_SUITE=functional
cache:
apt: true
Expand All @@ -47,7 +50,9 @@ cache:
- $HOME/.nvm
- $HOME/node_modules
- $HOME/yarn.lock
before_install: ./dev/travis/before_install.sh
before_install:
- curl -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.0/elasticsearch-2.3.0.deb && sudo dpkg -i --force-confnew elasticsearch-2.3.0.deb && sudo service elasticsearch restart
- ./dev/travis/before_install.sh
install: composer install --no-interaction
before_script: ./dev/travis/before_script.sh
script:
Expand Down
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=develop)](https://travis-ci.org/magento/magento2)
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=2.3-develop)](https://travis-ci.org/magento/magento2)
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.png)](https://crowdin.com/project/magento-2)
<h2>Welcome</h2>
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results.
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.

## Magento system requirements
[Magento system requirements](http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements2.html)
[Magento system requirements](http://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html)

## Install Magento
To install Magento, see either:

* [Magento DevBox](https://magento.com/tech-resources/download), the easiest way to get started with Magento.
* [Installation guide](http://devdocs.magento.com/guides/v2.2/install-gde/bk-install-guide.html)
* [Installation guide](http://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html)

<h2>Contributing to the Magento 2 code base</h2>
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.
Expand All @@ -22,11 +22,24 @@ To learn about issues, click [here][2]. To open an issue, click [here][3].

To suggest documentation improvements, click [here][4].

[1]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html>
[2]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#report>
[1]: <http://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html>
[2]: <http://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#report>
[3]: <https://github.com/magento/magento2/issues>
[4]: <http://devdocs.magento.com>

<h3>Community Maintainers</h3>
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks these Community Maintainers for their valuable contributions.

<a href="https://magento.com/magento-contributors#maintainers">
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png"/>
</a>

<h3>Top Contributors</h3>
Magento is thankful for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform.
<a href="https://magento.com/magento-contributors">
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
</a>

<h3>Labels applied by the Magento team</h3>

| Label | Description |
Expand Down
14 changes: 12 additions & 2 deletions app/code/Magento/AdminNotification/Block/System/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,34 @@ class Messages extends \Magento\Backend\Block\Template

/**
* @var \Magento\Framework\Json\Helper\Data
* @deprecated
*/
protected $jsonHelper;

/**
* @var \Magento\Framework\Serialize\Serializer\Json
*/
private $serializer;

/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized $messages
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
* @param array $data
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized $messages,
\Magento\Framework\Json\Helper\Data $jsonHelper,
array $data = []
array $data = [],
\Magento\Framework\Serialize\Serializer\Json $serializer = null
) {
$this->jsonHelper = $jsonHelper;
parent::__construct($context, $data);
$this->_messages = $messages;
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Framework\Serialize\Serializer\Json::class);
}

/**
Expand Down Expand Up @@ -117,7 +127,7 @@ protected function _getMessagesUrl()
*/
public function getSystemMessageDialogJson()
{
return $this->jsonHelper->jsonEncode(
return $this->serializer->serialize(
[
'systemMessageDialog' => [
'buttons' => [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ public function getPopupTitle()
$messageCount = count($this->_messages->getUnread());
if ($messageCount > 1) {
return __('You have %1 new system messages', $messageCount);
} else {
return __('You have %1 new system message', $messageCount);
}
return __('You have %1 new system message', $messageCount);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions app/code/Magento/AdminNotification/Block/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ protected function _getLatestItem()
{
if ($this->_latestItem == null) {
$items = array_values($this->_criticalCollection->getItems());
$this->_latestItem = false;
if (count($items)) {
$this->_latestItem = $items[0];
} else {
$this->_latestItem = false;
}
}
return $this->_latestItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public function execute()
)->markAsRead(
$notificationId
);
$this->messageManager->addSuccess(__('The message has been marked as Read.'));
$this->messageManager->addSuccessMessage(__('The message has been marked as Read.'));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException(
$this->messageManager->addExceptionMessage(
$e,
__("We couldn't mark the notification as Read because of an error.")
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function execute()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
$this->messageManager->addError(__('Please select messages.'));
$this->messageManager->addErrorMessage(__('Please select messages.'));
} else {
try {
foreach ($ids as $id) {
Expand All @@ -32,13 +32,13 @@ public function execute()
$model->setIsRead(1)->save();
}
}
$this->messageManager->addSuccess(
$this->messageManager->addSuccessMessage(
__('A total of %1 record(s) have been marked as Read.', count($ids))
);
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException(
$this->messageManager->addExceptionMessage(
$e,
__("We couldn't mark the notification as Read because of an error.")
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function execute()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
$this->messageManager->addError(__('Please select messages.'));
$this->messageManager->addErrorMessage(__('Please select messages.'));
} else {
try {
foreach ($ids as $id) {
Expand All @@ -32,13 +32,16 @@ public function execute()
$model->setIsRemove(1)->save();
}
}
$this->messageManager->addSuccess(__('Total of %1 record(s) have been removed.', count($ids)));
$this->messageManager->addSuccessMessage(__('Total of %1 record(s) have been removed.', count($ids)));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
$this->messageManager->addExceptionMessage(
$e,
__("We couldn't remove the messages because of an error.")
);
}
}
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*')));
$this->_redirect('adminhtml/*/');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ public function execute()

try {
$model->setIsRemove(1)->save();
$this->messageManager->addSuccess(__('The message has been removed.'));
$this->messageManager->addSuccessMessage(__('The message has been removed.'));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
$this->messageManager->addExceptionMessage(
$e,
__("We couldn't remove the messages because of an error.")
);
}

$this->_redirect('adminhtml/*/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml\System\Message;

use Magento\Framework\Controller\ResultFactory;

class ListAction extends \Magento\Backend\App\AbstractAction
{
/**
Expand All @@ -15,6 +17,7 @@ class ListAction extends \Magento\Backend\App\AbstractAction

/**
* @var \Magento\Framework\Json\Helper\Data
* @deprecated
*/
protected $jsonHelper;

Expand All @@ -41,7 +44,7 @@ public function __construct(
}

/**
* @return void
* @return \Magento\Framework\Controller\Result\Json
*/
public function execute()
{
Expand All @@ -63,6 +66,9 @@ public function execute()
. 'Please refresh the web page to clear the notice alert.',
];
}
$this->getResponse()->representJson($this->jsonHelper->jsonEncode($result));
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
$resultJson->setData($result);
return $resultJson;
}
}
13 changes: 6 additions & 7 deletions app/code/Magento/AdminNotification/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
"sort-packages": true
},
"require": {
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
"php": "~7.1.3||~7.2.0",
"lib-libxml": "*",
"magento/framework": "100.3.*",
"magento/module-backend": "100.3.*",
"magento/module-media-storage": "100.3.*",
"magento/module-store": "100.3.*",
"magento/module-ui": "100.3.*"
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-media-storage": "*",
"magento/module-store": "*",
"magento/module-ui": "*"
},
"type": "magento2-module",
"version": "100.3.0-dev",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="adminnotification_inbox" resource="default" engine="innodb" comment="Adminnotification Inbox">
<column xsi:type="int" name="notification_id" padding="10" unsigned="true" nullable="false" identity="true"
comment="Notification id"/>
Expand Down
Loading

0 comments on commit 82d0491

Please sign in to comment.