Skip to content

Commit ffc22e1

Browse files
author
Cari Spruiell
committed
Merge remote-tracking branch 'mainline/develop' into pull-request
2 parents 49328b9 + 4712b83 commit ffc22e1

File tree

42 files changed

+1764
-1827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1764
-1827
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ protected function _prepareIndex($entityIds = null, $attributeId = null)
103103
* @param array $entityIds the entity ids limitation
104104
* @param int $attributeId the attribute id limitation
105105
* @return $this
106+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
106107
*/
107108
protected function _prepareSelectIndex($entityIds = null, $attributeId = null)
108109
{
@@ -125,31 +126,37 @@ protected function _prepareSelectIndex($entityIds = null, $attributeId = null)
125126
['s' => $this->getTable('store')],
126127
['store_id', 'website_id']
127128
)->joinLeft(
128-
['d' => $this->getTable('catalog_product_entity_int')],
129-
'd.store_id = 0 OR d.store_id = s.store_id',
130-
['attribute_id', 'value']
129+
['dd' => $this->getTable('catalog_product_entity_int')],
130+
'dd.store_id = 0',
131+
['attribute_id']
131132
)->joinLeft(
132-
['d2' => $this->getTable('catalog_product_entity_int')],
133+
['ds' => $this->getTable('catalog_product_entity_int')],
134+
"ds.store_id = s.store_id AND ds.attribute_id = dd.attribute_id AND " .
135+
"ds.{$productIdField} = dd.{$productIdField}",
136+
['value' => new \Zend_Db_Expr('COALESCE(ds.value, dd.value)')]
137+
)->joinLeft(
138+
['d2d' => $this->getTable('catalog_product_entity_int')],
133139
sprintf(
134-
"d.{$productIdField} = d2.{$productIdField}"
135-
. ' AND d2.attribute_id = %s AND d2.value = %s AND d.store_id = d2.store_id',
136-
$this->_eavConfig->getAttribute(\Magento\Catalog\Model\Product::ENTITY, 'status')->getId(),
137-
ProductStatus::STATUS_ENABLED
140+
"d2d.store_id = 0 AND d2d.{$productIdField} = dd.{$productIdField} AND d2d.attribute_id = %s",
141+
$this->_eavConfig->getAttribute(\Magento\Catalog\Model\Product::ENTITY, 'status')->getId()
138142
),
139143
[]
144+
)->joinLeft(
145+
['d2s' => $this->getTable('catalog_product_entity_int')],
146+
"d2s.store_id = s.store_id AND d2s.attribute_id = d2d.attribute_id AND " .
147+
"d2s.{$productIdField} = d2d.{$productIdField}",
148+
[]
140149
)->joinLeft(
141150
['cpe' => $this->getTable('catalog_product_entity')],
142-
"cpe.{$productIdField} = d.{$productIdField}",
151+
"cpe.{$productIdField} = dd.{$productIdField}",
143152
array_unique([$productIdField, 'entity_id'])
144153
)->where(
145154
's.store_id != 0'
146155
)->where(
147-
'd.value IS NOT NULL'
156+
'(ds.value IS NOT NULL OR dd.value IS NOT NULL)'
148157
)->where(
149-
'd2.value IS NOT NULL'
150-
)->group([
151-
's.store_id', 's.website_id', 'cpe.entity_id', 'd.attribute_id', 'd.value',
152-
]);
158+
(new \Zend_Db_Expr('COALESCE(d2s.value, d2d.value)')) . ' = ' . ProductStatus::STATUS_ENABLED
159+
)->distinct(true);
153160

