Skip to content

Commit 8693a81

Browse files
committed
MAGETWO-56063: After upgrading from 2.0.7 to 2.1, editing a category gives a 500 error
Merge remote-tracking branch 'mainline/develop' into MAGETWO-56063-upgrade-from-2.0.7-to-2.1.0
2 parents dedbe33 + 8bf902a commit 8693a81

File tree

1,190 files changed

+28106
-8559
lines changed

Some content is hidden

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

1,190 files changed

+28106
-8559
lines changed

.htaccess

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
DirectoryIndex index.php
3434

35+
<IfModule mod_php5.c>
3536
############################################
3637
## adjust memory limit
3738

@@ -53,7 +54,30 @@
5354
## disable user agent verification to not break multiple image upload
5455

5556
php_flag suhosin.session.cryptua off
57+
</IfModule>
58+
<IfModule mod_php7.c>
59+
############################################
60+
## adjust memory limit
61+
62+
php_value memory_limit 768M
63+
php_value max_execution_time 18000
64+
65+
############################################
66+
## disable automatic session start
67+
## before autoload was initialized
68+
69+
php_flag session.auto_start off
70+
71+
############################################
72+
## enable resulting html compression
73+
74+
#php_flag zlib.output_compression on
5675

76+
###########################################
77+
## disable user agent verification to not break multiple image upload
78+
79+
php_flag suhosin.session.cryptua off
80+
</IfModule>
5781
<IfModule mod_security.c>
5882
###########################################
5983
## disable POST processing to not break multiple image upload

.user.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
memory_limit = 768M
2+
max_execution_time = 18000
3+
session.auto_start = off
4+
suhosin.session.cryptua = off

Gruntfile.js.sample

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@
55

66
// For performance use one level down: 'name/{,*/}*.js'
77
// If you want to recursively match all subfolders, use: 'name/**/*.js'
8+
89
module.exports = function (grunt) {
910
'use strict';
1011

1112
var _ = require('underscore'),
1213
path = require('path'),
13-
themes = require('./dev/tools/grunt/configs/themes'),
14+
filesRouter = require('./dev/tools/grunt/tools/files-router'),
1415
configDir = './dev/tools/grunt/configs',
15-
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*');
16+
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*'),
17+
themes;
18+
19+
filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
20+
themes = filesRouter.get('themes');
1621

1722
tasks = _.map(tasks, function(task){ return task.replace('.js', '') });
1823
tasks.push('time-grunt');
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\AdminNotification\Ui\Component\DataProvider;
8+
9+
use Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\SynchronizedFactory;
10+
11+
/**
12+
* Class DataProvider
13+
*/
14+
class DataProvider extends \Magento\Ui\DataProvider\AbstractDataProvider
15+
{
16+
/**
17+
* DataProvider constructor.
18+
* @param string $name
19+
* @param string $primaryFieldName
20+
* @param string $requestFieldName
21+
* @param SynchronizedFactory $messageCollectionFactory
22+
* @param array $meta
23+
* @param array $data
24+
*/
25+
public function __construct(
26+
$name,
27+
$primaryFieldName,
28+
$requestFieldName,
29+
SynchronizedFactory $messageCollectionFactory,
30+
array $meta = [],
31+
array $data = []
32+
) {
33+
$this->collection = $messageCollectionFactory->create();
34+
parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
35+
}
36+
}

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"magento/module-backend": "100.2.*",
88
"magento/module-media-storage": "100.2.*",
99
"magento/framework": "100.2.*",
10+
"magento/module-ui": "100.2.*",
1011
"lib-libxml": "*"
1112
},
1213
"type": "magento2-module",

