Skip to content

Commit f5c9ed8

Browse files
committed
Merge branch 'develop' of github.corp.magento.com:magento2/magento2ce into MAGETWO-49154-updated
2 parents c93133c + 4858f04 commit f5c9ed8

File tree

9 files changed

+63
-10
lines changed

9 files changed

+63
-10
lines changed

app/code/Magento/Authorization/Model/ResourceModel/Rules.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public function saveRel(\Magento\Authorization\Model\Rules $rule)
103103

104104
$connection->insert($this->getMainTable(), $insertData);
105105
} else {
106+
/** Give basic admin permissions to any admin */
107+
$postedResources[] = \Magento\Backend\App\AbstractAction::ADMIN_RESOURCE;
106108
$acl = $this->_aclBuilder->getAcl();
107109
/** @var $resource \Magento\Framework\Acl\AclResource */
108110
foreach ($acl->getResources() as $resourceId) {

app/code/Magento/Persistent/Model/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public function deleteByCustomerId($customerId, $clearCookie = true)
289289
*/
290290
public function removePersistentCookie()
291291
{
292-
$cookieMetadata = $this->_cookieMetadataFactory->createCookieMetadata()
292+
$cookieMetadata = $this->_cookieMetadataFactory->createSensitiveCookieMetadata()
293293
->setPath($this->sessionConfig->getCookiePath());
294294
$this->_cookieManager->deleteCookie(self::COOKIE_NAME, $cookieMetadata);
295295
return $this;

app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ public function testAfterDeleteCommit()
9191
{
9292
$cookiePath = 'some_path';
9393
$this->configMock->expects($this->once())->method('getCookiePath')->will($this->returnValue($cookiePath));
94-
$cookieMetadataMock = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\CookieMetadata')
94+
$cookieMetadataMock = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata')
9595
->disableOriginalConstructor()
9696
->getMock();
9797
$cookieMetadataMock->expects($this->once())
9898
->method('setPath')
9999
->with($cookiePath)
100100
->will($this->returnSelf());
101101
$this->cookieMetadataFactoryMock->expects($this->once())
102-
->method('createCookieMetadata')
102+
->method('createSensitiveCookieMetadata')
103103
->will($this->returnValue($cookieMetadataMock));
104104
$this->cookieManagerMock->expects(
105105
$this->once()

app/code/Magento/Review/Controller/Product/ListAjax.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Review\Controller\Product;
77

8+
use Magento\Framework\Exception\LocalizedException;
89
use Magento\Review\Controller\Product as ProductController;
910
use Magento\Framework\Controller\ResultFactory;
1011

@@ -17,9 +18,13 @@ class ListAjax extends ProductController
1718
*/
1819
public function execute()
1920
{
20-
$this->initProduct();
21-
/** @var \Magento\Framework\View\Result\Layout $resultLayout */
22-
$resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
21+
if (!$this->initProduct()) {
22+
throw new LocalizedException(__('Cannot initialize product'));
23+
} else {
24+
/** @var \Magento\Framework\View\Result\Layout $resultLayout */
25+
$resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
26+
}
27+
2328
return $resultLayout;
2429
}
2530
}

app/code/Magento/Search/view/frontend/web/form-mini.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ define([
249249

250250
this.responseList.indexList
251251
.on('click', function (e) {
252-
this.responseList.selected = $(e.target);
252+
this.responseList.selected = $(e.currentTarget);
253253
this.searchForm.trigger('submit');
254254
}.bind(this))
255255
.on('mouseenter mouseleave', function (e) {
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Theme\Setup;
8+
9+
use Magento\Framework\Setup\InstallDataInterface;
10+
use Magento\Framework\Setup\ModuleContextInterface;
11+
use Magento\Framework\Setup\ModuleDataSetupInterface;
12+
use Magento\Theme\Model\Theme\Registration;
13+
14+
/**
15+
* Register themes
16+
*/
17+
class InstallData implements InstallDataInterface
18+
{
19+
/**
20+
* @var Registration
21+
*/
22+
private $themeRegistration;
23+
24+
/**
25+
* Initialize dependencies
26+
*
27+
* @param Registration $themeRegistration
28+
*/
29+
public function __construct(Registration $themeRegistration)
30+
{
31+
$this->themeRegistration = $themeRegistration;
32+
}
33+
34+
/**
35+
* {@inheritdoc}
36+
*/
37+
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
38+
{
39+
$this->themeRegistration->register();
40+
}
41+
}

dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/expectedPhrases.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"string with placeholder in double quotes ""%1""","string with placeholder in double quotes ""%1"""
1616
"string with 'single quotes'","string with 'single quotes'"
1717
"string with placeholder in single quotes '%1'","string with placeholder in single quotes '%1'"
18-
"string with escaped \"double quotes\"","string with escaped \"double quotes\""
19-
"string with placeholder in escaped double quotes \"%1\"","string with placeholder in escaped double quotes \"%1\""
18+
"string with escaped ""double quotes""","string with escaped ""double quotes"""
19+
"string with placeholder in escaped double quotes ""%1""","string with placeholder in escaped double quotes ""%1"""
2020
"string that\'s got an unclosed single quote in it","string that\'s got an unclosed single quote in it"

lib/internal/Magento/Framework/Phrase/Renderer/Translate.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public function __construct(
4949
public function render(array $source, array $arguments)
5050
{
5151
$text = end($source);
52+
/* If phrase contains escaped double quote then use translation for phrase with non-escaped quote */
53+
$text = str_replace('\"', '"', $text);
5254

5355
try {
5456
$data = $this->translator->getData();

setup/src/Magento/Setup/Module/I18n/Dictionary/Phrase.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,14 @@ public function getCompiledTranslation()
267267
private function getCompiledString($string)
268268
{
269269
$encloseQuote = $this->getQuote() == Phrase::QUOTE_DOUBLE ? Phrase::QUOTE_DOUBLE : Phrase::QUOTE_SINGLE;
270-
//find all occurrences of ' and ", with no \ before it.
270+
/* Find all occurrences of ' and ", with no \ before it for concatenation */
271271
preg_match_all('/[^\\\\]' . $encloseQuote . '|' . $encloseQuote . '[^\\\\]/', $string, $matches);
272272
if (count($matches[0])) {
273273
$string = preg_replace('/([^\\\\])' . $encloseQuote . ' ?\. ?' . $encloseQuote . '/', '$1', $string);
274274
}
275+
/* Remove all occurrences of escaped double quote because it is not desirable in csv file.
276+
Translation for such phrases will use translation for phrase without escaped quote. */
277+
$string = str_replace('\"', '"', $string);
275278
return $string;
276279
}
277280
}

0 commit comments

Comments
 (0)