Skip to content

Commit 909591d

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #19326: fix: remove old code in tabs, always set tabindex to 0 when tabs are � (by @DanielRuf) - #19309: Removed $this->setShowGlobalIcon(); (by @sreichel) - #19299: Fix styling issue for order items table (by @dmytro-ch) - #18609: Binding to event collapsible scroll (by @danielgheoltan) - #19277: Remove cart edit link extra space (by @VincentMarmiesse) - #18888: Fixed rating issue website wise (by @saphaljha) - #19213: Fix dependency between Elasticsearch configuration fields (by @ajardin) - #19195: [Newsletter] Fixing the customer subscribing from different stores (by @eduard13) - #19183: [Captcha] Integration tests for wrong captcha (by @eduard13) - #19180: [Forwardport] Fix/add expresion (by @torhoehn) - magento-engcom/import-export-improvements#152: Removed method annotation without argument from PHPDoc (by @VoronoyAlexandr) - #19024: Add-validation-new-from-date-less-than-new-to-date-in-SCV-product-import (by @agorbulin) - #19053: Magento backend Notifications counter round icon small cut from right side (by @abrarpathan19) - #19039: #13157 - Last Ordered Items block - bad js code (by @omiroshnichenko) - #18703: Changed get product way in blocks with related products (by @henryktews) - magento-engcom/import-export-improvements#148: Clean Up Magento/ImportExport/Controller/Adminhtml/History/Download (by @denispapec) - #18641: Set cache id prefix on installation (by @schmengler) Fixed GitHub Issues: - #18192: Backend issue : "ratings isn't available" website wise (reported by @hardik-krish) has been fixed in #18888 by @saphaljha in 2.3-develop branch Related commits: 1. 1c820be 2. 8ea303b 3. cd24396 4. cbbaf12 5. 611969d 6. 774164c 7. 2ea37a8 8. 0e59e8c 9. b9790c6 - #19172: Newsletter subscription does not set the correct store_id if already subscribed. Not Fixed in 2.3-dev (reported by @bbmxxc) has been fixed in #19195 by @eduard13 in 2.3-develop branch Related commits: 1. c9b5250 2. 3b84172 - #17635: addExpressionFieldToSelect has to be called after all addFieldToSelect (reported by @dbsdsun) has been fixed in #19180 by @torhoehn in 2.3-develop branch Related commits: 1. e697698 2. 3050d23 3. 99ea195 - #18887: Magento backend Notifications counter round icon small cut from right side (reported by @abrarpathan19) has been fixed in #19053 by @abrarpathan19 in 2.3-develop branch Related commits: 1. 4a945f2 2. 9e9c74c - #13157: Last Ordered Items block - bad js code (reported by @Eytham) has been fixed in #19039 by @omiroshnichenko in 2.3-develop branch Related commits: 1. c333367 2. 4803537 3. 7c9de8e 4. eaaed4b - #15828: Multisite installation, default website slow (X-Magento-Vary) (reported by @Flowlance) has been fixed in #18641 by @schmengler in 2.3-develop branch Related commits: 1. 12b7e08 2. 6a68a18 3. 3ccd55e 4. f14949c
2 parents 365e400 + 492e264 commit 909591d

File tree

28 files changed

+536
-79
lines changed

28 files changed

+536
-79
lines changed

app/code/Magento/Backend/Block/Widget/Form.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ protected function _construct()
5959
parent::_construct();
6060

6161
$this->setDestElementId('edit_form');
62-
$this->setShowGlobalIcon(false);
6362
}
6463

6564
/**

app/code/Magento/Backend/Block/Widget/Grid.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @api
1313
* @deprecated 100.2.0 in favour of UI component implementation
1414
* @method string getRowClickCallback() getRowClickCallback()
15-
* @method \Magento\Backend\Block\Widget\Grid setRowClickCallback() setRowClickCallback(string $value)
15+
* @method \Magento\Backend\Block\Widget\Grid setRowClickCallback(string $value)
1616
* @SuppressWarnings(PHPMD.TooManyFields)
1717
* @since 100.0.2
1818
*/
@@ -150,7 +150,10 @@ public function __construct(
150150
}
151151

152152
/**
153+
* Internal constructor, that is called from real constructor
154+
*
153155
* @return void
156+
*
154157
* @SuppressWarnings(PHPMD.NPathComplexity)
155158
*/
156159
protected function _construct()
@@ -709,6 +712,7 @@ public function getGridUrl()
709712

