Skip to content

Commit 818519e

Browse files
authored
Merge pull request #3 from Karlasa/2.1-develop-PR-port-16190
[Backport] magento#16079 translation possibility for moreButtonText
2 parents 1a099cb + d09dbe4 commit 818519e

File tree

130 files changed

+734
-199
lines changed

Some content is hidden

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

130 files changed

+734
-199
lines changed

app/code/Magento/Backend/App/AbstractAction.php

+6
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)
214214
$this->_view->loadLayout(['default', 'adminhtml_denied'], true, true, false);
215215
$this->_view->renderLayout();
216216
$this->_request->setDispatched(true);
217+
217218
return $this->_response;
218219
}
219220

@@ -223,6 +224,11 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)
223224

224225
$this->_processLocaleSettings();
225226

227+
// Need to preload isFirstPageAfterLogin (see https://github.com/magento/magento2/issues/15510)
228+
if ($this->_auth->isLoggedIn()) {
229+
$this->_auth->getAuthStorage()->isFirstPageAfterLogin();
230+
}
231+
226232
return parent::dispatch($request);
227233
}
228234

app/code/Magento/Backend/Block/Dashboard.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Dashboard extends \Magento\Backend\Block\Template
1818
/**
1919
* @var string
2020
*/
21-
protected $_template = 'dashboard/index.phtml';
21+
protected $_template = 'Magento_Backend::dashboard/index.phtml';
2222

2323
/**
2424
* @return void

app/code/Magento/Backend/Block/Dashboard/Graph.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Graph extends \Magento\Backend\Block\Dashboard\AbstractDashboard
9090
/**
9191
* @var string
9292
*/
93-
protected $_template = 'dashboard/graph.phtml';
93+
protected $_template = 'Magento_Backend::dashboard/graph.phtml';
9494

9595
/**
9696
* Adminhtml dashboard data

app/code/Magento/Backend/Block/Dashboard/Grid.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended
1515
/**
1616
* @var string
1717
*/
18-
protected $_template = 'dashboard/grid.phtml';
18+
protected $_template = 'Magento_Backend::dashboard/grid.phtml';
1919

2020
/**
2121
* Setting default for every grid on dashboard

app/code/Magento/Backend/Block/Dashboard/Sales.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Sales extends \Magento\Backend\Block\Dashboard\Bar
1616
/**
1717
* @var string
1818
*/
19-
protected $_template = 'dashboard/salebar.phtml';
19+
protected $_template = 'Magento_Backend::dashboard/salebar.phtml';
2020

2121
/**
2222
* @var \Magento\Framework\Module\Manager

app/code/Magento/Backend/Block/Dashboard/Totals.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Totals extends \Magento\Backend\Block\Dashboard\Bar
1717
/**
1818
* @var string
1919
*/
20-
protected $_template = 'dashboard/totalbar.phtml';
20+
protected $_template = 'Magento_Backend::dashboard/totalbar.phtml';
2121

2222
/**
2323
* @var \Magento\Framework\Module\Manager

app/code/Magento/Backend/Block/Menu.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,12 @@ protected function _renderItemCssClass($menuItem, $level)
211211
protected function _renderAnchor($menuItem, $level)
212212
{
213213
if ($level == 1 && $menuItem->getUrl() == '#') {
214-
$output = '<strong class="submenu-group-title" role="presentation">'
215-
. '<span>' . $this->_getAnchorLabel($menuItem) . '</span>'
216-
. '</strong>';
214+
$output = '';
215+
if ($menuItem->hasChildren()) {
216+
$output = '<strong class="submenu-group-title" role="presentation">'
217+
. '<span>' . $this->_getAnchorLabel($menuItem) . '</span>'
218+
. '</strong>';
219+
}
217220
} else {
218221
$output = '<a href="' . $menuItem->getUrl() . '" ' . $this->_renderItemAnchorTitle(
219222
$menuItem

app/code/Magento/Backend/Block/Page/Copyright.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ class Copyright extends \Magento\Backend\Block\Template
1515
*
1616
* @var string
1717
*/
18-
protected $_template = 'page/copyright.phtml';
18+
protected $_template = 'Magento_Backend::page/copyright.phtml';
1919
}

app/code/Magento/Backend/Block/Page/Footer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Footer extends \Magento\Backend\Block\Template
1515
/**
1616
* @var string
1717
*/
18-
protected $_template = 'page/footer.phtml';
18+
protected $_template = 'Magento_Backend::page/footer.phtml';
1919

2020
/**
2121
* @var \Magento\Framework\App\ProductMetadataInterface

app/code/Magento/Backend/Block/Page/Header.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Header extends \Magento\Backend\Block\Template
1818
/**
1919
* @var string
2020
*/
21-
protected $_template = 'page/header.phtml';
21+
protected $_template = 'Magento_Backend::page/header.phtml';
2222

