Skip to content

Commit f387b55

Browse files
committed
Merge remote-tracking branch 'magento2/develop' into develop
2 parents b52c7ff + 66883d5 commit f387b55

File tree

41 files changed

+899
-431
lines changed

Some content is hidden

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

41 files changed

+899
-431
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ php:
1414
env:
1515
global:
1616
- COMPOSER_BIN_DIR=~/bin
17-
- INTEGRATION_SETS=2
17+
- INTEGRATION_SETS=3
1818
matrix:
1919
- TEST_SUITE=unit
2020
- TEST_SUITE=integration INTEGRATION_INDEX=1
2121
- TEST_SUITE=integration INTEGRATION_INDEX=2
22+
- TEST_SUITE=integration INTEGRATION_INDEX=3
2223
- TEST_SUITE=static
2324
cache:
2425
apt: true
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Backend\Model\Setup;
7+
8+
use Magento\Backend\Model\Menu;
9+
use Magento\Backend\Model\Menu\Builder;
10+
use Magento\Framework\App\DocRootLocator;
11+
12+
/**
13+
* Plugin class to remove web setup wizard from menu if application root is pub/ and no setup url variable is specified.
14+
*/
15+
class MenuBuilder
16+
{
17+
/**
18+
* @var DocRootLocator
19+
*/
20+
protected $docRootLocator;
21+
22+
/**
23+
* MenuBuilder constructor.
24+
*
25+
* @param DocRootLocator $docRootLocator
26+
*/
27+
public function __construct(DocRootLocator $docRootLocator)
28+
{
29+
$this->docRootLocator = $docRootLocator;
30+
}
31+
32+
/**
33+
* Removes 'Web Setup Wizard' from the menu if doc root is pub and no setup url variable is specified.
34+
*
35+
* @param Builder $subject
36+
* @param Menu $menu
37+
* @return Menu
38+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
39+
*/
40+
public function afterGetResult(Builder $subject, Menu $menu)
41+
{
42+
if ($this->docRootLocator->isPub()) {
43+
$menu->remove('Magento_Backend::setup_wizard');
44+
}
45+
return $menu;
46+
}
47+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Backend\Test\Unit\Model;
8+
9+
use Magento\Backend\Model\Setup\MenuBuilder;
10+
11+
class MenuBuilderTest extends \PHPUnit_Framework_TestCase
12+
{
13+
/**
14+
* @dataProvider afterGetResultDataProvider
15+
*
16+
* @param string $isPub
17+
* @param int $times
18+
* @param bool $result
19+
*/
20+
public function testAfterGetResult($isPub, $times)
21+
{
22+
$docRootLocator = $this->getMock('\Magento\Framework\App\DocRootLocator', [], [], '', false);
23+
$docRootLocator->expects($this->once())->method('isPub')->willReturn($isPub);
24+
$model = new MenuBuilder($docRootLocator);
25+
/** @var \Magento\Backend\Model\Menu $menu */
26+
$menu = $this->getMock('\Magento\Backend\Model\Menu', [], [], '', false);
27+
$menu->expects($this->exactly($times))->method('remove')->willReturn(true);
28+
29+
/** @var \Magento\Backend\Model\Menu\Builder $menuBuilder */
30+
$menuBuilder = $this->getMock('\Magento\Backend\Model\Menu\Builder', [], [], '', false);
31+
32+
$this->assertInstanceOf(
33+
'\Magento\Backend\Model\Menu',
34+
$model->afterGetResult($menuBuilder, $menu)
35+
);
36+
}
37+
38+
public function afterGetResultDataProvider()
39+
{
40+
return [[true, 1], [false, 0],];
41+
}
42+
}

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,7 @@
138138
<argument name="isIncludesAvailable" xsi:type="boolean">false</argument>
139139
</arguments>
140140
</type>
141+
<type name="Magento\Backend\Model\Menu\Builder">
142+
<plugin name="SetupMenuBuilder" type="Magento\Backend\Model\Setup\MenuBuilder" />
143+
</type>
141144
</config>

app/code/Magento/Checkout/Controller/Index/Index.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public function execute()
3434

3535
$this->_customerSession->regenerateId();
3636
$this->_objectManager->get('Magento\Checkout\Model\Session')->setCartWasUpdated(false);
37-
$currentUrl = $this->_url->getUrl('*/*/*', ['_secure' => true]);
38-
$this->_objectManager->get('Magento\Customer\Model\Session')->setBeforeAuthUrl($currentUrl);
3937
$this->getOnepage()->initCheckout();
4038
$resultPage = $this->resultPageFactory->create();
4139
$resultPage->getConfig()->getTitle()->set(__('Checkout'));

app/code/Magento/Cms/view/adminhtml/templates/browser/content.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<div class="title"><?php /* @escapeNotVerified */ echo $block->getHeaderText() ?></div>
2121
</div>
2222
</div>
23+
<div id="error-message" data-action="show-error"></div>
2324
<div id="contents-uploader" class="contents-uploader"><?php echo $block->getChildHtml('wysiwyg_images.uploader') ?></div>
2425
<div id="contents"></div>
2526
</div>

app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,16 @@ require([
6969
},
7070
done: function (e, data) {
7171
var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar';
72+
var tempErrorMessage = document.createElement("div");
7273
$(progressSelector).css('width', '100%');
74+
$('[data-action="show-error"]').children(".message").remove();
7375
if (data.result && !data.result.hasOwnProperty('errorcode')) {
7476
$(progressSelector).removeClass('upload-progress').addClass('upload-success');
7577
} else {
78+
tempErrorMessage.className = "message message-warning warning";
79+
tempErrorMessage.innerHTML = data.result.error;
80+
81+
$('[data-action="show-error"]').append(tempErrorMessage);
7682
$(progressSelector).removeClass('upload-progress').addClass('upload-failure');
7783
}
7884
},

app/code/Magento/Sales/Model/Order/AddressRepository.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
9191
$searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
9292
}
9393
}
94-
9594
$searchResult->setCurPage($searchCriteria->getCurrentPage());
9695
$searchResult->setPageSize($searchCriteria->getPageSize());
9796

app/code/Magento/Sales/Model/Order/CreditmemoRepository.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
9999
$searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
100100
}
101101
}
102+
$searchResult->setSearchCriteria($searchCriteria);
102103
$searchResult->setCurPage($searchCriteria->getCurrentPage());
103104
$searchResult->setPageSize($searchCriteria->getPageSize());
104105
return $searchResult;

app/code/Magento/Sales/Model/Order/InvoiceRepository.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
9595
$collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
9696
}
9797
}
98+
$collection->setSearchCriteria($searchCriteria);
9899
$collection->setCurPage($searchCriteria->getCurrentPage());
99100
$collection->setPageSize($searchCriteria->getPageSize());
100101
return $collection;

0 commit comments

Comments
 (0)