app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<body>
1010
<referenceContainer name="notifications">
11-
<block class="Magento\AdminNotification\Block\System\Messages"
12-
name="system_messages"
13-
as="system_messages"
14-
before="-"
15-
template="Magento_AdminNotification::system/messages.phtml"/>
11+
<uiComponent name="notification_area"/>
1612
<block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup"
1713
name="unread_system_messages"
1814
as="unread_system_messages"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
9+
<argument name="data" xsi:type="array">
10+
<item name="js_config" xsi:type="array">
11+
<item name="provider" xsi:type="string">notification_area.notification_area_data_source</item>
12+
<item name="deps" xsi:type="string">notification_area.notification_area_data_source</item>
13+
</item>
14+
<item name="spinner" xsi:type="string">columns</item>
15+
</argument>
16+
<dataSource name="notification_area_data_source">
17+
<argument name="dataProvider" xsi:type="configurableObject">
18+
<argument name="class" xsi:type="string">Magento\AdminNotification\Ui\Component\DataProvider\DataProvider</argument>
19+
<argument name="name" xsi:type="string">notification_area_data_source</argument>
20+
<argument name="primaryFieldName" xsi:type="string">identity</argument>
21+
<argument name="requestFieldName" xsi:type="string">identity</argument>
22+
<argument name="data" xsi:type="array">
23+
<item name="config" xsi:type="array">
24+
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
25+
<item name="update_url" xsi:type="url" path="mui/index/render"/>
26+
<item name="storageConfig" xsi:type="array">
27+
<item name="indexField" xsi:type="string">identity</item>
28+
</item>
29+
</item>
30+
</argument>
31+
</argument>
32+
</dataSource>
33+
<columns name="columns">
34+
<argument name="data" xsi:type="array">
35+
<item name="config" xsi:type="array">
36+
<item name="component" xsi:type="string">Magento_AdminNotification/js/grid/listing</item>
37+
<item name="template" xsi:type="string">Magento_AdminNotification/grid/listing</item>
38+
</item>
39+
</argument>
40+
<column name="created_at">
41+
<argument name="data" xsi:type="array">
42+
<item name="config" xsi:type="array">
43+
<item name="component" xsi:type="string">Magento_AdminNotification/js/grid/columns/message</item>
44+
<item name="label" xsi:type="string" translate="true"/>
45+
<item name="dataType" xsi:type="string">text</item>
46+
<item name="sorting" xsi:type="string">asc</item>
47+
<item name="sortOrder" xsi:type="number">30</item>
48+
</item>
49+
</argument>
50+
</column>
51+
</columns>
52+
</listing>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Copyright © 2016 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
define([
6+
'Magento_Ui/js/grid/columns/column',
7+
'underscore'
8+
], function (Column, _) {
9+
'use strict';
10+
11+
return Column.extend({
12+
defaults: {
13+
bodyTmpl: 'Magento_AdminNotification/grid/cells/message',
14+
messageIndex: 'text',
15+
fieldClass: {
16+
message: true,
17+
'message-warning': false,
18+
'message-progress': false,
19+
'message-success': false,
20+
'message-error': false
21+
},
22+
statusMap: {
23+
0: 'info',
24+
1: 'progress',
25+
2: 'success',
26+
3: 'error'
27+
}
28+
},
29+
30+
/** @inheritdoc */
31+
getLabel: function (record) {
32+
return record[this.messageIndex];
33+
},
34+
35+
/** @inheritdoc */
36+
getFieldClass: function ($row) {
37+
var status = this.statusMap[$row.status] || 'warning',
38+
result = {};
39+
40+
result['message-' + status] = true;
41+
result = _.extend({}, this.fieldClass, result);
42+
43+
return result;
44+
}
45+
});
46+
});
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/**
2+
* Copyright © 2016 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'Magento_Ui/js/grid/listing',
8+
'Magento_Ui/js/lib/spinner',
9+
'jquery'
10+
], function (Listing, loader, $) {
11+
'use strict';
12+
13+
return Listing.extend({
14+
defaults: {
15+
imports: {
16+
totalRecords: '${ $.provider }:data.totalRecords'
17+
},
18+
selectors: {
19+
collapsible: '.message-system-collapsible',
20+
messages: '.message-system'
21+
}
22+
},
23+
24+
/** @inheritdoc */
25+
initObservable: function () {
26+
this._super()
27+
.track({
28+
totalRecords: 0
29+
});
30+
31+
return this;
32+
},
33+
34+
/** @inheritdoc */
35+
showLoader: function () {
36+
if (!this.source.firstLoad) {
37+
this.fixLoaderHeight();
38+
this._super();
39+
}
40+
},
41+
42+
/**
43+
* Calculates loader height
44+
*
45+
* @param {Boolean} [closed]
46+
*/
47+
fixLoaderHeight: function (closed) {
48+
var $messagesBlock = $(this.selectors.messages),
49+
$collapsibleBlock = $(this.selectors.collapsible),
50+
resultHeight = 0;
51+
52+
if ($messagesBlock.length) {
53+
resultHeight += $messagesBlock.outerHeight();
54+
}
55+
56+
if ($collapsibleBlock.length && $collapsibleBlock.is(':visible') && !closed) {
57+
resultHeight += $collapsibleBlock.outerHeight();
58+
}
59+
60+
loader.get(this.name).height(resultHeight);
61+
}
62+
});
63+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!--
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<div css="$col.getFieldClass($row())"
8+
html="$col.getLabel($row())"/>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<div id="system_messages" class="message-system" collapsible visible="totalRecords">
8+
<div class="message-system-inner" outerClick="fixLoaderHeight.bind($data, true)">
9+
<div class="message-system-short">
10+
<button class="message-system-action-dropdown" toggleCollapsible>
11+
<span>
12+
<translate args="'System Messages'"/>:
13+
<text args="totalRecords"/>
14+
</span>
15+
</button>
16+
<div class="message-system-short-wrapper" if="rows[0]" repeat="foreach: [rows[0]], item: '$row'" visible="!$collapsible.opened()">
17+
<fastForEach args="data: getVisible(), as: '$col'" >
18+
<render args="$col.getBody()"/>
19+
</fastForEach>
20+
</div>
21+
</div>
22+
<div class="message-system-collapsible">
23+
<ul class="message-system-list">
24+
<li repeat="foreach: rows, item: '$row'">
25+
<fastForEach args="data: getVisible(), as: '$col'" >
26+
<render args="$col.getBody()"/>
27+
</fastForEach>
28+
</li>
29+
</ul>
30+
</div>
31+
</div>
32+
</div>

