Skip to content

Commit 4fc092c

Browse files
author
Yushkin, Dmytro
committed
Merge branch 'develop' of github.corp.magento.com:magento2/magento2ce into folks-bugfix
2 parents cc49367 + 9b314ba commit 4fc092c

File tree

35 files changed

+375
-159
lines changed

35 files changed

+375
-159
lines changed

app/code/Magento/Backend/view/adminhtml/layout/default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<head>
1010
<title>Magento Admin</title>
11-
<meta name="viewport" content="width=device-width"/>
11+
<meta name="viewport" content="width=1024, initial-scale=1"/>
1212
<link src="requirejs/require.js"/>
1313
<css src="extjs/resources/css/ext-all.css"/>
1414
<css src="extjs/resources/css/ytheme-magento.css"/>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/** @var $block \Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Options */
1010
?>
11-
<fieldset class="fieldset ignore-validate">
11+
<fieldset class="fieldset">
1212
<legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Manage Options (values of your attribute)') ?></span></legend>
1313
<div id="manage-options-panel">
1414
<table class="admin__control-table">
@@ -27,8 +27,14 @@
2727
<th class="col-delete">&nbsp;</th>
2828
</tr>
2929
</thead>
30-
<tbody data-role="options-container"></tbody>
30+
<tbody data-role="options-container" class="ignore-validate"></tbody>
3131
<tfoot>
32+
<tr>
33+
<th colspan="<?php /* @escapeNotVerified */ echo $storetotal; ?>" class="validation">
34+
<input type="hidden" class="required-dropdown-attribute-entry" name="dropdown_attribute_validation"/>
35+
</th>
36+
</tr>
37+
<tr>
3238
<th colspan="<?php /* @escapeNotVerified */ echo $storetotal; ?>" class="col-actions-add">
3339
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()):?>
3440
<button id="add_new_option_button" title="<?php /* @escapeNotVerified */ echo __('Add Option'); ?>"
@@ -37,6 +43,7 @@
3743
</button>
3844
<?php endif; ?>
3945
</th>
46+
</tr>
4047
</tfoot>
4148
</table>
4249
<input type="hidden" id="option-count-check" value="" />

