Skip to content

Commit eea5a8f

Browse files
author
Yaroslav Onischenko
committed
Merge remote-tracking branch 'mainline/develop' into BUGS_PR
2 parents f46da7b + f278923 commit eea5a8f

File tree

16 files changed

+255
-11
lines changed

16 files changed

+255
-11
lines changed

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,13 +931,13 @@ public function checkAttributeUniqueValue(AbstractAttribute $attribute, $object)
931931
$select = $connection->select();
932932
if ($attribute->getBackend()->getType() === 'static') {
933933
$value = $object->getData($attribute->getAttributeCode());
934-
$bind = ['attribute_code' => trim($value)];
934+
$bind = ['value' => trim($value)];
935935

936936
$select->from(
937937
$this->getEntityTable(),
938938
$this->getEntityIdField()
939939
)->where(
940-
$attribute->getAttributeCode() . ' = :attribute_code'
940+
$attribute->getAttributeCode() . ' = :value'
941941
);
942942
} else {
943943
$value = $object->getData($attribute->getAttributeCode());
@@ -950,7 +950,7 @@ public function checkAttributeUniqueValue(AbstractAttribute $attribute, $object)
950950
];
951951
$select->from(
952952
$attribute->getBackend()->getTable(),
953-
$attribute->getBackend()->getEntityIdField()
953+
$object->getResource()->getLinkField()
954954
)->where(
955955
'attribute_id = :attribute_id'
956956
)->where(

app/code/Magento/Eav/Model/ResourceModel/UpdateHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public function execute($entityType, $data)
134134
if ((!array_key_exists($attribute->getAttributeCode(), $snapshot)
135135
|| $snapshot[$attribute->getAttributeCode()] === false)
136136
&& array_key_exists($attribute->getAttributeCode(), $data)
137+
&& $data[$attribute->getAttributeCode()] !== false
137138
&& !$attribute->isValueEmpty($data[$attribute->getAttributeCode()])
138139
) {
139140
$this->attributePersistor->registerInsert(
@@ -147,6 +148,7 @@ public function execute($entityType, $data)
147148
if (array_key_exists($attribute->getAttributeCode(), $snapshot)
148149
&& $snapshot[$attribute->getAttributeCode()] !== false
149150
&& array_key_exists($attribute->getAttributeCode(), $data)
151+
&& $data[$attribute->getAttributeCode()] !== false
150152
&& $snapshot[$attribute->getAttributeCode()] != $data[$attribute->getAttributeCode()]
151153
&& !$attribute->isValueEmpty($data[$attribute->getAttributeCode()])
152154
) {

app/code/Magento/Ui/Component/AbstractComponent.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ public function prepare()
106106
$this->getContext()->addActions($this->getData('actions'), $this);
107107
}
108108

109+
if ($this->hasData('html_blocks')) {
110+
$this->getContext()->addHtmlBlocks($this->getData('html_blocks'), $this);
111+
}
112+
109113
if ($this->hasData('buttons')) {
110114
$this->getContext()->addButtons($this->getData('buttons'), $this);
111115
}

app/code/Magento/Ui/Component/Control/ActionPool.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,21 @@ public function update($key, array $data)
117117
}
118118
}
119119

120+
/**
121+
* Add html block
122+
*
123+
* @param string $type
124+
* @param string $name
125+
* @param array $arguments
126+
* @return void
127+
*/
128+
public function addHtmlBlock($type, $name = '', array $arguments = [])
129+
{
130+
$toolbar = $this->getToolbar();
131+
$container = $this->context->getPageLayout()->createBlock($type, $name, $arguments);
132+
$toolbar->setChild($name, $container);
133+
}
134+
120135
/**
121136
* Create button container
122137
*

app/code/Magento/Ui/view/base/web/js/form/components/insert-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ define([
8585
/** @inheritdoc*/
8686
destroyInserted: function () {
8787
if (this.isRendered) {
88-
this.externalForm().destroy();
88+
this.externalForm().delegate('destroy');
8989
this.removeActions();
9090
this.responseStatus(undefined);
9191
this.responseData = {};

app/code/Magento/Ui/view/base/web/js/form/components/insert.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,14 @@ define([
123123
return this;
124124
}
125125

126+
self.previousParams = params || {};
127+
126128
$.async({
127129
component: this.name
128130
}, function (el) {
129131
self.contentEl = $(el);
130132
self.startRender = true;
131-
params = _.extend(params || {}, self.params);
133+
params = _.extend({}, self.params, params || {});
132134
request = self.requestData(params, self.renderSettings);
133135
request
134136
.done(self.onRender)

app/code/Magento/Ui/view/base/web/js/modal/modal-component.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ define([
7373
* @returns {Object} Chainable.
7474
*/
7575
initSelector: function () {
76+
var modalClass = this.name.replace(/\./g, '_');
77+
7678
this.contentSelector = '.' + this.modalClass;
77-
this.options.modalClass = this.name.replace(/\./g, '_');
78-
this.rootSelector = '.' + this.options.modalClass;
79+
this.options.modalClass = this.options.modalClass + ' ' + modalClass;
80+
this.rootSelector = '.' + modalClass;
7981

8082
return this;
8183
},

app/design/adminhtml/Magento/backend/Magento_Staging/web/css/source/_module.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55

66
@import 'module/_scheduled-changes.less';
77
@import 'module/_staging-data-tooltip.less';
8+
@import 'module/_scheduled-changes-modal.less';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// /**
2+
// * Copyright © 2015 Magento. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
//
7+
// Scheduled changes modal
8+
// _____________________________________________
9+
10+
//
11+
// Slide modal panel with store switcher
12+
// ---------------------------------------------
13+
14+
.scheduled-changes-modal-slide {
15+
.page-actions {
16+
.lib-vendor-prefix-display(flex);
17+
width: 100%;
18+
19+
.store-switcher {
20+
.lib-vendor-prefix-order(-1);
21+
-ms-flex: 1;
22+
-webkit-flex: 1;
23+
flex: 1;
24+
25+
.admin__action-dropdown {
26+
font-size: @action-dropdown__font-size;
27+
letter-spacing: -.025em;
28+
}
29+
}
30+
}
31+
}

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/CategoryTest.php

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,58 @@ public function testSuggestCategoriesActionNoSuggestions()
147147
public function saveActionDataProvider()
148148
{
149149
return [
150-
//'default values' removed from here. Should be fixed in MAGETWO-49481
150+
'default values' => [
151+
[
152+
'id' => '2',
153+
'entity_id' => '2',
154+
'path' => '1/2',
155+
'url_key' => 'default-category',
156+
'is_anchor' => false,
157+
'use_default' => [
158+
'name' => 1,
159+
'is_active' => 1,
160+
'thumbnail' => 1,
161+
'description' => 1,
162+
'image' => 1,
163+
'meta_title' => 1,
164+
'meta_keywords' => 1,
165+
'meta_description' => 1,
166+
'include_in_menu' => 1,
167+
'display_mode' => 1,
168+
'landing_page' => 1,
169+
'available_sort_by' => 1,
170+
'default_sort_by' => 1,
171+
'filter_price_range' => 1,
172+
'custom_apply_to_products' => 1,
173+
'custom_design' => 1,
174+
'custom_design_from' => 1,
175+
'custom_design_to' => 1,
176+
'page_layout' => 1,
177+
'custom_layout_update' => 1,
178+
],
179+
],
180+
[
181+
'name' => false,
182+
'default_sort_by' => false,
183+
'display_mode' => false,
184+
'meta_title' => false,
185+
'custom_design' => false,
186+
'page_layout' => false,
187+
'is_active' => false,
188+
'include_in_menu' => false,
189+
'landing_page' => false,
190+
'is_anchor' => false,
191+
'custom_apply_to_products' => false,
192+
'available_sort_by' => false,
193+
'description' => false,
194+
'meta_keywords' => false,
195+
'meta_description' => false,
196+
'custom_layout_update' => false,
197+
'custom_design_from' => false,
198+
'custom_design_to' => false,
199+
'filter_price_range' => false
200+
],
201+
],
151202
'custom values' => [
152203
[
153204
'id' => '2',
@@ -163,7 +214,7 @@ public function saveActionDataProvider()
163214
'url_key' => 'default-category',
164215
'display_mode' => 'PRODUCTS',
165216
'landing_page' => '1',
166-
'is_anchor' => '1',
217+
'is_anchor' => true,
167218
'custom_apply_to_products' => '0',
168219
'custom_design' => 'Magento/blank',
169220
'custom_design_from' => '5/21/2015',
@@ -232,7 +283,7 @@ public function saveActionDataProvider()
232283
'url_key' => 'default-category',
233284
'display_mode' => 'PRODUCTS',
234285
'landing_page' => '1',
235-
'is_anchor' => '1',
286+
'is_anchor' => true,
236287
'custom_apply_to_products' => '0',
237288
'custom_design' => 'Magento/blank',
238289
'custom_design_from' => '5/29/2015',

0 commit comments

Comments
 (0)