2323
/**
2424
* Backend data

app/code/Magento/Backend/Block/Store/Switcher/Form/Renderer/Fieldset.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Fieldset extends \Magento\Backend\Block\Template implements \Magento\Frame
2323
/**
2424
* @var string
2525
*/
26-
protected $_template = 'store/switcher/form/renderer/fieldset.phtml';
26+
protected $_template = 'Magento_Backend::store/switcher/form/renderer/fieldset.phtml';
2727

2828
/**
2929
* Retrieve an element

app/code/Magento/Backend/Block/Store/Switcher/Form/Renderer/Fieldset/Element.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Element extends \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Eleme
2121
/**
2222
* @var string
2323
*/
24-
protected $_template = 'store/switcher/form/renderer/fieldset/element.phtml';
24+
protected $_template = 'Magento_Backend::store/switcher/form/renderer/fieldset/element.phtml';
2525

2626
/**
2727
* Retrieve an element

app/code/Magento/Backend/view/adminhtml/templates/widget/button/split.phtml

+7-7
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
<?php endif; ?>
4242
</div>
4343

44-
<script>
45-
require(['jquery'], function($){
46-
$('.actions-split')
47-
.on('click.splitDefault', '.action-default', function() {
48-
$(this).siblings('.dropdown-menu').find('.item-default').trigger('click');
49-
});
50-
});
44+
<script type="text/x-magento-init">
45+
{
46+
".actions-split": {
47+
"Magento_Ui/js/grid/controls/button/split": {}
48+
}
49+
}
5150
</script>
51+

app/code/Magento/Braintree/i18n/en_US.csv

+2-1
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,5 @@ Debug,Debug
165165
"credit_card","Credit card"
166166
"apple_pay_card","Apple pay card"
167167
"android_pay_card","Android pay card"
168-
"Accept credit/debit cards and PayPal in your Magento store.<br/>No setup or monthly fees and your customers never leave your store to complete the purchase.","Accept credit/debit cards and PayPal in your Magento store.<br/>No setup or monthly fees and your customers never leave your store to complete the purchase."
168+
"Accept credit/debit cards and PayPal in your Magento store.<br/>No setup or monthly fees and your customers never leave your store to complete the purchase.","Accept credit/debit cards and PayPal in your Magento store.<br/>No setup or monthly fees and your customers never leave your store to complete the purchase."
169+
"Save for later use.","Save for later use."

app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $ccType = $block->getInfoData('cc_type');
8484
name="payment[is_active_payment_token_enabler]"
8585
class="admin__control-checkbox"/>
8686
<label class="label" for="<?php /* @noEscape */ echo $code; ?>_vault">
87-
<span><?php echo $block->escapeHtml('Save for later use.'); ?></span>
87+
<span><?php echo $block->escapeHtml(__('Save for later use.')); ?></span>
8888
</label>
8989
</div>
9090
<?php endif; ?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Captcha\Test\Unit\Observer;
8+
9+
use Magento\Captcha\Helper\Data as CaptchaDataHelper;
10+
use Magento\Captcha\Observer\CaptchaStringResolver;
11+
use Magento\Framework\App\Request\Http as HttpRequest;
12+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
13+
14+
class CaptchaStringResolverTest extends \PHPUnit_Framework_TestCase
15+
{
16+
/**
17+
* @var ObjectManager
18+
*/
19+
private $objectManagerHelper;
20+
21+
/**
22+
* @var CaptchaStringResolver
23+
*/
24+
private $captchaStringResolver;
25+
26+
/**
27+
* @var HttpRequest|\PHPUnit_Framework_MockObject_MockObject
28+
*/
29+
private $requestMock;
30+
31+
protected function setUp()
32+
{
33+
$this->objectManagerHelper = new ObjectManager($this);
34+
$this->requestMock = $this->getMock(HttpRequest::class, [], [], '', false);
35+
$this->captchaStringResolver = $this->objectManagerHelper->getObject(CaptchaStringResolver::class);
36+
}
37+
38+
public function testResolveWithFormIdSet()
39+
{
40+
$formId = 'contact_us';
41+
$captchaValue = 'some-value';
42+
43+
$this->requestMock->expects($this->once())
44+
->method('getPost')
45+
->with(CaptchaDataHelper::INPUT_NAME_FIELD_VALUE)
46+
->willReturn([$formId => $captchaValue]);
47+
48+
self::assertEquals(
49+
$this->captchaStringResolver->resolve($this->requestMock, $formId),
50+
$captchaValue
51+
);
52+
}
53+
54+
public function testResolveWithNoFormIdInRequest()
55+
{
56+
$formId = 'contact_us';
57+
58+
$this->requestMock->expects($this->once())
59+
->method('getPost')
60+
->with(CaptchaDataHelper::INPUT_NAME_FIELD_VALUE)
61+
->willReturn([]);
62+
63+
self::assertEquals(
64+
$this->captchaStringResolver->resolve($this->requestMock, $formId),
65+
''
66+
);
67+
}
68+
}

0 commit comments

Comments
 (0)