Skip to content

Commit 4ebfa1d

Browse files
committed
MAGETWO-94826: Create Branches for 2.1.16 Release
- Merged branch 2.1.15-develop 2.1.16-develop
2 parents 3e1caf5 + f3ba12f commit 4ebfa1d

File tree

76 files changed

+1583
-5726
lines changed

Some content is hidden

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

76 files changed

+1583
-5726
lines changed

CHANGELOG.md

Lines changed: 350 additions & 0 deletions
Large diffs are not rendered by default.

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,28 @@
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

99
use Magento\Framework\Controller\ResultFactory;
10+
use Magento\Framework\App\Request\Http as HttpRequest;
11+
use Magento\Framework\Exception\NotFoundException;
1012

1113
class DeleteGroupPost extends \Magento\Backend\Controller\Adminhtml\System\Store
1214
{
1315
/**
1416
* @return \Magento\Backend\Model\View\Result\Redirect
17+
* @throws NotFoundException
1518
*/
1619
public function execute()
1720
{
18-
$itemId = $this->getRequest()->getParam('item_id');
19-
21+
/** @var HttpRequest $request */
22+
$request = $this->getRequest();
2023
/** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */
21-
$redirectResult = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
24+
$redirectResult = $this->resultFactory->create(
25+
ResultFactory::TYPE_REDIRECT
26+
);
27+
if (!$request->isPost()) {
28+
throw new NotFoundException(__('Page not found.'));
29+
}
2230

31+
$itemId = $request->getParam('item_id');
2332
if (!($model = $this->_objectManager->create('Magento\Store\Model\Group')->load($itemId))) {
2433
$this->messageManager->addError(__('Something went wrong. Please try again.'));
2534
return $redirectResult->setPath('adminhtml/*/');

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,31 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

9+
use Magento\Framework\App\Request\Http as HttpRequest;
910
use Magento\Framework\Controller\ResultFactory;
11+
use Magento\Framework\Exception\NotFoundException;
1012

1113
class DeleteStorePost extends \Magento\Backend\Controller\Adminhtml\System\Store
1214
{
1315
/**
1416
* Delete store view post action
1517
*
1618
* @return \Magento\Backend\Model\View\Result\Redirect
19+
* @throws NotFoundException
1720
*/
1821
public function execute()
1922
{
20-
$itemId = $this->getRequest()->getParam('item_id');
21-
23+
/** @var HttpRequest $request */
24+
$request = $this->getRequest();
2225
/** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */
23-
$redirectResult = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
26+
$redirectResult = $this->resultFactory->create(
27+
ResultFactory::TYPE_REDIRECT
28+
);
29+
if (!$request->isPost()) {
30+
throw new NotFoundException(__('Page not found.'));
31+
}
32+
33+
$itemId = $request->getParam('item_id');
2434
if (!($model = $this->_objectManager->create('Magento\Store\Model\Store')->load($itemId))) {
2535
$this->messageManager->addError(__('Something went wrong. Please try again.'));
2636
return $redirectResult->setPath('adminhtml/*/');

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,30 @@
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

99
use Magento\Framework\Controller\ResultFactory;
10+
use Magento\Framework\App\Request\Http as HttpRequest;
11+
use Magento\Framework\Exception\NotFoundException;
1012

1113
class DeleteWebsitePost extends \Magento\Backend\Controller\Adminhtml\System\Store
1214
{
1315
/**
1416
* @return \Magento\Backend\Model\View\Result\Redirect
17+
* @throws NotFoundException
1518
*/
1619
public function execute()
1720
{
18-
$itemId = $this->getRequest()->getParam('item_id');
19-
$model = $this->_objectManager->create('Magento\Store\Model\Website');
20-
$model->load($itemId);
21-
21+
/** @var HttpRequest $request */
22+
$request = $this->getRequest();
2223
/** @var \Magento\Backend\Model\View\Result\Redirect $redirectResult */
23-
$redirectResult = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
24+
$redirectResult = $this->resultFactory->create(
25+
ResultFactory::TYPE_REDIRECT
26+
);
27+
if (!$request->isPost()) {
28+
throw new NotFoundException(__('Page not found.'));
29+
}
2430

31+
$itemId = $request->getParam('item_id');
32+
$model = $this->_objectManager->create('Magento\Store\Model\Website');
33+
$model->load($itemId);
2534
if (!$model) {
2635
$this->messageManager->addError(__('Something went wrong. Please try again.'));
2736
return $redirectResult->setPath('adminhtml/*/');

app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<% if (data.items.length) { %>
4343
<% _.each(data.items, function(value){ %>
4444
<li class="item"
45-
<%- data.optionData(value) %>
45+
<%= data.optionData(value) %>
4646
>
4747
<a href="<%- value.url %>" class="title"><%- value.name %></a>
4848
<span class="type"><%- value.type %></span>

app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ public function execute()
5353
$imageId = $this->_request->getParam('param_name', 'image');
5454
try {
5555
$result = $this->imageUploader->saveFileToTmpDir($imageId);
56-
57-
$result['cookie'] = [
58-
'name' => $this->_getSession()->getName(),
59-
'value' => $this->_getSession()->getSessionId(),
60-
'lifetime' => $this->_getSession()->getCookieLifetime(),
61-
'path' => $this->_getSession()->getCookiePath(),
62-
'domain' => $this->_getSession()->getCookieDomain(),
63-
];
6456
} catch (\Exception $e) {
6557
$result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()];
6658
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Framework\Controller\ResultFactory;
1010
use Magento\Catalog\Controller\Adminhtml\Product\Builder;
1111
use Magento\Backend\App\Action\Context;
12+
use Magento\Framework\Exception\NotFoundException;
1213
use Magento\Ui\Component\MassAction\Filter;
1314
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
1415

@@ -45,9 +46,14 @@ public function __construct(
4546

4647
/**
4748
* @return \Magento\Backend\Model\View\Result\Redirect
49+
* @throws NotFoundException
50+
* @throws \Magento\Framework\Exception\LocalizedException
4851
*/
4952
public function execute()
5053
{
54+
if (!$this->getRequest()->isPost()) {
55+
throw new NotFoundException(__('Page not found'));
56+
}
5157
$collection = $this->filter->getCollection($this->collectionFactory->create());
5258
$productDeleted = 0;
5359
foreach ($collection->getItems() as $product) {

app/code/Magento/Catalog/Model/Product/Option/Type/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function prepareForCart()
142142

143143
if ($this->_dateExists()) {
144144
if ($this->useCalendar()) {
145-
$timestamp += $this->_localeDate->date($value['date'], null, true)->getTimestamp();
145+
$timestamp += $this->_localeDate->date($value['date'], null, true, false)->getTimestamp();
146146
} else {
147147
$timestamp += mktime(0, 0, 0, $value['month'], $value['day'], $value['year']);
148148
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Model\Product\Option\Type\File;
8+
9+
/**
10+
* Validator for existing (already saved) files.
11+
*/
12+
class ExistingValidate extends \Zend_Validate
13+
{
14+
/**
15+
* @inheritDoc
16+
*
17+
* @param string $value File's full path.
18+
* @param string|null $originalName Original file's name (when uploaded).
19+
*/
20+
public function isValid($value, $originalName = null)
21+
{
22+
$this->_messages = [];
23+
$this->_errors = [];
24+
25+
if (!is_string($value)) {
26+
$this->_messages[] = __('Full file path is expected.')->render();
27+
return false;
28+
}
29+
30+
$result = true;
31+
$fileInfo = null;
32+
if ($originalName) {
33+
$fileInfo = ['name' => $originalName];
34+
}
35+
foreach ($this->_validators as $element) {
36+
$validator = $element['instance'];
37+
if ($validator->isValid($value, $fileInfo)) {
38+
continue;
39+
}
40+
$result = false;
41+
$messages = $validator->getMessages();
42+
$this->_messages = array_merge($this->_messages, $messages);
43+
$this->_errors = array_merge($this->_errors, array_keys($messages));
44+
if ($element['breakChainOnFailure']) {
45+
break;
46+
}
47+
}
48+
return $result;
49+
}
50+
}

app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidateFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ class ValidateFactory
1313
*/
1414
public function create()
1515
{
16-
return new \Zend_Validate();
16+
return new ExistingValidate();
1717
}
1818
}

0 commit comments

Comments
 (0)