app/code/Magento/Backend/Block/Store/Switcher.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
/**
1010
* Store switcher block
11-
*
12-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1311
*/
1412
class Switcher extends \Magento\Backend\Block\Template
1513
{
@@ -152,11 +150,7 @@ public function getWebsites()
152150
{
153151
$websites = $this->_storeManager->getWebsites();
154152
if ($websiteIds = $this->getWebsiteIds()) {
155-
foreach (array_keys($websites) as $websiteId) {
156-
if (!in_array($websiteId, $websiteIds)) {
157-
unset($websites[$websiteId]);
158-
}
159-
}
153+
$websites = array_intersect_key($websites, array_flip($websiteIds));
160154
}
161155
return $websites;
162156
}

app/code/Magento/Backend/Model/View/Result/Redirect.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Backend\Model\UrlInterface;
1111
use Magento\Framework\App;
1212
use Magento\Framework\App\ActionFlag;
13+
use Magento\Framework\App\Response\HttpInterface as HttpResponseInterface;
1314

1415
class Redirect extends \Magento\Framework\Controller\Result\Redirect
1516
{
@@ -56,7 +57,7 @@ public function setRefererOrBaseUrl()
5657
/**
5758
* {@inheritdoc}
5859
*/
59-
protected function render(App\ResponseInterface $response)
60+
protected function render(HttpResponseInterface $response)
6061
{
6162
$this->session->setIsUrlNotice($this->actionFlag->get('', AbstractAction::FLAG_IS_URLS_CHECKED));
6263
return parent::render($response);

0 commit comments

Comments
 (0)