Skip to content

Commit eeb0784

Browse files
author
Dmytro Voskoboinikov
committed
Merge branch '2.2-develop' into 2.2.6-develop
2 parents 78dc76e + 075de96 commit eeb0784

File tree

27 files changed

+172
-28
lines changed

27 files changed

+172
-28
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public function initializeFromData(\Magento\Catalog\Model\Product $product, arra
159159
}
160160

161161
$productData = $this->normalize($productData);
162+
$productData = $this->convertSpecialFromDateStringToObject($productData);
162163

163164
if (!empty($productData['is_downloadable'])) {
164165
$productData['product_has_weight'] = 0;
@@ -452,4 +453,19 @@ private function fillProductOptions(Product $product, array $productOptions)
452453

453454
return $product->setOptions($customOptions);
454455
}
456+
457+
/**
458+
* Convert string date presentation into object
459+
*
460+
* @param array $productData
461+
* @return array
462+
*/
463+
private function convertSpecialFromDateStringToObject($productData)
464+
{
465+
if (isset($productData['special_from_date']) && $productData['special_from_date'] != '') {
466+
$productData['special_from_date'] = new \DateTime($productData['special_from_date']);
467+
}
468+
469+
return $productData;
470+
}
455471
}

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,12 @@ public function testInitialize(
198198
'option2' => ['is_delete' => false, 'name' => 'name1', 'price' => 'price1', 'option_id' => '13'],
199199
'option3' => ['is_delete' => false, 'name' => 'name1', 'price' => 'price1', 'option_id' => '14']
200200
];
201+
$specialFromDate = '2018-03-03 19:30:00';
201202
$productData = [
202203
'stock_data' => ['stock_data'],
203204
'options' => $optionsData,
204-
'website_ids' => $websiteIds
205+
'website_ids' => $websiteIds,
206+
'special_from_date' => $specialFromDate,
205207
];
206208
if (!empty($tierPrice)) {
207209
$productData = array_merge($productData, ['tier_price' => $tierPrice]);
@@ -306,6 +308,7 @@ public function testInitialize(
306308
}
307309

308310
$this->assertEquals($expectedLinks, $resultLinks);
311+
$this->assertEquals($specialFromDate, $productData['special_from_date']);
309312
}
310313

311314
/**

app/code/Magento/Customer/view/frontend/templates/form/confirmation.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="field email required">
1515
<label for="email_address" class="label"><span><?= $block->escapeHtml(__('Email')) ?></span></label>
1616
<div class="control">
17-
<input type="email" name="email" id="email_address" class="input-text" value="<?= $block->escapeHtmlAttr($block->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}">
17+
<input type="email" name="email" id="email_address" class="input-text" value="<?= $block->escapeHtmlAttr($block->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}" data-mage-init='{"mage/trim-input":{}}'>
1818
</div>
1919
</div>
2020
</fieldset>

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ define([
2727

2828
//TODO: remove global change, in this case made for initNamespaceStorage
2929
$.cookieStorage.setConf({
30-
path: '/'
30+
path: '/',
31+
expires: 1
3132
});
3233

3334
storage = $.initNamespaceStorage('mage-cache-storage').localStorage;

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Framework\Api\AttributeValueFactory;
99
use Magento\Framework\Exception\LocalizedException;
10+
use Magento\Framework\Stdlib\DateTime;
1011
use Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface;
1112

1213
/**
@@ -276,12 +277,10 @@ public function beforeSave()
276277

277278
// save default date value as timestamp
278279
if ($hasDefaultValue) {
279-
$format = $this->_localeDate->getDateFormat(
280-
\IntlDateFormatter::SHORT
281-
);
282280
try {
283-
$defaultValue = $this->dateTimeFormatter->formatObject(new \DateTime($defaultValue), $format);
284-
$this->setDefaultValue($defaultValue);
281+
$locale = $this->_localeResolver->getLocale();
282+
$defaultValue = $this->_localeDate->date($defaultValue, $locale, false, false);
283+
$this->setDefaultValue($defaultValue->format(DateTime::DATETIME_PHP_FORMAT));
285284
} catch (\Exception $e) {
286285
throw new LocalizedException(__('Invalid default date'));
287286
}

app/code/Magento/Shipping/Model/Carrier/AbstractCarrierInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function checkAvailableShipCountries(\Magento\Framework\DataObject $reque
9090
* @return $this|\Magento\Framework\DataObject|boolean
9191
* @api
9292
*/
93-
public function processAdditionalValidation(\Magento\Framework\DataObject $request);
93+
public function proccessAdditionalValidation(\Magento\Framework\DataObject $request);
9494

9595
/**
9696
* Determine whether current carrier enabled for activity

app/code/Magento/TaxImportExport/Model/Rate/CsvImportHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ protected function _importRate(array $rateData, array $regionsCache, array $stor
237237
$countryCode = $rateData[1];
238238
$country = $this->_countryFactory->create()->loadByCode($countryCode, 'iso2_code');
239239
if (!$country->getId()) {
240-
throw new \Magento\Framework\Exception\LocalizedException(__('One of the countries has invalid code.'));
240+
throw new \Magento\Framework\Exception\LocalizedException(__('Country code is invalid: %1', $countryCode));
241241
}
242242
$regionsCache = $this->_addCountryRegionsToCache($countryCode, $regionsCache);
243243

app/code/Magento/TaxImportExport/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Rate,Rate
1212
"Invalid file upload attempt","Invalid file upload attempt"
1313
"Invalid file upload attempt.","Invalid file upload attempt."
1414
"Invalid file format.","Invalid file format."
15-
"One of the countries has invalid code.","One of the countries has invalid code."
15+
"Country code is invalid: %1","Country code is invalid: %1"
1616
"Import Tax Rates","Import Tax Rates"
1717
"Export Tax Rates","Export Tax Rates"
1818
CSV,CSV

app/code/Magento/Ui/view/base/web/templates/form/components/collection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<legend class="admin__legend">
3131
<span text="$parent.label"/>
3232
</legend><br />
33-
33+
3434
<each args="getRegion('body')" render=""/>
3535
</fieldset>
3636
</div>

app/code/Magento/Ui/view/base/web/templates/form/element/checkbox-set.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
<div class="admin__field-control"
1717
css="'_with-tooltip': $data.tooltip">
1818
<div class="admin__field admin__field-option" outereach="options">
19-
<input
19+
<input
2020
ko-checked="$parent.value"
2121
ko-disabled="$parent.disabled"
2222
css="
2323
'admin__control-radio': !$parent.multiple,
2424
'admin__control-checkbox': $parent.multiple"
2525
attr="
26-
id: ++ko.uid,
26+
id: ++ko.uid,
2727
value: value,
2828
type: $parent.multiple ? 'checkbox' : 'radio'"/>
2929

0 commit comments

Comments
 (0)