diff --git a/app/code/Magento/GiftMessage/view/frontend/web/js/view/gift-message.js b/app/code/Magento/GiftMessage/view/frontend/web/js/view/gift-message.js
index d025f6974f35e..4c455c83a77a9 100644
--- a/app/code/Magento/GiftMessage/view/frontend/web/js/view/gift-message.js
+++ b/app/code/Magento/GiftMessage/view/frontend/web/js/view/gift-message.js
@@ -31,8 +31,9 @@ define([
this.itemId = this.itemId || 'orderLevel';
model = new GiftMessage(this.itemId);
- giftOptions.addOption(model);
this.model = model;
+ this.isResultBlockVisible();
+ giftOptions.addOption(model);
this.model.getObservable('isClear').subscribe(function (value) {
if (value == true) { //eslint-disable-line eqeqeq
@@ -40,8 +41,6 @@ define([
self.model.getObservable('alreadyAdded')(true);
}
});
-
- this.isResultBlockVisible();
},
/**
diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls
index ce2166808b4de..2281495d059e1 100644
--- a/app/code/Magento/GraphQl/etc/schema.graphqls
+++ b/app/code/Magento/GraphQl/etc/schema.graphqls
@@ -36,3 +36,7 @@ enum SortEnum @doc(description: "This enumeration indicates whether to return re
ASC
DESC
}
+
+type ComplexTextValue {
+ html: String! @doc(description: "HTML format")
+}
diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php
index 80824d45cb6e5..673450838fb94 100644
--- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php
+++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php
@@ -236,7 +236,7 @@ public function getAssociatedProducts($product)
*/
public function flushAssociatedProductsCache($product)
{
- return $product->unsData($this->_keyAssociatedProducts);
+ return $product->unsetData($this->_keyAssociatedProducts);
}
/**
diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Model/Product/Type/GroupedTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Model/Product/Type/GroupedTest.php
index 06c07a8dc34a8..e50d6491a6aca 100644
--- a/app/code/Magento/GroupedProduct/Test/Unit/Model/Product/Type/GroupedTest.php
+++ b/app/code/Magento/GroupedProduct/Test/Unit/Model/Product/Type/GroupedTest.php
@@ -611,9 +611,9 @@ public function testPrepareForCartAdvancedZeroQty()
public function testFlushAssociatedProductsCache()
{
- $productMock = $this->createPartialMock(\Magento\Catalog\Model\Product::class, ['unsData']);
+ $productMock = $this->createPartialMock(\Magento\Catalog\Model\Product::class, ['unsetData']);
$productMock->expects($this->once())
- ->method('unsData')
+ ->method('unsetData')
->with('_cache_instance_associated_products')
->willReturnSelf();
$this->assertEquals($productMock, $this->_model->flushAssociatedProductsCache($productMock));
diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php
index dc928b4c7942d..4f4ed9de03e43 100644
--- a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php
+++ b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php
@@ -250,7 +250,7 @@ protected function _getSelectHtmlWithValue(Attribute $attribute, $value)
if ('' === $firstOption['value']) {
$options[key($options)]['label'] = '';
} else {
- array_unshift($options, ['value' => '', 'label' => '']);
+ array_unshift($options, ['value' => '', 'label' => __('-- Not Selected --')]);
}
$arguments = [
'name' => $this->getFilterElementName($attribute->getAttributeCode()),
diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Import/Start.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Import/Start.php
index 8f64d023c19f9..e850f6af86cf9 100644
--- a/app/code/Magento/ImportExport/Controller/Adminhtml/Import/Start.php
+++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Import/Start.php
@@ -93,6 +93,20 @@ public function execute()
$this->addErrorMessages($resultBlock, $errorAggregator);
} else {
$this->importModel->invalidateIndex();
+
+ $noticeHtml = $this->historyModel->getSummary();
+
+ if ($this->historyModel->getErrorFile()) {
+ $noticeHtml .= '
';
+ }
+
+ $resultBlock->addNotice(
+ $noticeHtml
+ );
+
$this->addErrorMessages($resultBlock, $errorAggregator);
$resultBlock->addSuccess(__('Import successfully done'));
}
diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php
index b5e8220e0e9b0..064c696ad0a84 100644
--- a/app/code/Magento/ImportExport/Model/Import.php
+++ b/app/code/Magento/ImportExport/Model/Import.php
@@ -181,7 +181,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel
* @param Source\Import\Behavior\Factory $behaviorFactory
* @param \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry
* @param History $importHistoryModel
- * @param \Magento\Framework\Stdlib\DateTime\DateTime
+ * @param \Magento\Framework\Stdlib\DateTime\DateTime $localeDate
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
@@ -443,6 +443,8 @@ public function importSource()
}
/**
+ * Processing of import.
+ *
* @return bool
* @throws \Magento\Framework\Exception\LocalizedException
*/
@@ -462,6 +464,8 @@ public function isImportAllowed()
}
/**
+ * Get error aggregator instance.
+ *
* @return ProcessingErrorAggregatorInterface
* @throws \Magento\Framework\Exception\LocalizedException
*/
@@ -585,6 +589,11 @@ public function validateSource(\Magento\ImportExport\Model\Import\AbstractSource
$this->addLogComment($messages);
$result = !$errorAggregator->getErrorsCount();
+ $validationStrategy = $this->getData(self::FIELD_NAME_VALIDATION_STRATEGY);
+ if ($validationStrategy === ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_SKIP_ERRORS) {
+ $result = true;
+ }
+
if ($result) {
$this->addLogComment(__('Import data validation is complete.'));
}
@@ -710,9 +719,9 @@ public function isReportEntityType($entity = null)
/**
* Create history report
*
+ * @param string $sourceFileRelative
* @param string $entity
* @param string $extension
- * @param string $sourceFileRelative
* @param array $result
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php
index e965e8ad207fd..1fc3257ff2c1e 100644
--- a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php
+++ b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php
@@ -554,7 +554,9 @@ public function getBehavior()
$this->_parameters['behavior']
) ||
$this->_parameters['behavior'] != ImportExport::BEHAVIOR_APPEND &&
+ $this->_parameters['behavior'] != ImportExport::BEHAVIOR_ADD_UPDATE &&
$this->_parameters['behavior'] != ImportExport::BEHAVIOR_REPLACE &&
+ $this->_parameters['behavior'] != ImportExport::BEHAVIOR_CUSTOM &&
$this->_parameters['behavior'] != ImportExport::BEHAVIOR_DELETE
) {
return ImportExport::getDefaultBehavior();
@@ -828,6 +830,8 @@ public function validateData()
}
/**
+ * Get error aggregator object
+ *
* @return ProcessingErrorAggregatorInterface
*/
public function getErrorAggregator()
diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Source/Import/Behavior/CustomTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Source/Import/Behavior/CustomTest.php
index d073f3866bfe6..73b4f10b3b0f0 100644
--- a/app/code/Magento/ImportExport/Test/Unit/Model/Source/Import/Behavior/CustomTest.php
+++ b/app/code/Magento/ImportExport/Test/Unit/Model/Source/Import/Behavior/CustomTest.php
@@ -32,7 +32,7 @@ class CustomTest extends \Magento\ImportExport\Test\Unit\Model\Source\Import\Abs
protected function setUp()
{
parent::setUp();
- $this->_model = new \Magento\ImportExport\Model\Source\Import\Behavior\Custom([]);
+ $this->_model = new \Magento\ImportExport\Model\Source\Import\Behavior\Custom();
}
/**
diff --git a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php
index 6eab92f65117a..fffa4503e14a7 100644
--- a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php
+++ b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php
@@ -58,7 +58,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
protected function configure()
{
@@ -70,7 +70,7 @@ protected function configure()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
@@ -105,7 +105,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
/**
- * {@inheritdoc} Returns the ordered list of specified indexers and related indexers.
+ * @inheritdoc
+ *
+ * Returns the ordered list of specified indexers and related indexers.
*/
protected function getIndexers(InputInterface $input)
{
@@ -187,7 +189,7 @@ private function getDependentIndexerIds(string $indexerId)
$this->getDependentIndexerIds($id)
);
}
- };
+ }
return array_unique($dependentIndexerIds);
}
@@ -272,6 +274,8 @@ private function getConfig()
}
/**
+ * Get indexer registry
+ *
* @return IndexerRegistry
* @deprecated 100.2.0
*/
@@ -284,6 +288,8 @@ private function getIndexerRegistry()
}
/**
+ * Get dependency info provider
+ *
* @return DependencyInfoProvider
* @deprecated 100.2.0
*/
diff --git a/app/code/Magento/Indexer/Model/DimensionModes.php b/app/code/Magento/Indexer/Model/DimensionModes.php
index bbdee0ced8662..a9507a6f4d358 100644
--- a/app/code/Magento/Indexer/Model/DimensionModes.php
+++ b/app/code/Magento/Indexer/Model/DimensionModes.php
@@ -26,7 +26,7 @@ public function __construct(array $dimensions)
$result = [];
foreach ($dimensions as $dimension) {
$result[$dimension->getName()] = $dimension;
- };
+ }
return $result;
})(...$dimensions);
}
diff --git a/app/code/Magento/Integration/Plugin/Model/AdminUser.php b/app/code/Magento/Integration/Plugin/Model/AdminUser.php
index df3766250caa7..7b2fa1981bce3 100644
--- a/app/code/Magento/Integration/Plugin/Model/AdminUser.php
+++ b/app/code/Magento/Integration/Plugin/Model/AdminUser.php
@@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+
namespace Magento\Integration\Plugin\Model;
use Magento\Integration\Model\AdminTokenService;
@@ -31,14 +32,15 @@ public function __construct(
*
* @param \Magento\User\Model\User $subject
* @param \Magento\Framework\DataObject $object
- * @return $this
+ * @return \Magento\User\Model\User
+ * @throws \Magento\Framework\Exception\LocalizedException
*/
public function afterSave(
\Magento\User\Model\User $subject,
\Magento\Framework\DataObject $object
- ) {
+ ): \Magento\User\Model\User {
$isActive = $object->getIsActive();
- if (isset($isActive) && $isActive == 0) {
+ if ($isActive !== null && $isActive == 0) {
$this->adminTokenService->revokeAdminAccessToken($object->getId());
}
return $subject;
diff --git a/app/code/Magento/Integration/etc/adminhtml/system.xml b/app/code/Magento/Integration/etc/adminhtml/system.xml
index 5abec8efbfdd6..fe80fe105493a 100644
--- a/app/code/Magento/Integration/etc/adminhtml/system.xml
+++ b/app/code/Magento/Integration/etc/adminhtml/system.xml
@@ -54,7 +54,7 @@
Maximum Number of authentication failures to lock out account.
-
+
Period of time in seconds after which account will be unlocked.
diff --git a/app/code/Magento/Integration/etc/db_schema.xml b/app/code/Magento/Integration/etc/db_schema.xml
index 79fbf0b3db17b..f1824fadb97fd 100644
--- a/app/code/Magento/Integration/etc/db_schema.xml
+++ b/app/code/Magento/Integration/etc/db_schema.xml
@@ -136,7 +136,7 @@
comment="User type (admin or customer)"/>
-
diff --git a/app/code/Magento/LayeredNavigation/Observer/Edit/Tab/Front/ProductAttributeFormBuildFrontTabObserver.php b/app/code/Magento/LayeredNavigation/Observer/Edit/Tab/Front/ProductAttributeFormBuildFrontTabObserver.php
index 1bb601e3a4ebd..ce618f97883b0 100644
--- a/app/code/Magento/LayeredNavigation/Observer/Edit/Tab/Front/ProductAttributeFormBuildFrontTabObserver.php
+++ b/app/code/Magento/LayeredNavigation/Observer/Edit/Tab/Front/ProductAttributeFormBuildFrontTabObserver.php
@@ -60,7 +60,11 @@ public function execute(\Magento\Framework\Event\Observer $observer)
'name' => 'is_filterable',
'label' => __("Use in Layered Navigation"),
'title' => __('Can be used only with catalog input type Yes/No, Dropdown, Multiple Select and Price'),
- 'note' => __('Can be used only with catalog input type Yes/No, Dropdown, Multiple Select and Price.'),
+ 'note' => __(
+ 'Can be used only with catalog input type Yes/No, Dropdown, Multiple Select and Price.
+
Price is not compatible with \'Filterable (no results)\' option -
+ it will make no affect on Price filter.'
+ ),
'values' => [
['value' => '0', 'label' => __('No')],
['value' => '1', 'label' => __('Filterable (with results)')],
diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection.xml
new file mode 100644
index 0000000000000..e7d57af1172c6
--- /dev/null
+++ b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Newsletter/Model/Queue.php b/app/code/Magento/Newsletter/Model/Queue.php
index efb68fd4243d1..a3279f8c83699 100644
--- a/app/code/Magento/Newsletter/Model/Queue.php
+++ b/app/code/Magento/Newsletter/Model/Queue.php
@@ -7,6 +7,7 @@
use Magento\Framework\App\TemplateTypesInterface;
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
+use Magento\Framework\Stdlib\DateTime\Timezone\LocalizedDateToUtcConverterInterface;
/**
* Newsletter queue model.
@@ -117,6 +118,11 @@ class Queue extends \Magento\Framework\Model\AbstractModel implements TemplateTy
*/
private $timezone;
+ /**
+ * @var LocalizedDateToUtcConverterInterface
+ */
+ private $utcConverter;
+
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
@@ -130,6 +136,7 @@ class Queue extends \Magento\Framework\Model\AbstractModel implements TemplateTy
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
* @param TimezoneInterface $timezone
+ * @param LocalizedDateToUtcConverterInterface $utcConverter
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -144,7 +151,8 @@ public function __construct(
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = [],
- TimezoneInterface $timezone = null
+ TimezoneInterface $timezone = null,
+ LocalizedDateToUtcConverterInterface $utcConverter = null
) {
parent::__construct(
$context,
@@ -159,9 +167,10 @@ public function __construct(
$this->_problemFactory = $problemFactory;
$this->_subscribersCollection = $subscriberCollectionFactory->create();
$this->_transportBuilder = $transportBuilder;
- $this->timezone = $timezone ?: \Magento\Framework\App\ObjectManager::getInstance()->get(
- TimezoneInterface::class
- );
+
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+ $this->timezone = $timezone ?: $objectManager->get(TimezoneInterface::class);
+ $this->utcConverter = $utcConverter ?? $objectManager->get(LocalizedDateToUtcConverterInterface::class);
}
/**
@@ -196,7 +205,7 @@ public function setQueueStartAtByString($startAt)
if ($startAt === null || $startAt == '') {
$this->setQueueStartAt(null);
} else {
- $this->setQueueStartAt($this->timezone->convertConfigTimeToUtc($startAt));
+ $this->setQueueStartAt($this->utcConverter->convertLocalizedDateToUtc($startAt));
}
return $this;
}
diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php
index 5527060a6e2f1..70b9b6aff84d3 100644
--- a/app/code/Magento/Newsletter/Model/Subscriber.php
+++ b/app/code/Magento/Newsletter/Model/Subscriber.php
@@ -597,6 +597,8 @@ protected function _updateCustomerSubscription($customerId, $subscribe)
} elseif (($this->getStatus() == self::STATUS_UNCONFIRMED) && ($customerData->getConfirmation() === null)) {
$status = self::STATUS_SUBSCRIBED;
$sendInformationEmail = true;
+ } elseif (($this->getStatus() == self::STATUS_NOT_ACTIVE) && ($customerData->getConfirmation() === null)) {
+ $status = self::STATUS_NOT_ACTIVE;
} else {
$status = self::STATUS_UNSUBSCRIBED;
}
diff --git a/app/code/Magento/Newsletter/i18n/en_US.csv b/app/code/Magento/Newsletter/i18n/en_US.csv
index c49fdc80da810..388b583f990b1 100644
--- a/app/code/Magento/Newsletter/i18n/en_US.csv
+++ b/app/code/Magento/Newsletter/i18n/en_US.csv
@@ -67,8 +67,8 @@ Subscribers,Subscribers
"Something went wrong while saving this template.","Something went wrong while saving this template."
"Newsletter Subscription","Newsletter Subscription"
"Something went wrong while saving your subscription.","Something went wrong while saving your subscription."
-"We saved the subscription.","We saved the subscription."
-"We removed the subscription.","We removed the subscription."
+"We have saved your subscription.","We have saved your subscription."
+"We have removed your newsletter subscription.","We have removed your newsletter subscription."
"Your subscription has been confirmed.","Your subscription has been confirmed."
"This is an invalid subscription confirmation code.","This is an invalid subscription confirmation code."
"This is an invalid subscription ID.","This is an invalid subscription ID."
@@ -76,7 +76,7 @@ Subscribers,Subscribers
"Sorry, but the administrator denied subscription for guests. Please register.","Sorry, but the administrator denied subscription for guests. Please register."
"Please enter a valid email address.","Please enter a valid email address."
"This email address is already subscribed.","This email address is already subscribed."
-"The confirmation request has been sent.","The confirmation request has been sent."
+"A confirmation request has been sent.","A confirmation request has been sent."
"Thank you for your subscription.","Thank you for your subscription."
"There was a problem with the subscription: %1","There was a problem with the subscription: %1"
"Something went wrong with the subscription.","Something went wrong with the subscription."
@@ -151,3 +151,4 @@ Unconfirmed,Unconfirmed
Store,Store
"Store View","Store View"
"Newsletter Subscriptions","Newsletter Subscriptions"
+"We have updated your subscription.","We have updated your subscription."
diff --git a/app/code/Magento/Quote/Model/BillingAddressManagement.php b/app/code/Magento/Quote/Model/BillingAddressManagement.php
index 70a8c94fefad0..bc055e71c662e 100644
--- a/app/code/Magento/Quote/Model/BillingAddressManagement.php
+++ b/app/code/Magento/Quote/Model/BillingAddressManagement.php
@@ -14,7 +14,6 @@
/**
* Quote billing address write service object.
- *
*/
class BillingAddressManagement implements BillingAddressManagementInterface
{
@@ -70,13 +69,14 @@ public function __construct(
}
/**
- * {@inheritDoc}
+ * @inheritdoc
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $address, $useForShipping = false)
{
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->quoteRepository->getActive($cartId);
+ $address->setCustomerId($quote->getCustomerId());
$quote->removeAddress($quote->getBillingAddress()->getId());
$quote->setBillingAddress($address);
try {
@@ -91,7 +91,7 @@ public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $addres
}
/**
- * {@inheritDoc}
+ * @inheritdoc
*/
public function get($cartId)
{
@@ -100,6 +100,8 @@ public function get($cartId)
}
/**
+ * Get shipping address assignment
+ *
* @return \Magento\Quote\Model\ShippingAddressAssignment
* @deprecated 100.2.0
*/
diff --git a/app/code/Magento/Quote/Model/Quote/Address.php b/app/code/Magento/Quote/Model/Quote/Address.php
index 3eb5d68885035..bafd6634a94c3 100644
--- a/app/code/Magento/Quote/Model/Quote/Address.php
+++ b/app/code/Magento/Quote/Model/Quote/Address.php
@@ -28,8 +28,8 @@
* @method Address setAddressType(string $value)
* @method int getFreeShipping()
* @method Address setFreeShipping(int $value)
- * @method int getCollectShippingRates()
- * @method Address setCollectShippingRates(int $value)
+ * @method bool getCollectShippingRates()
+ * @method Address setCollectShippingRates(bool $value)
* @method Address setShippingMethod(string $value)
* @method string getShippingDescription()
* @method Address setShippingDescription(string $value)
@@ -965,6 +965,7 @@ public function collectShippingRates()
/**
* Request shipping rates for entire address or specified address item
+ *
* Returns true if current selected shipping method code corresponds to one of the found rates
*
* @param \Magento\Quote\Model\Quote\Item\AbstractItem $item
@@ -1002,8 +1003,14 @@ public function requestShippingRates(\Magento\Quote\Model\Quote\Item\AbstractIte
/**
* Store and website identifiers specified from StoreManager
*/
- $request->setStoreId($this->storeManager->getStore()->getId());
- $request->setWebsiteId($this->storeManager->getWebsite()->getId());
+ if ($this->getQuote()->getStoreId()) {
+ $storeId = $this->getQuote()->getStoreId();
+ $request->setStoreId($storeId);
+ $request->setWebsiteId($this->storeManager->getStore($storeId)->getWebsiteId());
+ } else {
+ $request->setStoreId($this->storeManager->getStore()->getId());
+ $request->setWebsiteId($this->storeManager->getWebsite()->getId());
+ }
$request->setFreeShipping($this->getFreeShipping());
/**
* Currencies need to convert in free shipping
@@ -1348,7 +1355,7 @@ public function getAllBaseTotalAmounts()
/******************************* End Total Collector Interface *******************************************/
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
protected function _getValidationRulesBeforeSave()
{
@@ -1356,7 +1363,7 @@ protected function _getValidationRulesBeforeSave()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getCountryId()
{
@@ -1364,7 +1371,7 @@ public function getCountryId()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCountryId($countryId)
{
@@ -1372,7 +1379,7 @@ public function setCountryId($countryId)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getStreet()
{
@@ -1381,7 +1388,7 @@ public function getStreet()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setStreet($street)
{
@@ -1389,7 +1396,7 @@ public function setStreet($street)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getCompany()
{
@@ -1397,7 +1404,7 @@ public function getCompany()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCompany($company)
{
@@ -1405,7 +1412,7 @@ public function setCompany($company)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getTelephone()
{
@@ -1413,7 +1420,7 @@ public function getTelephone()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setTelephone($telephone)
{
@@ -1421,7 +1428,7 @@ public function setTelephone($telephone)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getFax()
{
@@ -1429,7 +1436,7 @@ public function getFax()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setFax($fax)
{
@@ -1437,7 +1444,7 @@ public function setFax($fax)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getPostcode()
{
@@ -1445,7 +1452,7 @@ public function getPostcode()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setPostcode($postcode)
{
@@ -1453,7 +1460,7 @@ public function setPostcode($postcode)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getCity()
{
@@ -1461,7 +1468,7 @@ public function getCity()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCity($city)
{
@@ -1469,7 +1476,7 @@ public function setCity($city)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getFirstname()
{
@@ -1477,7 +1484,7 @@ public function getFirstname()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setFirstname($firstname)
{
@@ -1485,7 +1492,7 @@ public function setFirstname($firstname)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getLastname()
{
@@ -1493,7 +1500,7 @@ public function getLastname()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setLastname($lastname)
{
@@ -1501,7 +1508,7 @@ public function setLastname($lastname)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getMiddlename()
{
@@ -1509,7 +1516,7 @@ public function getMiddlename()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setMiddlename($middlename)
{
@@ -1517,7 +1524,7 @@ public function setMiddlename($middlename)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getPrefix()
{
@@ -1525,7 +1532,7 @@ public function getPrefix()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setPrefix($prefix)
{
@@ -1533,7 +1540,7 @@ public function setPrefix($prefix)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getSuffix()
{
@@ -1541,7 +1548,7 @@ public function getSuffix()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setSuffix($suffix)
{
@@ -1549,7 +1556,7 @@ public function setSuffix($suffix)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getVatId()
{
@@ -1557,7 +1564,7 @@ public function getVatId()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setVatId($vatId)
{
@@ -1565,7 +1572,7 @@ public function setVatId($vatId)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getCustomerId()
{
@@ -1573,7 +1580,7 @@ public function getCustomerId()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCustomerId($customerId)
{
@@ -1581,7 +1588,7 @@ public function setCustomerId($customerId)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getEmail()
{
@@ -1594,7 +1601,7 @@ public function getEmail()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setEmail($email)
{
@@ -1602,7 +1609,7 @@ public function setEmail($email)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setRegion($region)
{
@@ -1610,7 +1617,7 @@ public function setRegion($region)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setRegionId($regionId)
{
@@ -1618,7 +1625,7 @@ public function setRegionId($regionId)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setRegionCode($regionCode)
{
@@ -1626,7 +1633,7 @@ public function setRegionCode($regionCode)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getSameAsBilling()
{
@@ -1634,7 +1641,7 @@ public function getSameAsBilling()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setSameAsBilling($sameAsBilling)
{
@@ -1642,7 +1649,7 @@ public function setSameAsBilling($sameAsBilling)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getCustomerAddressId()
{
@@ -1650,7 +1657,7 @@ public function getCustomerAddressId()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCustomerAddressId($customerAddressId)
{
@@ -1681,7 +1688,7 @@ public function setSaveInAddressBook($saveInAddressBook)
//@codeCoverageIgnoreEnd
/**
- * {@inheritdoc}
+ * @inheritdoc
*
* @return \Magento\Quote\Api\Data\AddressExtensionInterface|null
*/
@@ -1691,7 +1698,7 @@ public function getExtensionAttributes()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*
* @param \Magento\Quote\Api\Data\AddressExtensionInterface $extensionAttributes
* @return $this
@@ -1712,7 +1719,7 @@ public function getShippingMethod()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
protected function getCustomAttributesCodes()
{
diff --git a/app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml b/app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml
index dba4a94f3db2a..1961b1002df70 100644
--- a/app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml
+++ b/app/code/Magento/Quote/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml
@@ -6,8 +6,7 @@
*/
-->
-
+
@@ -23,11 +22,12 @@
-
-
+
+
+
diff --git a/app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml b/app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml
index 32ac73aca7c03..0ca252aa73545 100644
--- a/app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml
+++ b/app/code/Magento/Quote/Test/Mftf/Section/AdminProductGridSection.xml
@@ -7,8 +7,8 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
diff --git a/app/code/Magento/Quote/Test/Unit/Model/GuestCartManagement/Plugin/AuthorizationTest.php b/app/code/Magento/Quote/Test/Unit/Model/GuestCartManagement/Plugin/AuthorizationTest.php
index 22962aacc8dac..49ed8a10bee35 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/GuestCartManagement/Plugin/AuthorizationTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/GuestCartManagement/Plugin/AuthorizationTest.php
@@ -36,7 +36,7 @@ protected function setUp()
/**
* @expectedException \Magento\Framework\Exception\StateException
- * @expectedMessage You don't have the correct permissions to assign the customer to the cart.
+ * @expectedExceptionMessage You don't have the correct permissions to assign the customer to the cart.
*/
public function testBeforeAssignCustomer()
{
diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/UpdaterTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/UpdaterTest.php
index af47f6276705b..7933da7c5fe37 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/UpdaterTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/UpdaterTest.php
@@ -92,7 +92,7 @@ protected function setUp()
/**
* @expectedException \InvalidArgumentException
- * @ExceptedExceptionMessage The qty value is required to update quote item.
+ * @expectedExceptionMessage The qty value is required to update quote item.
*/
public function testUpdateNoQty()
{
diff --git a/app/code/Magento/Quote/Test/Unit/Model/ShippingAddressManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/ShippingAddressManagementTest.php
index e3d5528d62c70..89fea2bec73a8 100644
--- a/app/code/Magento/Quote/Test/Unit/Model/ShippingAddressManagementTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Model/ShippingAddressManagementTest.php
@@ -102,7 +102,7 @@ protected function setUp()
/**
* @expectedException \Magento\Framework\Exception\NoSuchEntityException
- * @expected ExceptionMessage error345
+ * @expectedExceptionMessage error345
*/
public function testSetAddressValidationFailed()
{
diff --git a/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php b/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php
index 5682892a77c60..7337286149cc3 100644
--- a/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php
+++ b/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php
@@ -113,7 +113,7 @@ public function beforeSave()
/**
* Retrieve visitor id
*
- * if don't exists return current visitor id
+ * If don't exists return current visitor id
*
* @return int
*/
@@ -128,7 +128,7 @@ public function getVisitorId()
/**
* Retrieve customer id
*
- * if customer don't logged in return null
+ * If customer don't logged in return null
*
* @return int
*/
@@ -143,7 +143,7 @@ public function getCustomerId()
/**
* Retrieve store id
*
- * default return current store id
+ * Default return current store id
*
* @return int
*/
@@ -246,13 +246,14 @@ public function clean()
/**
* Add product ids to current visitor/customer log
+ *
* @param string[] $productIds
* @return $this
*/
public function registerIds($productIds)
{
$this->_getResource()->registerIds($this, $productIds);
- $this->_getSession()->unsData($this->_countCacheKey);
+ $this->_getSession()->unsetData($this->_countCacheKey);
return $this;
}
}
diff --git a/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminReviewOrderActionGroup.xml b/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminReviewOrderActionGroup.xml
new file mode 100644
index 0000000000000..003a5e6655f34
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/ActionGroup/AdminReviewOrderActionGroup.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Section/OrderedProductsSection.xml b/app/code/Magento/Reports/Test/Mftf/Section/OrderedProductsSection.xml
new file mode 100644
index 0000000000000..89e8497dddcea
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Section/OrderedProductsSection.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php b/app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php
index 4e55484e5dd94..3033a31ff1723 100644
--- a/app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php
+++ b/app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php
@@ -3,7 +3,6 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-
namespace Magento\Review\Model\ResourceModel\Review\Product;
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php
index b690395ebab7c..088ad5a61f6c3 100644
--- a/app/code/Magento/Sales/Model/AdminOrder/Create.php
+++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php
@@ -14,6 +14,7 @@
use Magento\Quote\Model\Quote\Item;
use Magento\Sales\Api\Data\OrderAddressInterface;
use Magento\Sales\Model\Order;
+use Magento\Store\Model\StoreManagerInterface;
use Psr\Log\LoggerInterface;
/**
@@ -242,6 +243,11 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\
*/
private $dataObjectConverter;
+ /**
+ * @var StoreManagerInterface
+ */
+ private $storeManager;
+
/**
* @param \Magento\Framework\ObjectManagerInterface $objectManager
* @param \Magento\Framework\Event\ManagerInterface $eventManager
@@ -273,6 +279,7 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\
* @param array $data
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
* @param ExtensibleDataObjectConverter|null $dataObjectConverter
+ * @param StoreManagerInterface $storeManager
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -305,7 +312,8 @@ public function __construct(
\Magento\Quote\Model\QuoteFactory $quoteFactory,
array $data = [],
\Magento\Framework\Serialize\Serializer\Json $serializer = null,
- ExtensibleDataObjectConverter $dataObjectConverter = null
+ ExtensibleDataObjectConverter $dataObjectConverter = null,
+ StoreManagerInterface $storeManager = null
) {
$this->_objectManager = $objectManager;
$this->_eventManager = $eventManager;
@@ -339,6 +347,7 @@ public function __construct(
parent::__construct($data);
$this->dataObjectConverter = $dataObjectConverter ?: ObjectManager::getInstance()
->get(ExtensibleDataObjectConverter::class);
+ $this->storeManager = $storeManager ?: ObjectManager::getInstance()->get(StoreManagerInterface::class);
}
/**
@@ -416,7 +425,8 @@ public function setRecollect($flag)
/**
* Recollect totals for customer cart.
- * Set recollect totals flag for quote
+ *
+ * Set recollect totals flag for quote.
*
* @return $this
*/
@@ -1333,6 +1343,7 @@ protected function _createCustomerForm(\Magento\Customer\Api\Data\CustomerInterf
/**
* Set and validate Quote address
+ *
* All errors added to _errors
*
* @param \Magento\Quote\Model\Quote\Address $address
@@ -1536,6 +1547,8 @@ public function resetShippingMethod()
*/
public function collectShippingRates()
{
+ $store = $this->getQuote()->getStore();
+ $this->storeManager->setCurrentStore($store);
$this->getQuote()->getShippingAddress()->setCollectShippingRates(true);
$this->collectRates();
diff --git a/app/code/Magento/Sales/Model/Order/Address.php b/app/code/Magento/Sales/Model/Order/Address.php
index 77d8330a72550..083ec0089a5c0 100644
--- a/app/code/Magento/Sales/Model/Order/Address.php
+++ b/app/code/Magento/Sales/Model/Order/Address.php
@@ -173,8 +173,8 @@ protected function implodeStreetValue($value)
* Enforce format of the street field
*
* @param array|string $key
- * @param null $value
- * @return \Magento\Framework\DataObject
+ * @param array|string $value
+ * @return $this
*/
public function setData($key, $value = null)
{
@@ -508,7 +508,7 @@ public function getVatRequestSuccess()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setParentId($id)
{
@@ -516,7 +516,7 @@ public function setParentId($id)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCustomerAddressId($id)
{
@@ -524,7 +524,7 @@ public function setCustomerAddressId($id)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setRegionId($id)
{
@@ -532,7 +532,7 @@ public function setRegionId($id)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setStreet($street)
{
@@ -540,7 +540,7 @@ public function setStreet($street)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCustomerId($id)
{
@@ -548,7 +548,7 @@ public function setCustomerId($id)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setFax($fax)
{
@@ -556,7 +556,7 @@ public function setFax($fax)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setRegion($region)
{
@@ -564,7 +564,7 @@ public function setRegion($region)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setPostcode($postcode)
{
@@ -572,7 +572,7 @@ public function setPostcode($postcode)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setLastname($lastname)
{
@@ -580,7 +580,7 @@ public function setLastname($lastname)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCity($city)
{
@@ -588,7 +588,7 @@ public function setCity($city)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setEmail($email)
{
@@ -596,7 +596,7 @@ public function setEmail($email)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setTelephone($telephone)
{
@@ -604,7 +604,7 @@ public function setTelephone($telephone)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCountryId($id)
{
@@ -612,7 +612,7 @@ public function setCountryId($id)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setFirstname($firstname)
{
@@ -620,7 +620,7 @@ public function setFirstname($firstname)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setAddressType($addressType)
{
@@ -628,7 +628,7 @@ public function setAddressType($addressType)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setPrefix($prefix)
{
@@ -636,7 +636,7 @@ public function setPrefix($prefix)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setMiddlename($middlename)
{
@@ -644,7 +644,7 @@ public function setMiddlename($middlename)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setSuffix($suffix)
{
@@ -652,7 +652,7 @@ public function setSuffix($suffix)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setCompany($company)
{
@@ -660,7 +660,7 @@ public function setCompany($company)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setVatId($id)
{
@@ -668,7 +668,7 @@ public function setVatId($id)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setVatIsValid($vatIsValid)
{
@@ -676,7 +676,7 @@ public function setVatIsValid($vatIsValid)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setVatRequestId($id)
{
@@ -684,7 +684,7 @@ public function setVatRequestId($id)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setRegionCode($regionCode)
{
@@ -692,7 +692,7 @@ public function setRegionCode($regionCode)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setVatRequestDate($vatRequestDate)
{
@@ -700,7 +700,7 @@ public function setVatRequestDate($vatRequestDate)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function setVatRequestSuccess($vatRequestSuccess)
{
@@ -708,7 +708,7 @@ public function setVatRequestSuccess($vatRequestSuccess)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*
* @return \Magento\Sales\Api\Data\OrderAddressExtensionInterface|null
*/
@@ -718,7 +718,7 @@ public function getExtensionAttributes()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*
* @param \Magento\Sales\Api\Data\OrderAddressExtensionInterface $extensionAttributes
* @return $this
diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Discount.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Discount.php
index 0cc4143e569db..06bfbcf24daac 100644
--- a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Discount.php
+++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Discount.php
@@ -5,11 +5,17 @@
*/
namespace Magento\Sales\Model\Order\Creditmemo\Total;
+/**
+ * Discount total calculator
+ */
class Discount extends AbstractTotal
{
/**
+ * Collect discount
+ *
* @param \Magento\Sales\Model\Order\Creditmemo $creditmemo
* @return $this
+ * @throws \Magento\Framework\Exception\LocalizedException
*/
public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo)
{
@@ -26,6 +32,16 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo)
* basing on how much shipping should be refunded.
*/
$baseShippingAmount = $this->getBaseShippingAmount($creditmemo);
+
+ /**
+ * If credit memo's shipping amount is set and Order's shipping amount is 0,
+ * throw exception with different message
+ */
+ if ($baseShippingAmount && $order->getBaseShippingAmount() <= 0) {
+ throw new \Magento\Framework\Exception\LocalizedException(
+ __("You can not refund shipping if there is no shipping amount.")
+ );
+ }
if ($baseShippingAmount) {
$baseShippingDiscount = $baseShippingAmount *
$order->getBaseShippingDiscountAmount() /
diff --git a/app/code/Magento/Sales/Model/Order/Validation/CanInvoice.php b/app/code/Magento/Sales/Model/Order/Validation/CanInvoice.php
index b109b87e61bbf..7b346a232ab95 100644
--- a/app/code/Magento/Sales/Model/Order/Validation/CanInvoice.php
+++ b/app/code/Magento/Sales/Model/Order/Validation/CanInvoice.php
@@ -15,6 +15,8 @@
class CanInvoice implements ValidatorInterface
{
/**
+ * Validate
+ *
* @param OrderInterface $entity
* @return array
*/
@@ -32,6 +34,8 @@ public function validate($entity)
}
/**
+ * Is state ready for invoice
+ *
* @param OrderInterface $order
* @return bool
*/
@@ -44,12 +48,14 @@ private function isStateReadyForInvoice(OrderInterface $order)
$order->getState() === Order::STATE_CLOSED
) {
return false;
- };
+ }
return true;
}
/**
+ * Can invoice
+ *
* @param OrderInterface $order
* @return bool
*/
diff --git a/app/code/Magento/Sales/Model/ResourceModel/Order/Grid/Collection.php b/app/code/Magento/Sales/Model/ResourceModel/Order/Grid/Collection.php
index f6dd8f8527a53..82c612c1a781d 100644
--- a/app/code/Magento/Sales/Model/ResourceModel/Order/Grid/Collection.php
+++ b/app/code/Magento/Sales/Model/ResourceModel/Order/Grid/Collection.php
@@ -35,4 +35,19 @@ public function __construct(
) {
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
}
+
+ /**
+ * @inheritdoc
+ */
+ protected function _initSelect()
+ {
+ parent::_initSelect();
+
+ $tableDescription = $this->getConnection()->describeTable($this->getMainTable());
+ foreach ($tableDescription as $columnInfo) {
+ $this->addFilterToMap($columnInfo['COLUMN_NAME'], 'main_table.' . $columnInfo['COLUMN_NAME']);
+ }
+
+ return $this;
+ }
}
diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml
index 53dc52ca58fa7..cc8a62ca48961 100644
--- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml
+++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml
@@ -287,6 +287,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicePaymentShippingSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicePaymentShippingSection.xml
index 918a8e814b555..8d7c64733972e 100644
--- a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicePaymentShippingSection.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicePaymentShippingSection.xml
@@ -15,5 +15,7 @@
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml
index 4350ffeb03373..60d4c53418dc8 100644
--- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml
@@ -15,4 +15,4 @@
-
\ No newline at end of file
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderStoreScopeTreeSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderStoreScopeTreeSection.xml
index 050e1ba8b2df4..cbe17499319f9 100644
--- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderStoreScopeTreeSection.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderStoreScopeTreeSection.xml
@@ -11,5 +11,6 @@
diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml
index 7ece18fb863b7..53a6cbffcdac6 100644
--- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml
@@ -29,5 +29,7 @@
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml
index 8d99bf4872d0a..717022322698f 100644
--- a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml
@@ -18,7 +18,7 @@
-
+
@@ -29,5 +29,6 @@
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml
index e32e6b9e6ec5d..ff1e27a2efa08 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml
@@ -1,129 +1,132 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml
index 60df3f27fd65b..08e859b11d1bb 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml
@@ -45,6 +45,8 @@
+
+
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/DiscountTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/DiscountTest.php
index 18efef38b204c..8a45aa8c7958e 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/DiscountTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/DiscountTest.php
@@ -74,7 +74,7 @@ public function testCollect()
$this->orderMock->expects($this->once())
->method('getBaseShippingDiscountAmount')
->willReturn(1);
- $this->orderMock->expects($this->exactly(2))
+ $this->orderMock->expects($this->exactly(3))
->method('getBaseShippingAmount')
->willReturn(1);
$this->orderMock->expects($this->once())
@@ -150,7 +150,7 @@ public function testCollectNoBaseShippingAmount()
$this->orderMock->expects($this->once())
->method('getBaseShippingDiscountAmount')
->willReturn(1);
- $this->orderMock->expects($this->exactly(2))
+ $this->orderMock->expects($this->exactly(3))
->method('getBaseShippingAmount')
->willReturn(1);
$this->orderMock->expects($this->once())
@@ -269,4 +269,30 @@ public function testCollectZeroShipping()
);
$this->assertEquals($this->total, $this->total->collect($this->creditmemoMock));
}
+
+ /**
+ * @expectedException \Magento\Framework\Exception\LocalizedException
+ * @expectedExceptionMessage You can not refund shipping if there is no shipping amount.
+ */
+ public function testCollectNonZeroShipping()
+ {
+ $this->creditmemoMock->expects($this->once())
+ ->method('setDiscountAmount')
+ ->willReturnSelf();
+ $this->creditmemoMock->expects($this->once())
+ ->method('setBaseDiscountAmount')
+ ->willReturnSelf();
+ $this->creditmemoMock->expects($this->once())
+ ->method('getOrder')
+ ->willReturn($this->orderMock);
+ $this->creditmemoMock->expects($this->once())
+ ->method('getBaseShippingAmount')
+ ->willReturn('10.0000');
+ $this->orderMock->expects($this->never())
+ ->method('getBaseShippingDiscountAmount');
+ $this->orderMock->expects($this->once())
+ ->method('getBaseShippingAmount')
+ ->willReturn('0.0000');
+ $this->assertEquals($this->total, $this->total->collect($this->creditmemoMock));
+ }
}
diff --git a/app/code/Magento/Sales/etc/db_schema.xml b/app/code/Magento/Sales/etc/db_schema.xml
index 1310204dcc8f3..ced999bb86019 100644
--- a/app/code/Magento/Sales/etc/db_schema.xml
+++ b/app/code/Magento/Sales/etc/db_schema.xml
@@ -9,7 +9,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
+ comment="Entity Id"/>
@@ -297,13 +297,13 @@
+ comment="Entity Id"/>
+ comment="Store Id"/>
+ comment="Customer Id"/>
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+ comment="Customer Address Id"/>
+ comment="Quote Address Id"/>
+ comment="Region Id"/>
+ comment="Customer Id"/>
@@ -431,9 +431,9 @@
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+ comment="Entity Id"/>
+ comment="Store Id"/>
+ comment="Order Id"/>
+ comment="Customer Id"/>
+ comment="Shipping Address Id"/>
+ comment="Billing Address Id"/>
@@ -762,14 +762,14 @@
+ comment="Entity Id"/>
+ comment="Store Id"/>
-
+
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+ comment="Product Id"/>
+ comment="Order Item Id"/>
@@ -867,14 +867,14 @@
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+ comment="Order Id"/>
@@ -901,9 +901,9 @@
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+ comment="Entity Id"/>
+ comment="Store Id"/>
+ comment="Entity Id"/>
+ comment="Store Id"/>
+ comment="Order Id"/>
@@ -1136,9 +1136,9 @@
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+ comment="Entity Id"/>
+ comment="Store Id"/>
+ comment="Entity Id"/>
+ comment="Order Id"/>
@@ -1366,7 +1366,7 @@
comment="Base Grand Total"/>
+ comment="Store Id"/>
@@ -1438,9 +1438,9 @@
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+ comment="Product Id"/>
+ comment="Order Item Id"/>
@@ -1494,9 +1494,9 @@
+ comment="Entity Id"/>
+ comment="Parent Id"/>
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml
index c69fa97efc034..92d221de9e157 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml
@@ -40,6 +40,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml
index 49233cb4b42f5..3deb688de9c34 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml
@@ -42,6 +42,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml
index c1aeebfca520e..ec835384a52f8 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml
@@ -42,6 +42,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml
index 30aa26b26ed39..08a08275ee07a 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml
@@ -40,6 +40,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml
index 7ac69f82f79da..a39530f7607e4 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml
@@ -40,6 +40,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml
index eb04ce04f0718..1f7d849ac02b0 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml
@@ -40,6 +40,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml
index 4c194c63ec378..e2687f5f16baf 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
@@ -96,6 +96,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml
index ca897bffe8b79..3eec020e26347 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml
@@ -43,6 +43,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml
index 83854c4a767ca..73b5d2546f439 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml
@@ -43,6 +43,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml
index 60a19074317fc..51d11b4e5cb1c 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml
@@ -43,6 +43,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml
index f98f7b408436f..9395e87c20edb 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml
@@ -43,6 +43,8 @@
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml
index 6567beba198eb..7c9c52e1c02ac 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml
@@ -43,6 +43,8 @@
+
+
diff --git a/app/code/Magento/Search/Test/Unit/Model/SynonymGroupRepositoryTest.php b/app/code/Magento/Search/Test/Unit/Model/SynonymGroupRepositoryTest.php
index f62c07b149c0e..4532479c482b5 100644
--- a/app/code/Magento/Search/Test/Unit/Model/SynonymGroupRepositoryTest.php
+++ b/app/code/Magento/Search/Test/Unit/Model/SynonymGroupRepositoryTest.php
@@ -53,7 +53,7 @@ public function testSaveCreate()
/**
* @expectedException \Magento\Search\Model\Synonym\MergeConflictException
- * @expecteExceptionMessage (c,d,e)
+ * @expectedExceptionMessage Merge conflict with existing synonym group(s): (a,b,c)
*/
public function testSaveCreateMergeConflict()
{
@@ -138,7 +138,7 @@ public function testSaveUpdate()
/**
* @expectedException \Magento\Search\Model\Synonym\MergeConflictException
- * @expecteExceptionMessage (d,h,i)
+ * @expectedExceptionMessage (d,h,i)
*/
public function testSaveUpdateMergeConflict()
{
diff --git a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml
index 2b25e0efab84a..4922a9f365ced 100644
--- a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml
+++ b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml
@@ -17,13 +17,13 @@