710713
/**
711714
* Grid url getter
715+
*
712716
* Version of getGridUrl() but with parameters
713717
*
714718
* @param array $params url parameters

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ public function __construct(
6464
parent::__construct($context, $registry, $formFactory, $data);
6565
}
6666

67-
/**
68-
* Construct block
69-
*
70-
* @return void
71-
*/
72-
protected function _construct()
73-
{
74-
parent::_construct();
75-
$this->setShowGlobalIcon(true);
76-
}
77-
7867
/**
7968
* Prepares form
8069
*

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010
namespace Magento\Catalog\Block\Product\ProductList;
1111

12+
/**
13+
* Crosssell block for product
14+
*/
1215
class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct
1316
{
1417
/**
@@ -25,7 +28,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct
2528
*/
2629
protected function _prepareData()
2730
{
28-
$product = $this->_coreRegistry->registry('product');
31+
$product = $this->getProduct();
2932
/* @var $product \Magento\Catalog\Model\Product */
3033

3134
$this->_itemCollection = $product->getCrossSellProductCollection()->addAttributeToSelect(
@@ -43,6 +46,7 @@ protected function _prepareData()
4346

4447
/**
4548
* Before rendering html process
49+
*
4650
* Prepare items collection
4751
*
4852
* @return \Magento\Catalog\Block\Product\ProductList\Crosssell

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ public function __construct(
7777
}
7878

7979
/**
80+
* Prepare data
81+
*
8082
* @return $this
8183
*/
8284
protected function _prepareData()
8385
{
84-
$product = $this->_coreRegistry->registry('product');
86+
$product = $this->getProduct();
8587
/* @var $product \Magento\Catalog\Model\Product */
8688

8789
$this->_itemCollection = $product->getRelatedProductCollection()->addAttributeToSelect(
@@ -103,6 +105,8 @@ protected function _prepareData()
103105
}
104106

105107
/**
108+
* Before to html handler
109+
*
106110
* @return $this
107111
*/
108112
protected function _beforeToHtml()
@@ -112,6 +116,8 @@ protected function _beforeToHtml()
112116
}
113117

114118
/**
119+
* Get collection items
120+
*
115121
* @return Collection
116122
*/
117123
public function getItems()

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ public function __construct(
9191
}
9292

9393
/**
94+
* Prepare data
95+
*
9496
* @return $this
9597
*/
9698
protected function _prepareData()
9799
{
98-
$product = $this->_coreRegistry->registry('product');
100+
$product = $this->getProduct();
99101
/* @var $product \Magento\Catalog\Model\Product */
100102
$this->_itemCollection = $product->getUpSellProductCollection()->setPositionOrder()->addStoreFilter();
101103
if ($this->moduleManager->isEnabled('Magento_Checkout')) {
@@ -121,6 +123,8 @@ protected function _prepareData()
121123
}
122124

123125
/**
126+
* Before to html handler
127+
*
124128
* @return $this
125129
*/
126130
protected function _beforeToHtml()
@@ -130,6 +134,8 @@ protected function _beforeToHtml()
130134
}
131135

132136
/**
137+
* Get items collection
138+
*
133139
* @return Collection
134140
*/
135141
public function getItemCollection()
@@ -145,6 +151,8 @@ public function getItemCollection()
145151
}
146152

147153
/**
154+
* Get collection items
155+
*
148156
* @return \Magento\Framework\DataObject[]
149157
*/
150158
public function getItems()
@@ -156,6 +164,8 @@ public function getItems()
156164
}
157165

158166
/**
167+
* Get row count
168+
*
159169
* @return float
160170
*/
161171
public function getRowCount()
@@ -164,6 +174,8 @@ public function getRowCount()
164174
}
165175

166176
/**
177+
* Set column count
178+
*
167179
* @param string $columns
168180
* @return $this
169181
*/
@@ -176,6 +188,8 @@ public function setColumnCount($columns)
176188
}
177189

178190
/**
191+
* Get column count
192+
*
179193
* @return int
180194
*/
181195
public function getColumnCount()
@@ -184,6 +198,8 @@ public function getColumnCount()
184198
}
185199

186200
/**
201+
* Reset items iterator
202+
*
187203
* @return void
188204
*/
189205
public function resetItemsIterator()
@@ -193,6 +209,8 @@ public function resetItemsIterator()
193209
}
194210

195211
/**
212+
* Get iterable item
213+
*
196214
* @return mixed
197215
*/
198216
public function getIterableItem()
@@ -204,6 +222,7 @@ public function getIterableItem()
204222

205223
/**
206224
* Set how many items we need to show in upsell block
225+
*
207226
* Notice: this parameter will be also applied
208227
*
209228
* @param string $type
@@ -219,6 +238,8 @@ public function setItemLimit($type, $limit)
219238
}
220239

221240
/**
241+
* Get item limit
242+
*
222243
* @param string $type
223244
* @return array|int
224245
*/

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,16 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
132132
*/
133133
const COL_NAME = 'name';
134134

135+
/**
136+
* Column new_from_date.
137+
*/
138+
const COL_NEW_FROM_DATE = 'new_from_date';
139+
140+
/**
141+
* Column new_to_date.
142+
*/
143+
const COL_NEW_TO_DATE = 'new_to_date';
144+
135145
/**
136146
* Column product website.
137147
*/
@@ -298,6 +308,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
298308
ValidatorInterface::ERROR_INVALID_WEIGHT => 'Product weight is invalid',
299309
ValidatorInterface::ERROR_DUPLICATE_URL_KEY => 'Url key: \'%s\' was already generated for an item with the SKU: \'%s\'. You need to specify the unique URL key manually',
300310
ValidatorInterface::ERROR_DUPLICATE_MULTISELECT_VALUES => "Value for multiselect attribute %s contains duplicated values",
311+
ValidatorInterface::ERROR_NEW_TO_DATE => 'Make sure new_to_date is later than or the same as new_from_date',
301312
];
302313
//@codingStandardsIgnoreEnd
303314