154161
if ($entityIds !== null) {
155162
$subSelect->where('cpe.entity_id IN(?)', $entityIds);

app/code/Magento/Catalog/etc/di.xml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,16 +715,63 @@
715715
</argument>
716716
</arguments>
717717
</type>
718+
<virtualType name="Magento\Catalog\EntityCreator\MetadataPool" type="Magento\Framework\EntityManager\MetadataPool">
719+
<arguments>
720+
<argument name="metadata" xsi:type="array">
721+
<item name="Magento\Catalog\Api\Data\ProductInterface" xsi:type="array">
722+
<item name="entityContext" xsi:type="array">
723+
<item name="store" xsi:type="string">Magento\Store\Model\DefaultStoreScopeProvider</item>
724+
</item>
725+
</item>
726+
<item name="Magento\Catalog\Api\Data\CategoryInterface" xsi:type="array">
727+
<item name="entityContext" xsi:type="array">
728+
<item name="store" xsi:type="string">Magento\Store\Model\DefaultStoreScopeProvider</item>
729+
</item>
730+
</item>
731+
<item name="Magento\Catalog\Api\Data\CategoryTreeInterface" xsi:type="array">
732+
<item name="entityContext" xsi:type="array">
733+
<item name="store" xsi:type="string">Magento\Store\Model\DefaultStoreScopeProvider</item>
734+
</item>
735+
</item>
736+
</argument>
737+
</arguments>
738+
</virtualType>
739+
<virtualType name="Magento\Catalog\Model\Entity\CreationScopeResolver" type="Magento\Framework\Model\Entity\ScopeResolver">
740+
<arguments>
741+
<argument name="metadataPool" xsi:type="object">Magento\Catalog\EntityCreator\MetadataPool</argument>
742+
</arguments>
743+
</virtualType>
718744
<virtualType name="Magento\Catalog\Model\ResourceModel\CreateHandler" type="Magento\Eav\Model\ResourceModel\CreateHandler">
719745
<arguments>
720-
<argument name="attributePersistor" xsi:type="object">Magento\Catalog\Model\ResourceModel\AttributePersistor</argument>
746+
<argument name="metadataPool" xsi:type="object">Magento\Catalog\EntityCreator\MetadataPool</argument>
747+
<argument name="scopeResolver" xsi:type="object">Magento\Catalog\Model\Entity\CreationScopeResolver</argument>
721748
</arguments>
722749
</virtualType>
723750
<virtualType name="Magento\Catalog\Model\ResourceModel\UpdateHandler" type="Magento\Eav\Model\ResourceModel\UpdateHandler">
724751
<arguments>
725752
<argument name="attributePersistor" xsi:type="object">Magento\Catalog\Model\ResourceModel\AttributePersistor</argument>
726753
</arguments>
727754
</virtualType>
755+
<type name="Magento\Framework\EntityManager\Operation\AttributePool">
756+
<arguments>
757+
<argument name="extensionActions" xsi:type="array">
758+
<item name="eav" xsi:type="array">
759+
<item name="Magento\Catalog\Api\Data\CategoryTreeInterface" xsi:type="array">
760+
<item name="create" xsi:type="string">Magento\Catalog\Model\ResourceModel\CreateHandler</item>
761+
<item name="update" xsi:type="string">Magento\Catalog\Model\ResourceModel\UpdateHandler</item>
762+
</item>
763+
<item name="Magento\Catalog\Api\Data\CategoryInterface" xsi:type="array">
764+
<item name="create" xsi:type="string">Magento\Catalog\Model\ResourceModel\CreateHandler</item>
765+
<item name="update" xsi:type="string">Magento\Catalog\Model\ResourceModel\UpdateHandler</item>
766+
</item>
767+
<item name="Magento\Catalog\Api\Data\ProductInterface" xsi:type="array">
768+
<item name="create" xsi:type="string">Magento\Catalog\Model\ResourceModel\CreateHandler</item>
769+
<item name="update" xsi:type="string">Magento\Catalog\Model\ResourceModel\UpdateHandler</item>
770+
</item>
771+
</item>
772+
</argument>
773+
</arguments>
774+
</type>
728775
<type name="Magento\Framework\EntityManager\HydratorPool">
729776
<arguments>
730777
<argument name="hydrators" xsi:type="array">

app/code/Magento/Sales/Block/Adminhtml/Order/View/Items/Renderer/DefaultRenderer.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,6 @@ public function getColumnHtml(\Magento\Framework\DataObject $item, $column, $fie
281281
case 'price-original':
282282
$html = $this->displayPriceAttribute('original_price');
283283
break;
284-
case 'price':
285-
$html = $this->displayPriceAttribute('price');
286-
break;
287284
case 'tax-amount':
288285
$html = $this->displayPriceAttribute('tax_amount');
289286
break;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Store\Model;
8+
9+
use Magento\Framework\Model\Entity\ScopeProviderInterface;
10+
use Magento\Store\Model\Store;
11+
use Magento\Framework\Model\Entity\ScopeFactory;
12+
13+
/**
14+
* Class StoreScope
15+
*/
16+
class DefaultStoreScopeProvider implements ScopeProviderInterface
17+
{
18+
19+
/**
20+
* @var ScopeFactory
21+
*/
22+
private $scopeFactory;
23+
24+
/**
25+
* StoreScopeProvider constructor.
26+
*
27+
* @param ScopeFactory $scopeFactory
28+
*/
29+
public function __construct(
30+
ScopeFactory $scopeFactory
31+
) {
32+
$this->scopeFactory = $scopeFactory;
33+
}
34+
35+
/**
36+
* @param string $entityType
37+
* @param array $entityData
38+
* @return \Magento\Framework\Model\Entity\ScopeInterface
39+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
40+
*/
41+
public function getContext($entityType, $entityData = [])
42+
{
43+
return $this->scopeFactory->create(Store::STORE_ID, Store::DEFAULT_STORE_ID, null);
44+
}
45+
}

app/code/Magento/Store/Model/StoreScopeProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function __construct(
4343
* @param string $entityType
4444
* @param array $entityData
4545
* @return \Magento\Framework\Model\Entity\ScopeInterface
46+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4647
*/
4748
public function getContext($entityType, $entityData = [])
4849
{
@@ -54,9 +55,6 @@ public function getContext($entityType, $entityData = [])
5455

5556
$identifier = Store::STORE_ID;
5657
$fallback = null;
57-
if ($value == 1) {
58-
$value = 0;
59-
}
6058
if ($value != Store::DEFAULT_STORE_ID) {
6159
$fallback = $this->scopeFactory->create($identifier, Store::DEFAULT_STORE_ID);
6260
}

app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<script id="translate-form-template" type="text/x-magento-template">
1818
<form id="<%- data.id %>">
1919
<% _.each(data.items, function(item, i) { %>
20-
<div class="magento_table_container">
20+
<div class="translate-table-container">
2121
<table class="table">
2222
<% _.each(item, function(value, index) { %>
2323
<tr>

app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<script id="translate-form-template" type="text/x-magento-template">
1919
<form id="<%- data.id %>">
2020
<% _.each(data.items, function(item, i) { %>
21-
<div class="magento_table_container">
21+
<div class="translate-table-container">
2222
<table cellspacing="0" class="table">
2323
<% _.each(item, function(value, index) { %>
2424
<tr>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// /**
2+
// * Copyright © 2016 Magento. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
// General rule hides group legend and shows first field label instead
7+
// in app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
8+
// This must be reset for Customer Address page
9+
.address-item-edit-content {
10+
.admin__field {
11+
legend {
12+
&.admin__field-label {
13+
opacity: 1;
14+
}
15+
}
16+
}
17+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// /**
2+
// * Copyright © 2016 Magento. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
//
7+
// Inline translations
8+
// _____________________________________________
9+
10+
//
11+
// Variables
12+
// ---------------------------------------------
13+
14+
@translate-inline-title__z-index: @menu__z-index + 1;
15+
16+
//
17+
// Form
18+
// ---------------------------------------------
19+
20+
.translate-table-container {
21+
table {
22+
width: 100%;
23+
}
24+
25+
td {
26+
background: none;
27+
padding: @indent__xs;
28+
text-align: left;
29+
30+
&.value {
31+
.input-text {
32+
width: 100%;
33+
}
34+
}
35+
}
36+
37+
th {
38+
&.label {
39+
border: none;
40+
font-weight: @font-weight__bold;
41+
padding: @indent__xs;
42+
text-align: left;
43+
width: 150px;
44+
}
45+
}
46+
}
47+
48+
//
49+
// Special tags
50+
// ---------------------------------------------
51+
52+
.translate-inline-title {
53+
display: block;
54+
left: 0;
55+
position: absolute;
56+
top: 0;
57+
z-index: @translate-inline-title__z-index;
58+
}
59+
60+
// Script tag that placed between menu and page wrapper
61+
.translate-inline-script {
62+
.menu-wrapper ~ & {
63+
display: block;
64+
left: @menu__width;
65+
position: absolute;
66+
top: 0;
67+
z-index: @translate-inline-title__z-index;
68+
}
69+
}

dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public function save()
117117
*/
118118
public function delete()
119119
{
120+
$this->waitBeforeClick();
120121
$this->_rootElement->find($this->deleteButton)->click();
121122
}
122123

@@ -139,6 +140,6 @@ public function checkDeleteButton()
139140
protected function waitBeforeClick()
140141
{
141142
time_nanosleep(0, 600000000);
142-
usleep(500000);
143+
usleep(1000000);
143144
}
144145
}

0 commit comments

Comments
 (0)