Skip to content

Commit 0bfccfc

Browse files
committed
Merge branch '2.2-develop' of https://github.com/magento/magento2ce into MAGETWO-91070
2 parents d7eafc2 + 653d533 commit 0bfccfc

File tree

5 files changed

+40
-15
lines changed

5 files changed

+40
-15
lines changed

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

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
129129
*/
130130
const COL_NAME = 'name';
131131

132+
/**
133+
* Column new_from_date.
134+
*/
135+
const COL_NEW_FROM_DATE = 'new_from_date';
136+
137+
/**
138+
* Column new_to_date.
139+
*/
140+
const COL_NEW_TO_DATE = 'new_to_date';
141+
132142
/**
133143
* Column product website.
134144
*/
@@ -292,7 +302,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
292302
ValidatorInterface::ERROR_MEDIA_PATH_NOT_ACCESSIBLE => 'Imported resource (image) does not exist in the local media storage',
293303
ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE => 'Imported resource (image) could not be downloaded from external resource due to timeout or access permissions',
294304
ValidatorInterface::ERROR_INVALID_WEIGHT => 'Product weight is invalid',
295-
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'
305+
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',
306+
ValidatorInterface::ERROR_NEW_TO_DATE => 'Make sure new_to_date is later than or the same as new_from_date',
296307
];
297308

298309
/**
@@ -313,8 +324,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
313324
Product::COL_TYPE => 'product_type',
314325
Product::COL_PRODUCT_WEBSITES => 'product_websites',
315326
'status' => 'product_online',
316-
'news_from_date' => 'new_from_date',
317-
'news_to_date' => 'new_to_date',
327+
'news_from_date' => self::COL_NEW_FROM_DATE,
328+
'news_to_date' => self::COL_NEW_TO_DATE,
318329
'options_container' => 'display_product_options_in',
319330
'minimal_price' => 'map_price',
320331
'msrp' => 'msrp_price',
@@ -2477,6 +2488,20 @@ public function validateRow(array $rowData, $rowNum)
24772488
}
24782489
}
24792490
}
2491+
2492+
if (!empty($rowData[self::COL_NEW_FROM_DATE]) && !empty($rowData[self::COL_NEW_TO_DATE])
2493+
) {
2494+
$newFromTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_FROM_DATE], false));
2495+
$newToTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_TO_DATE], false));
2496+
if ($newFromTimestamp > $newToTimestamp) {
2497+
$this->addRowError(
2498+
ValidatorInterface::ERROR_NEW_TO_DATE,
2499+
$rowNum,
2500+
$rowData[self::COL_NEW_TO_DATE]
2501+
);
2502+
}
2503+
}
2504+
24802505
return !$this->getErrorAggregator()->isRowInvalid($rowNum);
24812506
}
24822507

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

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

8686
const ERROR_DUPLICATE_URL_KEY = 'duplicatedUrlKey';
8787

88+
const ERROR_NEW_TO_DATE = 'invalidNewToDateValue';
89+
8890
/**
8991
* Value that means all entities (e.g. websites, groups etc.)
9092
*/

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_notifications.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@
9797
display: inline-block;
9898
font-size: @notifications__font-size;
9999
font-weight: @font-weight__bold;
100+
height: 18px;
100101
left: 50%;
101102
margin-left: .3em;
102103
margin-top: -1.1em;
104+
min-width: 18px;
103105
padding: .3em .5em;
104106
position: absolute;
105107
top: 50%;

lib/internal/Magento/Framework/Filesystem/Driver/Http.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ public function isExists($path)
3535

3636
$status = $headers[0];
3737

38+
/* Handling 302 redirection */
39+
if (strpos($status, '302 Found') !== false && isset($headers[1])) {
40+
$status = $headers[1];
41+
}
42+
3843
if (strpos($status, '200 OK') === false) {
3944
$result = false;
4045
} else {

lib/web/mage/tabs.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,25 +83,16 @@ define([
8383

8484
/**
8585
* When the widget gets instantiated, the first tab that is not disabled receive focusable property
86-
* Updated: for accessibility all tabs receive tabIndex 0
86+
* All tabs receive tabIndex 0
8787
* @private
8888
*/
8989
_processTabIndex: function () {
9090
var self = this;
9191

9292
self.triggers.attr('tabIndex', 0);
9393
$.each(this.collapsibles, function (i) {
94-
if (!$(this).collapsible('option', 'disabled')) {
95-
self.triggers.eq(i).attr('tabIndex', 0);
96-
97-
return false;
98-
}
99-
});
100-
$.each(this.collapsibles, function (i) {
101-
$(this).on('beforeOpen', function () {
102-
self.triggers.attr('tabIndex', 0);
103-
self.triggers.eq(i).attr('tabIndex', 0);
104-
});
94+
self.triggers.attr('tabIndex', 0);
95+
self.triggers.eq(i).attr('tabIndex', 0);
10596
});
10697
},
10798

0 commit comments

Comments
 (0)