Skip to content

Commit 79b62b8

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-91019
2 parents a2764b0 + c59e602 commit 79b62b8

File tree

30 files changed

+170
-50
lines changed

30 files changed

+170
-50
lines changed

app/code/Magento/Catalog/Block/Product/ProductList/Crosssell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct
2525
*/
2626
protected function _prepareData()
2727
{
28-
$product = $this->_coreRegistry->registry('product');
28+
$product = $this->getProduct();
2929
/* @var $product \Magento\Catalog\Model\Product */
3030

3131
$this->_itemCollection = $product->getCrossSellProductCollection()->addAttributeToSelect(

app/code/Magento/Catalog/Block/Product/ProductList/Related.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function __construct(
8282
*/
8383
protected function _prepareData()
8484
{
85-
$product = $this->_coreRegistry->registry('product');
85+
$product = $this->getProduct();
8686
/* @var $product \Magento\Catalog\Model\Product */
8787

8888
$this->_itemCollection = $product->getRelatedProductCollection()->addAttributeToSelect(

app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function __construct(
9797
*/
9898
protected function _prepareData()
9999
{
100-
$product = $this->_coreRegistry->registry('product');
100+
$product = $this->getProduct();
101101
/* @var $product \Magento\Catalog\Model\Product */
102102
$this->_itemCollection = $product->getUpSellProductCollection()->setPositionOrder()->addStoreFilter();
103103
if ($this->moduleManager->isEnabled('Magento_Checkout')) {

app/code/Magento/Catalog/Controller/Product/Compare.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,12 @@ public function setCustomerId($customerId)
139139
$this->_customerId = $customerId;
140140
return $this;
141141
}
142+
143+
/**
144+
* @inheritdoc
145+
*/
146+
public function execute()
147+
{
148+
return $this->resultRedirectFactory->create()->setPath('catalog/product_compare');
149+
}
142150
}

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
</section>
1919
<section name="AdminModifyAttributesSection">
2020
<!-- Parameter is the attribute name -->
21-
<element name="dropDownAttributeByName" type="select" selector="//*[text()='{{attributeName}}']/../..//select" parameterized="true"/>
21+
<element name="dropDownAttributeByName" type="select" selector="//*[text()='{{attributeName}}']/../../..//select" parameterized="true"/>
2222
</section>
2323
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
<element name="useDefaultOptionTitle" type="text" selector="[data-index='options'] tr.data-row [data-index='title'] [name^='options_use_default']"/>
1515
<element name="useDefaultOptionValueTitleByIndex" type="text" selector="[data-index='options'] [data-index='values'] tr[data-repeat-index='{{var1}}'] [name^='options_use_default']" parameterized="true"/>
1616
<element name="addOptionBtn" type="button" selector="button[data-index='button_add']"/>
17-
<element name="fillOptionTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//label[text()='Option Title']/parent::span/parent::div//input[@class='admin__control-text']" parameterized="true"/>
18-
<element name="checkSelect" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//label[text()='Option Type']/parent::span/parent::div//div[@data-role='selected-option']" parameterized="true"/>
19-
<element name="checkDropDown" type="select" selector="//span[text()='{{var1}}']/ancestor::div[@class='fieldset-wrapper-title']/following-sibling::div[@data-role='collapsible-content']//div[@data-index='type']//div[contains(@class, 'action-menu')]//li[@class='admin__action-multiselect-menu-inner-item']//label[text()='Drop-down']" parameterized="true"/>
17+
<element name="fillOptionTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//span[text()='Option Title']/parent::label/parent::div/parent::div//input[@class='admin__control-text']" parameterized="true"/>
18+
<element name="checkSelect" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//span[text()='Option Type']/parent::label/parent::div/parent::div//div[@data-role='selected-option']" parameterized="true"/>
19+
<element name="checkDropDown" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//parent::label/parent::div/parent::div//li[@class='admin__action-multiselect-menu-inner-item']//label[text()='Drop-down']" parameterized="true"/>
2020
<element name="clickAddValue" type="button" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tfoot//button" parameterized="true"/>
21-
<element name="fillOptionValueTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody/tr[@data-repeat-index='{{var2}}']//label[text()='Title']/parent::span/parent::div//div[@class='admin__field-control']/input" parameterized="true"/>
21+
<element name="fillOptionValueTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody/tr[@data-repeat-index='{{var2}}']//span[text()='Title']/parent::label/parent::div/parent::div//div[@class='admin__field-control']/input" parameterized="true"/>
2222
<element name="fillOptionValuePrice" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody/tr[@data-repeat-index='{{var2}}']//span[text()='Price']/parent::label/parent::div//div[@class='admin__control-addon']/input" parameterized="true"/>
23-
<element name="clickSelectPriceType" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody//tr[@data-repeat-index='{{var2}}']//label[text()='Price Type']/parent::span/parent::div//select" parameterized="true"/>
23+
<element name="clickSelectPriceType" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody//tr[@data-repeat-index='{{var2}}']//span[text()='Price Type']/parent::label/parent::div/parent::div//select" parameterized="true"/>
2424
<!-- Elements that make it easier to select the most recently added element -->
2525
<element name="lastOptionTitle" type="input" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr[last()]//*[contains(@class, '_required')]//input" />
2626
<element name="lastOptionTypeParent" type="block" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr[last()]//*[contains(@class, 'admin__action-multiselect-text')]" />

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<element name="productName" type="input" selector=".admin__field[data-index=name] input"/>
1616
<element name="productNameUseDefault" type="checkbox" selector="input[name='use_default[name]']"/>
1717
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
18-
<element name="enableProductAttributeLabel" type="text" selector="[data-index='status'] .admin__field-label label"/>
19-
<element name="enableProductAttributeLabelWrapper" type="text" selector="[data-index='status'] .admin__field-label"/>
18+
<element name="enableProductAttributeLabel" type="text" selector="//span[text()='Enable Product']/parent::label"/>
19+
<element name="enableProductAttributeLabelWrapper" type="text" selector="//span[text()='Enable Product']/parent::label/parent::div"/>
2020
<element name="productStatus" type="checkbox" selector="input[name='product[status]']"/>
2121
<element name="productStatusUseDefault" type="checkbox" selector="input[name='use_default[status]']"/>
2222
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
@@ -33,7 +33,7 @@
3333
<element name="visibilityUseDefault" type="checkbox" selector="//input[@name='use_default[visibility]']"/>
3434
<element name="divByDataIndex" type="input" selector="div[data-index='{{var}}']" parameterized="true"/>
3535
<element name="attributeSetSearchCount" type="text" selector="div[data-index='attribute_set_id'] .admin__action-multiselect-search-count"/>
36-
<element name="attributeLabelByText" type="text" selector="//*[@class='admin__field']//label[text()='{{attributeLabel}}']" parameterized="true"/>
36+
<element name="attributeLabelByText" type="text" selector="//*[@class='admin__field']//span[text()='{{attributeLabel}}']" parameterized="true"/>
3737
<element name="addAttributeBtn" type="button" selector="#addAttribute"/>
3838
<element name="attributeSetFilterResultByName" type="text" selector="//label/span[text() = '{{var}}']" timeout="30" parameterized="true"/>
3939
<element name="attributeSetDropDown" type="select" selector="div[data-index='attribute_set_id'] .action-select.admin__action-multiselect"/>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ public function beforeSave()
287287
}
288288
}
289289

290+
if ($this->getFrontendInput() == 'media_image') {
291+
if (!$this->getFrontendModel()) {
292+
$this->setFrontendModel(\Magento\Catalog\Model\Product\Attribute\Frontend\Image::class);
293+
}
294+
}
295+
290296
if ($this->getBackendType() == 'gallery') {
291297
if (!$this->getBackendModel()) {
292298
$this->setBackendModel(\Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend::class);

app/code/Magento/Review/Model/Review.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Review\Model;
77

8+
use Magento\Framework\DataObject;
89
use Magento\Catalog\Model\Product;
910
use Magento\Framework\DataObject\IdentityInterface;
1011
use Magento\Review\Model\ResourceModel\Review\Product\Collection as ProductCollection;
@@ -327,6 +328,9 @@ public function appendSummary($collection)
327328
$item->setRatingSummary($summary);
328329
}
329330
}
331+
if (!$item->getRatingSummary()) {
332+
$item->setRatingSummary(new DataObject());
333+
}
330334
}
331335

332336
return $this;

app/code/Magento/Rule/Model/Condition/AbstractCondition.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,9 @@ public function getValueElement()
615615
// date format intentionally hard-coded
616616
$elementParams['input_format'] = \Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT;
617617
$elementParams['date_format'] = \Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT;
618+
$elementParams['placeholder'] = \Magento\Framework\Stdlib\DateTime::DATE_INTERNAL_FORMAT;
619+
$elementParams['autocomplete'] = 'off';
620+
$elementParams['readonly'] = 'true';
618621
}
619622
return $this->getForm()->addField(
620623
$this->getPrefix() . '__' . $this->getId() . '__value',

0 commit comments

Comments
 (0)