Skip to content

Commit 24d27aa

Browse files
committed
Merge remote-tracking branch 'origin/develop' into PR-webdev
2 parents 8408586 + 4858f04 commit 24d27aa

File tree

7 files changed

+54
-6
lines changed

7 files changed

+54
-6
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()
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)