@@ -319,8 +330,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
319330
Product::COL_TYPE => 'product_type',
320331
Product::COL_PRODUCT_WEBSITES => 'product_websites',
321332
'status' => 'product_online',
322-
'news_from_date' => 'new_from_date',
323-
'news_to_date' => 'new_to_date',
333+
'news_from_date' => self::COL_NEW_FROM_DATE,
334+
'news_to_date' => self::COL_NEW_TO_DATE,
324335
'options_container' => 'display_product_options_in',
325336
'minimal_price' => 'map_price',
326337
'msrp' => 'msrp_price',
@@ -2549,6 +2560,20 @@ public function validateRow(array $rowData, $rowNum)
25492560
}
25502561
}
25512562
}
2563+
2564+
if (!empty($rowData[self::COL_NEW_FROM_DATE]) && !empty($rowData[self::COL_NEW_TO_DATE])
2565+
) {
2566+
$newFromTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_FROM_DATE], false));
2567+
$newToTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_TO_DATE], false));
2568+
if ($newFromTimestamp > $newToTimestamp) {
2569+
$this->addRowError(
2570+
ValidatorInterface::ERROR_NEW_TO_DATE,
2571+
$rowNum,
2572+
$rowData[self::COL_NEW_TO_DATE]
2573+
);
2574+
}
2575+
}
2576+
25522577
return !$this->getErrorAggregator()->isRowInvalid($rowNum);
25532578
}
25542579

app/code/Magento/CatalogImportExport/Model/Import/Product/RowValidatorInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ interface RowValidatorInterface extends \Magento\Framework\Validator\ValidatorIn
8787

8888
const ERROR_DUPLICATE_MULTISELECT_VALUES = 'duplicatedMultiselectValues';
8989

90+
const ERROR_NEW_TO_DATE = 'invalidNewToDateValue';
91+
9092
/**
9193
* Value that means all entities (e.g. websites, groups etc.)
9294
*/

app/code/Magento/Checkout/view/frontend/templates/cart/item/renderer/actions/edit.phtml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
<a class="action action-edit"
1313
href="<?= /* @escapeNotVerified */ $block->getConfigureUrl() ?>"
1414
title="<?= $block->escapeHtml(__('Edit item parameters')) ?>">
15-
<span>
16-
<?= /* @escapeNotVerified */ __('Edit') ?>
17-
</span>
18-
</a>
15+
<span><?= /* @escapeNotVerified */ __('Edit') ?></span>
16+
</a>
1917
<?php endif ?>

app/code/Magento/Elasticsearch/etc/adminhtml/system.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@
9292
<field id="elasticsearch5_username" translate="label" type="text" sortOrder="65" showInDefault="1" showInWebsite="0" showInStore="0">
9393
<label>Elasticsearch HTTP Username</label>
9494
<depends>
95-
<field id="elasticsearch_enable_auth">1</field>
9695
<field id="engine">elasticsearch5</field>
96+
<field id="elasticsearch5_enable_auth">1</field>
9797
</depends>
9898
</field>
9999
<field id="elasticsearch5_password" translate="label" type="text" sortOrder="66" showInDefault="1" showInWebsite="0" showInStore="0">
100100
<label>Elasticsearch HTTP Password</label>
101101
<depends>
102-
<field id="elasticsearch_enable_auth">1</field>
103102
<field id="engine">elasticsearch5</field>
103+
<field id="elasticsearch5_enable_auth">1</field>
104104
</depends>
105105
</field>
106106
<field id="elasticsearch5_server_timeout" translate="label" type="text" sortOrder="67" showInDefault="1" showInWebsite="0" showInStore="0">

app/code/Magento/ImportExport/Controller/Adminhtml/History/Download.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\ImportExport\Controller\Adminhtml\History;
87

8+
use Magento\Framework\App\Action\HttpGetActionInterface;
99
use Magento\Framework\App\Filesystem\DirectoryList;
1010

11-
class Download extends \Magento\ImportExport\Controller\Adminhtml\History
11+
/**
12+
* Download history controller
13+
*/
14+
class Download extends \Magento\ImportExport\Controller\Adminhtml\History implements HttpGetActionInterface
1215
{
1316
/**
1417
* @var \Magento\Framework\Controller\Result\RawFactory
1518
*/
1619
protected $resultRawFactory;
1720

21+
/**
22+
* @var \Magento\Framework\App\Response\Http\FileFactory
23+
*/
24+
private $fileFactory;
25+
1826
/**
1927
* @param \Magento\Backend\App\Action\Context $context
2028
* @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory

0 commit comments

Comments
 (0)