diff --git a/app/code/Magento/Authorization/Model/ResourceModel/Rules.php b/app/code/Magento/Authorization/Model/ResourceModel/Rules.php index ace8e4d719a6a..82bd7f60d0544 100644 --- a/app/code/Magento/Authorization/Model/ResourceModel/Rules.php +++ b/app/code/Magento/Authorization/Model/ResourceModel/Rules.php @@ -103,6 +103,8 @@ public function saveRel(\Magento\Authorization\Model\Rules $rule) $connection->insert($this->getMainTable(), $insertData); } else { + /** Give basic admin permissions to any admin */ + $postedResources[] = \Magento\Backend\App\AbstractAction::ADMIN_RESOURCE; $acl = $this->_aclBuilder->getAcl(); /** @var $resource \Magento\Framework\Acl\AclResource */ foreach ($acl->getResources() as $resourceId) { diff --git a/app/code/Magento/Persistent/Model/Session.php b/app/code/Magento/Persistent/Model/Session.php index e35d3387ae082..48ba5e8918d29 100644 --- a/app/code/Magento/Persistent/Model/Session.php +++ b/app/code/Magento/Persistent/Model/Session.php @@ -289,7 +289,7 @@ public function deleteByCustomerId($customerId, $clearCookie = true) */ public function removePersistentCookie() { - $cookieMetadata = $this->_cookieMetadataFactory->createCookieMetadata() + $cookieMetadata = $this->_cookieMetadataFactory->createSensitiveCookieMetadata() ->setPath($this->sessionConfig->getCookiePath()); $this->_cookieManager->deleteCookie(self::COOKIE_NAME, $cookieMetadata); return $this; diff --git a/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php b/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php index 88bc3e6946471..1cb59428f709f 100644 --- a/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php +++ b/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php @@ -91,7 +91,7 @@ public function testAfterDeleteCommit() { $cookiePath = 'some_path'; $this->configMock->expects($this->once())->method('getCookiePath')->will($this->returnValue($cookiePath)); - $cookieMetadataMock = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\CookieMetadata') + $cookieMetadataMock = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata') ->disableOriginalConstructor() ->getMock(); $cookieMetadataMock->expects($this->once()) @@ -99,7 +99,7 @@ public function testAfterDeleteCommit() ->with($cookiePath) ->will($this->returnSelf()); $this->cookieMetadataFactoryMock->expects($this->once()) - ->method('createCookieMetadata') + ->method('createSensitiveCookieMetadata') ->will($this->returnValue($cookieMetadataMock)); $this->cookieManagerMock->expects( $this->once() diff --git a/app/code/Magento/Theme/Setup/InstallData.php b/app/code/Magento/Theme/Setup/InstallData.php new file mode 100644 index 0000000000000..d1d8744ec1456 --- /dev/null +++ b/app/code/Magento/Theme/Setup/InstallData.php @@ -0,0 +1,41 @@ +themeRegistration = $themeRegistration; + } + + /** + * {@inheritdoc} + */ + public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) + { + $this->themeRegistration->register(); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/expectedPhrases.csv b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/expectedPhrases.csv index b20a54d1bc0dc..65b9d12f213f6 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/expectedPhrases.csv +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/expectedPhrases.csv @@ -15,6 +15,6 @@ "string with placeholder in double quotes ""%1""","string with placeholder in double quotes ""%1""" "string with 'single quotes'","string with 'single quotes'" "string with placeholder in single quotes '%1'","string with placeholder in single quotes '%1'" -"string with escaped \"double quotes\"","string with escaped \"double quotes\"" -"string with placeholder in escaped double quotes \"%1\"","string with placeholder in escaped double quotes \"%1\"" +"string with escaped ""double quotes""","string with escaped ""double quotes""" +"string with placeholder in escaped double quotes ""%1""","string with placeholder in escaped double quotes ""%1""" "string that\'s got an unclosed single quote in it","string that\'s got an unclosed single quote in it" diff --git a/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php b/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php index 234d9f87b28e9..9138107311228 100644 --- a/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php +++ b/lib/internal/Magento/Framework/Phrase/Renderer/Translate.php @@ -49,6 +49,8 @@ public function __construct( public function render(array $source, array $arguments) { $text = end($source); + /* If phrase contains escaped double quote then use translation for phrase with non-escaped quote */ + $text = str_replace('\"', '"', $text); try { $data = $this->translator->getData(); diff --git a/setup/src/Magento/Setup/Module/I18n/Dictionary/Phrase.php b/setup/src/Magento/Setup/Module/I18n/Dictionary/Phrase.php index 50aa50c11f908..2bf350ee1555f 100644 --- a/setup/src/Magento/Setup/Module/I18n/Dictionary/Phrase.php +++ b/setup/src/Magento/Setup/Module/I18n/Dictionary/Phrase.php @@ -267,11 +267,14 @@ public function getCompiledTranslation() private function getCompiledString($string) { $encloseQuote = $this->getQuote() == Phrase::QUOTE_DOUBLE ? Phrase::QUOTE_DOUBLE : Phrase::QUOTE_SINGLE; - //find all occurrences of ' and ", with no \ before it. + /* Find all occurrences of ' and ", with no \ before it for concatenation */ preg_match_all('/[^\\\\]' . $encloseQuote . '|' . $encloseQuote . '[^\\\\]/', $string, $matches); if (count($matches[0])) { $string = preg_replace('/([^\\\\])' . $encloseQuote . ' ?\. ?' . $encloseQuote . '/', '$1', $string); } + /* Remove all occurrences of escaped double quote because it is not desirable in csv file. + Translation for such phrases will use translation for phrase without escaped quote. */ + $string = str_replace('\"', '"', $string); return $string; } }