Skip to content

Commit

Permalink
Merge pull request #1421 from magento-engcom/develop-prs
Browse files Browse the repository at this point in the history
[EngCom] Public Pull Requests
 - MAGETWO-71659: Fix for url_rewrite on page delete via api #10568
 - MAGETWO-71617: Fixes Regression in 2.2 - menu.xml config ignored #10543
 - MAGETWO-71380: Fix JS translation search #10445
 - MAGETWO-71201: Improved calculating version hash for the js-translation.json file. #10378
  • Loading branch information
ishakhsuvarov committed Aug 18, 2017
2 parents d19e900 + a6ff645 commit adb30ab
Show file tree
Hide file tree
Showing 15 changed files with 338 additions and 106 deletions.
16 changes: 8 additions & 8 deletions app/code/Magento/Backend/Model/Menu/Item.php
Expand Up @@ -466,15 +466,15 @@ public function toArray()
{
return [
'parent_id' => $this->_parentId,
'module_name' => $this->_moduleName,
'module' => $this->_moduleName,
'sort_index' => $this->_sortIndex,
'depends_on_config' => $this->_dependsOnConfig,
'dependsOnConfig' => $this->_dependsOnConfig,
'id' => $this->_id,
'resource' => $this->_resource,
'path' => $this->_path,
'action' => $this->_action,
'depends_on_module' => $this->_dependsOnModule,
'tooltip' => $this->_tooltip,
'dependsOnModule' => $this->_dependsOnModule,
'toolTip' => $this->_tooltip,
'title' => $this->_title,
'target' => $this->target,
'sub_menu' => isset($this->_submenu) ? $this->_submenu->toArray() : null
Expand All @@ -491,15 +491,15 @@ public function toArray()
public function populateFromArray(array $data)
{
$this->_parentId = $this->_getArgument($data, 'parent_id');
$this->_moduleName = $this->_getArgument($data, 'module_name', 'Magento_Backend');
$this->_moduleName = $this->_getArgument($data, 'module', 'Magento_Backend');
$this->_sortIndex = $this->_getArgument($data, 'sort_index');
$this->_dependsOnConfig = $this->_getArgument($data, 'depends_on_config');
$this->_dependsOnConfig = $this->_getArgument($data, 'dependsOnConfig');
$this->_id = $this->_getArgument($data, 'id');
$this->_resource = $this->_getArgument($data, 'resource');
$this->_path = $this->_getArgument($data, 'path', '');
$this->_action = $this->_getArgument($data, 'action');
$this->_dependsOnModule = $this->_getArgument($data, 'depends_on_module');
$this->_tooltip = $this->_getArgument($data, 'tooltip', '');
$this->_dependsOnModule = $this->_getArgument($data, 'dependsOnModule');
$this->_tooltip = $this->_getArgument($data, 'toolTip');
$this->_title = $this->_getArgument($data, 'title');
$this->target = $this->_getArgument($data, 'target');
if (isset($data['sub_menu'])) {
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Backend/Test/Unit/Model/Menu/ItemTest.php
Expand Up @@ -56,9 +56,9 @@ class ItemTest extends \PHPUnit\Framework\TestCase
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
];

protected function setUp()
Expand Down
Expand Up @@ -12,21 +12,21 @@
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
],
[
'parent_id' => null,
'module_name' => 'Magento_Backend',
'module' => 'Magento_Backend',
'sort_index' => null,
'depends_on_config' => 'system/config/isEnabled',
'dependsOnConfig' => 'system/config/isEnabled',
'id' => 'item',
'resource' => 'Magento_Config::config',
'path' => '',
'action' => '/system/config',
'depends_on_module' => 'Magento_Backend',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'toolTip' => 'Item tooltip',
'title' => 'Item Title',
'sub_menu' => null,
'target' => null
Expand All @@ -38,43 +38,43 @@
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
],
[
'parent_id' => '1',
'module_name' => 'Magento_Module1',
'module' => 'Magento_Module1',
'sort_index' => '50',
'depends_on_config' => null,
'dependsOnConfig' => null,
'id' => '5',
'resource' => null,
'path' => null,
'action' => null,
'depends_on_module' => null,
'tooltip' => null,
'dependsOnModule' => null,
'toolTip' => null,
'title' => null,
'sub_menu' => [
'id' => 'item',
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
],
],
[
'parent_id' => '1',
'module_name' => 'Magento_Module1',
'module' => 'Magento_Module1',
'sort_index' => '50',
'depends_on_config' => null,
'dependsOnConfig' => null,
'id' => '5',
'resource' => null,
'path' => '',
'action' => null,
'depends_on_module' => null,
'tooltip' => '',
'dependsOnModule' => null,
'toolTip' => '',
'title' => null,
'sub_menu' => ['submenuArray'],
'target' => null
Expand All @@ -83,51 +83,51 @@
'data with submenu to constructor' => [
[
'parent_id' => '1',
'module_name' => 'Magento_Module1',
'module' => 'Magento_Module1',
'sort_index' => '50',
'depends_on_config' => null,
'dependsOnConfig' => null,
'id' => '5',
'resource' => null,
'path' => null,
'action' => null,
'depends_on_module' => null,
'tooltip' => null,
'dependsOnModule' => null,
'toolTip' => null,
'title' => null,
'sub_menu' => [
'id' => 'item',
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
],
],
[
'parent_id' => '1',
'module_name' => 'Magento_Module1',
'module' => 'Magento_Module1',
'sort_index' => '50',
'sub_menu' => [
'id' => 'item',
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
],
],
[
'parent_id' => '1',
'module_name' => 'Magento_Module1',
'module' => 'Magento_Module1',
'sort_index' => '50',
'depends_on_config' => null,
'dependsOnConfig' => null,
'id' => null,
'resource' => null,
'path' => '',
'action' => null,
'depends_on_module' => null,
'tooltip' => '',
'dependsOnModule' => null,
'toolTip' => '',
'title' => null,
'sub_menu' => ['submenuArray'],
'target' => null
Expand Down
64 changes: 32 additions & 32 deletions app/code/Magento/Backend/Test/Unit/Model/_files/menu_item_data.php
Expand Up @@ -11,22 +11,22 @@
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
'sub_menu' => null,
],
[
'parent_id' => null,
'module_name' => 'Magento_Backend',
'module' => 'Magento_Backend',
'sort_index' => null,
'depends_on_config' => 'system/config/isEnabled',
'dependsOnConfig' => 'system/config/isEnabled',
'id' => 'item',
'resource' => 'Magento_Config::config',
'path' => '',
'action' => '/system/config',
'depends_on_module' => 'Magento_Backend',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'toolTip' => 'Item tooltip',
'title' => 'Item Title',
'sub_menu' => null,
'target' => null
Expand All @@ -35,85 +35,85 @@
'with submenu' => [
[
'parent_id' => '1',
'module_name' => 'Magento_Module1',
'module' => 'Magento_Module1',
'sort_index' => '50',
'depends_on_config' => null,
'dependsOnConfig' => null,
'id' => '5',
'resource' => null,
'path' => null,
'action' => null,
'depends_on_module' => null,
'tooltip' => null,
'dependsOnModule' => null,
'toolTip' => null,
'title' => null,
'sub_menu' => [
'id' => 'item',
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
],
],
[
'parent_id' => '1',
'module_name' => 'Magento_Module1',
'module' => 'Magento_Module1',
'sort_index' => '50',
'depends_on_config' => null,
'dependsOnConfig' => null,
'id' => '5',
'resource' => null,
'path' => null,
'action' => null,
'depends_on_module' => null,
'tooltip' => '',
'dependsOnModule' => null,
'toolTip' => '',
'title' => null,
'sub_menu' => [
'id' => 'item',
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
],
'target' => null
]
],
'small set of data' => [
[
'parent_id' => '1',
'module_name' => 'Magento_Module1',
'module' => 'Magento_Module1',
'sort_index' => '50',
'sub_menu' => [
'id' => 'item',
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
],
],
[
'parent_id' => '1',
'module_name' => 'Magento_Module1',
'module' => 'Magento_Module1',
'sort_index' => '50',
'depends_on_config' => null,
'dependsOnConfig' => null,
'id' => null,
'resource' => null,
'path' => '',
'action' => null,
'depends_on_module' => null,
'tooltip' => '',
'dependsOnModule' => null,
'toolTip' => '',
'title' => null,
'sub_menu' => [
'id' => 'item',
'title' => 'Item Title',
'action' => '/system/config',
'resource' => 'Magento_Config::config',
'depends_on_module' => 'Magento_Backend',
'depends_on_config' => 'system/config/isEnabled',
'tooltip' => 'Item tooltip',
'dependsOnModule' => 'Magento_Backend',
'dependsOnConfig' => 'system/config/isEnabled',
'toolTip' => 'Item tooltip',
],
'target' => null
]
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions app/code/Magento/Translation/Block/Js.php
Expand Up @@ -68,4 +68,14 @@ public function getTranslationFilePath()
{
return $this->fileManager->getTranslationFilePath();
}

/**
* Gets current version of the translation file.
*
* @return string
*/
public function getTranslationFileVersion()
{
return $this->fileManager->getTranslationFileVersion();
}
}

0 comments on commit adb30ab

Please sign in to comment.