app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ define([
2424
type: 'slide',
2525
buttons: [],
2626
opened: function () {
27+
$(this).parent().addClass('modal-content-new-attribute');
2728
self.iframe = $('<iframe id="create_new_attribute_container">').attr({
2829
src: self._prepareUrl(),
2930
frameborder: 0

app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ protected function _prepareForm()
156156
);
157157

158158
$designFieldset->addField(
159-
'custom_page_layout',
159+
'custom_root_template',
160160
'select',
161161
[
162-
'name' => 'custom_page_layout',
162+
'name' => 'custom_root_template',
163163
'label' => __('Custom Layout'),
164164
'values' => $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray(true),
165165
'disabled' => $isElementDisabled

app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function execute()
6666
/** @var \Magento\Cms\Model\Page $page */
6767
$page = $this->pageRepository->getById($pageId);
6868
try {
69-
$pageData = $this->dataProcessor->filter($postItems[$pageId]);
69+
$pageData = $this->filterPost($postItems[$pageId]);
7070
$this->validatePost($pageData, $page, $error, $messages);
7171
$extendedPageData = $page->getData();
7272
$this->setCmsPageData($page, $extendedPageData, $pageData);
@@ -92,6 +92,22 @@ public function execute()
9292
]);
9393
}
9494

95+
/**
96+
* Filtering posted data.
97+
*
98+
* @param array $postData
99+
* @return array
100+
*/
101+
protected function filterPost($postData = [])
102+
{
103+
$pageData = $this->dataProcessor->filter($postData);
104+
$pageData['custom_theme'] = isset($pageData['custom_theme']) ? $pageData['custom_theme'] : null;
105+
$pageData['custom_root_template'] = isset($pageData['custom_root_template'])
106+
? $pageData['custom_root_template']
107+
: null;
108+
return $pageData;
109+
}
110+
95111
/**
96112
* Validate post data
97113
*

app/code/Magento/Cms/Model/Block.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,14 @@ public function setIsActive($isActive)
214214
{
215215
return $this->setData(self::IS_ACTIVE, $isActive);
216216
}
217+
218+
/**
219+
* Receive page store ids
220+
*
221+
* @return int[]
222+
*/
223+
public function getStores()
224+
{
225+
return $this->hasData('stores') ? $this->getData('stores') : $this->getData('store_id');
226+
}
217227
}

app/code/Magento/Cms/Model/BlockRepository.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\Framework\Reflection\DataObjectProcessor;
1616
use Magento\Cms\Model\ResourceModel\Block as ResourceBlock;
1717
use Magento\Cms\Model\ResourceModel\Block\CollectionFactory as BlockCollectionFactory;
18+
use Magento\Store\Model\StoreManagerInterface;
1819

1920
/**
2021
* Class BlockRepository
@@ -57,6 +58,11 @@ class BlockRepository implements BlockRepositoryInterface
5758
*/
5859
protected $dataBlockFactory;
5960

61+
/**
62+
* @var \Magento\Store\Model\StoreManagerInterface
63+
*/
64+
private $storeManager;
65+
6066
/**
6167
* @param ResourceBlock $resource
6268
* @param BlockFactory $blockFactory
@@ -65,6 +71,7 @@ class BlockRepository implements BlockRepositoryInterface
6571
* @param Data\BlockSearchResultsInterfaceFactory $searchResultsFactory
6672
* @param DataObjectHelper $dataObjectHelper
6773
* @param DataObjectProcessor $dataObjectProcessor
74+
* @param StoreManagerInterface $storeManager
6875
*/
6976
public function __construct(
7077
ResourceBlock $resource,
@@ -73,7 +80,8 @@ public function __construct(
7380
BlockCollectionFactory $blockCollectionFactory,
7481
Data\BlockSearchResultsInterfaceFactory $searchResultsFactory,
7582
DataObjectHelper $dataObjectHelper,
76-
DataObjectProcessor $dataObjectProcessor
83+
DataObjectProcessor $dataObjectProcessor,
84+
StoreManagerInterface $storeManager
7785
) {
7886
$this->resource = $resource;
7987
$this->blockFactory = $blockFactory;
@@ -82,6 +90,7 @@ public function __construct(
8290
$this->dataObjectHelper = $dataObjectHelper;
8391
$this->dataBlockFactory = $dataBlockFactory;
8492
$this->dataObjectProcessor = $dataObjectProcessor;
93+
$this->storeManager = $storeManager;
8594
}
8695

8796
/**
@@ -93,6 +102,8 @@ public function __construct(
93102
*/
94103
public function save(Data\BlockInterface $block)
95104
{
105+
$storeId = $this->storeManager->getStore()->getId();
106+
$block->setStoreId($storeId);
96107
try {
97108
$this->resource->save($block);
98109
} catch (\Exception $exception) {

app/code/Magento/Cms/Model/Page/Source/ThemeFilter.php renamed to app/code/Magento/Cms/Model/Page/Source/CustomLayout.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
namespace Magento\Cms\Model\Page\Source;
77

88
/**
9-
* Theme filter source
9+
* Custom layout source
1010
*/
11-
class ThemeFilter extends Theme
11+
class CustomLayout extends PageLayout
1212
{
1313
/**
1414
* {@inheritdoc}
1515
*/
1616
public function toOptionArray()
1717
{
18-
return array_merge([['label' => '', 'value' => '']], parent::toOptionArray());
18+
return array_merge([['label' => 'Default', 'value' => '']], parent::toOptionArray());
1919
}
2020
}

app/code/Magento/Cms/Model/Page/Source/Theme.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function __construct(ListInterface $themeList)
3535
*/
3636
public function toOptionArray()
3737
{
38-
return $this->themeList->getLabels();
38+
$options[] = ['label' => 'Default', 'value' => ''];
39+
return array_merge($options, $this->themeList->getLabels());
3940
}
4041
}

app/code/Magento/Cms/Model/PageRepository.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\Framework\Reflection\DataObjectProcessor;
1616
use Magento\Cms\Model\ResourceModel\Page as ResourcePage;
1717
use Magento\Cms\Model\ResourceModel\Page\CollectionFactory as PageCollectionFactory;
18+
use Magento\Store\Model\StoreManagerInterface;
1819

1920
/**
2021
* Class PageRepository
@@ -57,6 +58,11 @@ class PageRepository implements PageRepositoryInterface
5758
*/
5859
protected $dataPageFactory;
5960

61+
/**
62+
* @var \Magento\Store\Model\StoreManagerInterface
63+
*/
64+
private $storeManager;
65+
6066
/**
6167
* @param ResourcePage $resource
6268
* @param PageFactory $pageFactory
@@ -65,6 +71,7 @@ class PageRepository implements PageRepositoryInterface
6571
* @param Data\PageSearchResultsInterfaceFactory $searchResultsFactory
6672
* @param DataObjectHelper $dataObjectHelper
6773
* @param DataObjectProcessor $dataObjectProcessor
74+
* @param StoreManagerInterface $storeManager
6875
*/
6976
public function __construct(
7077
ResourcePage $resource,
@@ -73,7 +80,8 @@ public function __construct(
7380
PageCollectionFactory $pageCollectionFactory,
7481
Data\PageSearchResultsInterfaceFactory $searchResultsFactory,
7582
DataObjectHelper $dataObjectHelper,
76-
DataObjectProcessor $dataObjectProcessor
83+
DataObjectProcessor $dataObjectProcessor,
84+
StoreManagerInterface $storeManager
7785
) {
7886
$this->resource = $resource;
7987
$this->pageFactory = $pageFactory;
@@ -82,6 +90,7 @@ public function __construct(
8290
$this->dataObjectHelper = $dataObjectHelper;
8391
$this->dataPageFactory = $dataPageFactory;
8492
$this->dataObjectProcessor = $dataObjectProcessor;
93+
$this->storeManager = $storeManager;
8594
}
8695

8796
/**
@@ -93,6 +102,8 @@ public function __construct(
93102
*/
94103
public function save(\Magento\Cms\Api\Data\PageInterface $page)
95104
{
105+
$storeId = $this->storeManager->getStore()->getId();
106+
$page->setStoreId($storeId);
96107
try {
97108
$this->resource->save($page);
98109
} catch (\Exception $exception) {

0 commit comments

Comments
 (0)