Skip to content

Commit

Permalink
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
Browse files Browse the repository at this point in the history
…nto MAGETWO-91070
  • Loading branch information
droed89 committed Nov 28, 2018
2 parents d7eafc2 + 653d533 commit 0bfccfc
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 15 deletions.
31 changes: 28 additions & 3 deletions app/code/Magento/CatalogImportExport/Model/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
*/
const COL_NAME = 'name';

/**
* Column new_from_date.
*/
const COL_NEW_FROM_DATE = 'new_from_date';

/**
* Column new_to_date.
*/
const COL_NEW_TO_DATE = 'new_to_date';

/**
* Column product website.
*/
Expand Down Expand Up @@ -292,7 +302,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
ValidatorInterface::ERROR_MEDIA_PATH_NOT_ACCESSIBLE => 'Imported resource (image) does not exist in the local media storage',
ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE => 'Imported resource (image) could not be downloaded from external resource due to timeout or access permissions',
ValidatorInterface::ERROR_INVALID_WEIGHT => 'Product weight is invalid',
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'
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',
ValidatorInterface::ERROR_NEW_TO_DATE => 'Make sure new_to_date is later than or the same as new_from_date',
];

/**
Expand All @@ -313,8 +324,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
Product::COL_TYPE => 'product_type',
Product::COL_PRODUCT_WEBSITES => 'product_websites',
'status' => 'product_online',
'news_from_date' => 'new_from_date',
'news_to_date' => 'new_to_date',
'news_from_date' => self::COL_NEW_FROM_DATE,
'news_to_date' => self::COL_NEW_TO_DATE,
'options_container' => 'display_product_options_in',
'minimal_price' => 'map_price',
'msrp' => 'msrp_price',
Expand Down Expand Up @@ -2477,6 +2488,20 @@ public function validateRow(array $rowData, $rowNum)
}
}
}

if (!empty($rowData[self::COL_NEW_FROM_DATE]) && !empty($rowData[self::COL_NEW_TO_DATE])
) {
$newFromTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_FROM_DATE], false));
$newToTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_TO_DATE], false));
if ($newFromTimestamp > $newToTimestamp) {
$this->addRowError(
ValidatorInterface::ERROR_NEW_TO_DATE,
$rowNum,
$rowData[self::COL_NEW_TO_DATE]
);
}
}

return !$this->getErrorAggregator()->isRowInvalid($rowNum);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ interface RowValidatorInterface extends \Magento\Framework\Validator\ValidatorIn

const ERROR_DUPLICATE_URL_KEY = 'duplicatedUrlKey';

const ERROR_NEW_TO_DATE = 'invalidNewToDateValue';

/**
* Value that means all entities (e.g. websites, groups etc.)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@
display: inline-block;
font-size: @notifications__font-size;
font-weight: @font-weight__bold;
height: 18px;
left: 50%;
margin-left: .3em;
margin-top: -1.1em;
min-width: 18px;
padding: .3em .5em;
position: absolute;
top: 50%;
Expand Down
5 changes: 5 additions & 0 deletions lib/internal/Magento/Framework/Filesystem/Driver/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public function isExists($path)

$status = $headers[0];

/* Handling 302 redirection */
if (strpos($status, '302 Found') !== false && isset($headers[1])) {
$status = $headers[1];
}

if (strpos($status, '200 OK') === false) {
$result = false;
} else {
Expand Down
15 changes: 3 additions & 12 deletions lib/web/mage/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,16 @@ define([

/**
* When the widget gets instantiated, the first tab that is not disabled receive focusable property
* Updated: for accessibility all tabs receive tabIndex 0
* All tabs receive tabIndex 0
* @private
*/
_processTabIndex: function () {
var self = this;

self.triggers.attr('tabIndex', 0);
$.each(this.collapsibles, function (i) {
if (!$(this).collapsible('option', 'disabled')) {
self.triggers.eq(i).attr('tabIndex', 0);

return false;
}
});
$.each(this.collapsibles, function (i) {
$(this).on('beforeOpen', function () {
self.triggers.attr('tabIndex', 0);
self.triggers.eq(i).attr('tabIndex', 0);
});
self.triggers.attr('tabIndex', 0);
self.triggers.eq(i).attr('tabIndex', 0);
});
},

Expand Down

0 comments on commit 0bfccfc

Please sign in to comment.