diff --git a/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js b/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js
index d79c42a711565..1d46084020220 100644
--- a/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js
+++ b/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js
@@ -56,7 +56,7 @@ define([
*/
checkCustomerData: function (formId, captchaData, captcha) {
if (!_.isEmpty(captchaData) &&
- !_.isEmpty(captchaData)[formId] &&
+ !_.isEmpty(captchaData[formId]) &&
captchaData[formId].timestamp > captcha.timestamp
) {
if (!captcha.isRequired() && captchaData[formId].isRequired) {
diff --git a/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php b/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php
index 83a2d1340794c..a0f6fcf315c7f 100644
--- a/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php
+++ b/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php
@@ -6,12 +6,22 @@
namespace Magento\Catalog\Model\Product\Price;
+use Magento\Catalog\Api\Data\SpecialPriceInterface;
+use Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory;
+use Magento\Catalog\Api\SpecialPriceStorageInterface;
+use Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor;
+use Magento\Catalog\Model\Product\Price\Validation\Result;
+use Magento\Catalog\Model\ProductIdLocatorInterface;
+use Magento\Framework\App\ObjectManager;
use Magento\Framework\Exception\NoSuchEntityException;
+use Magento\Catalog\Helper\Data;
+use Magento\Store\Api\StoreRepositoryInterface;
/**
* Special price storage presents efficient price API and is used to retrieve, update or delete special prices.
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
-class SpecialPriceStorage implements \Magento\Catalog\Api\SpecialPriceStorageInterface
+class SpecialPriceStorage implements SpecialPriceStorageInterface
{
/**
* @var \Magento\Catalog\Api\SpecialPriceInterface
@@ -19,52 +29,59 @@ class SpecialPriceStorage implements \Magento\Catalog\Api\SpecialPriceStorageInt
private $specialPriceResource;
/**
- * @var \Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory
+ * @var SpecialPriceInterfaceFactory
*/
private $specialPriceFactory;
/**
- * @var \Magento\Catalog\Model\ProductIdLocatorInterface
+ * @var ProductIdLocatorInterface
*/
private $productIdLocator;
/**
- * @var \Magento\Store\Api\StoreRepositoryInterface
+ * @var StoreRepositoryInterface
*/
private $storeRepository;
/**
- * @var \Magento\Catalog\Model\Product\Price\Validation\Result
+ * @var Result
*/
private $validationResult;
/**
- * @var \Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor
+ * @var InvalidSkuProcessor
*/
private $invalidSkuProcessor;
/**
* @var array
*/
- private $allowedProductTypes = [];
+ private $allowedProductTypes;
+
+ /**
+ * @var Data
+ */
+ private $catalogData;
/**
* @param \Magento\Catalog\Api\SpecialPriceInterface $specialPriceResource
- * @param \Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory $specialPriceFactory
- * @param \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator
- * @param \Magento\Store\Api\StoreRepositoryInterface $storeRepository
- * @param \Magento\Catalog\Model\Product\Price\Validation\Result $validationResult
- * @param \Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor $invalidSkuProcessor
- * @param array $allowedProductTypes [optional]
+ * @param SpecialPriceInterfaceFactory $specialPriceFactory
+ * @param ProductIdLocatorInterface $productIdLocator
+ * @param StoreRepositoryInterface $storeRepository
+ * @param Result $validationResult
+ * @param InvalidSkuProcessor $invalidSkuProcessor
+ * @param array $allowedProductTypes
+ * @param Data|null $catalogData
*/
public function __construct(
\Magento\Catalog\Api\SpecialPriceInterface $specialPriceResource,
- \Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory $specialPriceFactory,
- \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator,
- \Magento\Store\Api\StoreRepositoryInterface $storeRepository,
- \Magento\Catalog\Model\Product\Price\Validation\Result $validationResult,
- \Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor $invalidSkuProcessor,
- array $allowedProductTypes = []
+ SpecialPriceInterfaceFactory $specialPriceFactory,
+ ProductIdLocatorInterface $productIdLocator,
+ StoreRepositoryInterface $storeRepository,
+ Result $validationResult,
+ InvalidSkuProcessor $invalidSkuProcessor,
+ array $allowedProductTypes = [],
+ ?Data $catalogData = null
) {
$this->specialPriceResource = $specialPriceResource;
$this->specialPriceFactory = $specialPriceFactory;
@@ -73,10 +90,11 @@ public function __construct(
$this->validationResult = $validationResult;
$this->invalidSkuProcessor = $invalidSkuProcessor;
$this->allowedProductTypes = $allowedProductTypes;
+ $this->catalogData = $catalogData ?: ObjectManager::getInstance()->get(Data::class);
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function get(array $skus)
{
@@ -85,7 +103,7 @@ public function get(array $skus)
$prices = [];
foreach ($rawPrices as $rawPrice) {
- /** @var \Magento\Catalog\Api\Data\SpecialPriceInterface $price */
+ /** @var SpecialPriceInterface $price */
$price = $this->specialPriceFactory->create();
$sku = isset($rawPrice['sku'])
? $rawPrice['sku']
@@ -102,7 +120,7 @@ public function get(array $skus)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function update(array $prices)
{
@@ -113,7 +131,7 @@ public function update(array $prices)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function delete(array $prices)
{
@@ -140,52 +158,14 @@ private function retrieveValidPrices(array $prices)
foreach ($prices as $key => $price) {
if (!$price->getSku() || in_array($price->getSku(), $failedSkus)) {
- $this->validationResult->addFailedItem(
- $key,
- __(
- 'The product that was requested doesn\'t exist. Verify the product and try again. '
- . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.',
- [
- 'SKU' => $price->getSku(),
- 'storeId' => $price->getStoreId(),
- 'priceFrom' => $price->getPriceFrom(),
- 'priceTo' => $price->getPriceTo()
- ]
- ),
- [
- 'SKU' => $price->getSku(),
- 'storeId' => $price->getStoreId(),
- 'priceFrom' => $price->getPriceFrom(),
- 'priceTo' => $price->getPriceTo()
- ]
- );
+ $errorMessage = 'The product that was requested doesn\'t exist. Verify the product and try again. '
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.';
+ $this->addFailedItemPrice($price, $key, $errorMessage, []);
}
+ $this->checkStore($price, $key);
$this->checkPrice($price, $key);
$this->checkDate($price, $price->getPriceFrom(), 'Price From', $key);
$this->checkDate($price, $price->getPriceTo(), 'Price To', $key);
- try {
- $this->storeRepository->getById($price->getStoreId());
- } catch (NoSuchEntityException $e) {
- $this->validationResult->addFailedItem(
- $key,
- __(
- 'Requested store is not found. '
- . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.',
- [
- 'SKU' => $price->getSku(),
- 'storeId' => $price->getStoreId(),
- 'priceFrom' => $price->getPriceFrom(),
- 'priceTo' => $price->getPriceTo()
- ]
- ),
- [
- 'SKU' => $price->getSku(),
- 'storeId' => $price->getStoreId(),
- 'priceFrom' => $price->getPriceFrom(),
- 'priceTo' => $price->getPriceTo()
- ]
- );
- }
}
foreach ($this->validationResult->getFailedRowIds() as $id) {
@@ -195,77 +175,95 @@ private function retrieveValidPrices(array $prices)
return $prices;
}
+ /**
+ * Check that store exists and is global when price scope is global and otherwise add error to aggregator.
+ *
+ * @param SpecialPriceInterface $price
+ * @param int $key
+ * @return void
+ */
+ private function checkStore(SpecialPriceInterface $price, int $key): void
+ {
+ if ($this->catalogData->isPriceGlobal() && $price->getStoreId() !== 0) {
+ $errorMessage = 'Could not change non global Price when price scope is global. '
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.';
+ $this->addFailedItemPrice($price, $key, $errorMessage, []);
+ }
+
+ try {
+ $this->storeRepository->getById($price->getStoreId());
+ } catch (NoSuchEntityException $e) {
+ $errorMessage = 'Requested store is not found. '
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.';
+ $this->addFailedItemPrice($price, $key, $errorMessage, []);
+ }
+ }
+
/**
* Check that date value is correct and add error to aggregator if it contains incorrect data.
*
- * @param \Magento\Catalog\Api\Data\SpecialPriceInterface $price
+ * @param SpecialPriceInterface $price
* @param string $value
* @param string $label
* @param int $key
* @return void
*/
- private function checkDate(\Magento\Catalog\Api\Data\SpecialPriceInterface $price, $value, $label, $key)
+ private function checkDate(SpecialPriceInterface $price, $value, $label, $key)
{
if ($value && !$this->isCorrectDateValue($value)) {
- $this->validationResult->addFailedItem(
- $key,
- __(
- 'Invalid attribute %label = %priceTo. '
- . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.',
- [
- 'label' => $label,
- 'SKU' => $price->getSku(),
- 'storeId' => $price->getStoreId(),
- 'priceFrom' => $price->getPriceFrom(),
- 'priceTo' => $price->getPriceTo()
- ]
- ),
- [
- 'label' => $label,
- 'SKU' => $price->getSku(),
- 'storeId' => $price->getStoreId(),
- 'priceFrom' => $price->getPriceFrom(),
- 'priceTo' => $price->getPriceTo()
- ]
- );
+ $errorMessage = 'Invalid attribute %label = %priceTo. '
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.';
+ $this->addFailedItemPrice($price, $key, $errorMessage, ['label' => $label]);
}
}
/**
- * Check that provided price value is not empty and not lower then zero and add error to aggregator if price
+ * Check price.
+ *
+ * Verify that provided price value is not empty and not lower then zero and add error to aggregator if price
* contains not valid data.
*
- * @param \Magento\Catalog\Api\Data\SpecialPriceInterface $price
+ * @param SpecialPriceInterface $price
* @param int $key
* @return void
*/
- private function checkPrice(\Magento\Catalog\Api\Data\SpecialPriceInterface $price, $key)
+ private function checkPrice(SpecialPriceInterface $price, int $key): void
{
if (null === $price->getPrice() || $price->getPrice() < 0) {
- $this->validationResult->addFailedItem(
- $key,
- __(
- 'Invalid attribute Price = %price. '
- . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.',
- [
- 'price' => $price->getPrice(),
- 'SKU' => $price->getSku(),
- 'storeId' => $price->getStoreId(),
- 'priceFrom' => $price->getPriceFrom(),
- 'priceTo' => $price->getPriceTo()
- ]
- ),
- [
- 'price' => $price->getPrice(),
- 'SKU' => $price->getSku(),
- 'storeId' => $price->getStoreId(),
- 'priceFrom' => $price->getPriceFrom(),
- 'priceTo' => $price->getPriceTo()
- ]
- );
+ $errorMessage = 'Invalid attribute Price = %price. '
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.';
+ $this->addFailedItemPrice($price, $key, $errorMessage, ['price' => $price->getPrice()]);
}
}
+ /**
+ * Adds failed item price to validation result
+ *
+ * @param SpecialPriceInterface $price
+ * @param int $key
+ * @param string $message
+ * @param array $firstParam
+ * @return void
+ */
+ private function addFailedItemPrice(
+ SpecialPriceInterface $price,
+ int $key,
+ string $message,
+ array $firstParam
+ ): void {
+ $additionalInfo = [];
+ if ($firstParam) {
+ $additionalInfo = array_merge($additionalInfo, $firstParam);
+ }
+
+ $additionalInfo['SKU'] = $price->getSku();
+ $additionalInfo['storeId'] = $price->getStoreId();
+ $additionalInfo['priceFrom'] = $price->getPriceFrom();
+ $additionalInfo['priceTo'] = $price->getPriceTo();
+
+ $this->validationResult->addFailedItem($key, __($message, $additionalInfo), $additionalInfo);
+ }
+
/**
* Retrieve SKU by product ID.
*
diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php
index 7eb19193f8bdd..448b3769c7157 100644
--- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php
+++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php
@@ -6,10 +6,18 @@
namespace Magento\Catalog\Model\ResourceModel\Product\Price;
+use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
+use Magento\Catalog\Api\SpecialPriceInterface;
+use Magento\Catalog\Model\ProductIdLocatorInterface;
+use Magento\Catalog\Model\ResourceModel\Attribute;
+use Magento\Framework\EntityManager\MetadataPool;
+use Magento\Framework\Exception\CouldNotDeleteException;
+use Magento\Framework\App\ObjectManager;
+
/**
* Special price resource.
*/
-class SpecialPrice implements \Magento\Catalog\Api\SpecialPriceInterface
+class SpecialPrice implements SpecialPriceInterface
{
/**
* Price storage table.
@@ -26,24 +34,24 @@ class SpecialPrice implements \Magento\Catalog\Api\SpecialPriceInterface
private $datetimeTable = 'catalog_product_entity_datetime';
/**
- * @var \Magento\Catalog\Model\ResourceModel\Attribute
+ * @var Attribute
*/
private $attributeResource;
/**
- * @var \Magento\Catalog\Api\ProductAttributeRepositoryInterface
+ * @var ProductAttributeRepositoryInterface
*/
private $attributeRepository;
/**
- * @var \Magento\Catalog\Model\ProductIdLocatorInterface
+ * @var ProductIdLocatorInterface
*/
private $productIdLocator;
/**
* Metadata pool.
*
- * @var \Magento\Framework\EntityManager\MetadataPool
+ * @var MetadataPool
*/
private $metadataPool;
@@ -76,16 +84,16 @@ class SpecialPrice implements \Magento\Catalog\Api\SpecialPriceInterface
private $itemsPerOperation = 500;
/**
- * @param \Magento\Catalog\Model\ResourceModel\Attribute $attributeResource
- * @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository
- * @param \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator
- * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool
+ * @param Attribute $attributeResource
+ * @param ProductAttributeRepositoryInterface $attributeRepository
+ * @param ProductIdLocatorInterface $productIdLocator
+ * @param MetadataPool $metadataPool
*/
public function __construct(
- \Magento\Catalog\Model\ResourceModel\Attribute $attributeResource,
- \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository,
- \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator,
- \Magento\Framework\EntityManager\MetadataPool $metadataPool
+ Attribute $attributeResource,
+ ProductAttributeRepositoryInterface $attributeRepository,
+ ProductIdLocatorInterface $productIdLocator,
+ MetadataPool $metadataPool
) {
$this->attributeResource = $attributeResource;
$this->attributeRepository = $attributeRepository;
@@ -94,7 +102,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function get(array $skus)
{
@@ -132,7 +140,7 @@ public function get(array $skus)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function update(array $prices)
{
@@ -187,49 +195,63 @@ public function update(array $prices)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function delete(array $prices)
{
- $skus = array_unique(
- array_map(function ($price) {
- return $price->getSku();
- }, $prices)
- );
- $ids = $this->retrieveAffectedIds($skus);
$connection = $this->attributeResource->getConnection();
- $connection->beginTransaction();
- try {
- foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) {
- $this->attributeResource->getConnection()->delete(
- $this->attributeResource->getTable($this->priceTable),
- [
- 'attribute_id = ?' => $this->getPriceAttributeId(),
- $this->getEntityLinkField() . ' IN (?)' => $idsBunch
- ]
- );
- }
- foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) {
- $this->attributeResource->getConnection()->delete(
- $this->attributeResource->getTable($this->datetimeTable),
- [
- 'attribute_id IN (?)' => [$this->getPriceFromAttributeId(), $this->getPriceToAttributeId()],
- $this->getEntityLinkField() . ' IN (?)' => $idsBunch
- ]
- );
+
+ foreach ($this->getStoreSkus($prices) as $storeId => $skus) {
+
+ $ids = $this->retrieveAffectedIds(array_unique($skus));
+ $connection->beginTransaction();
+ try {
+ foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) {
+ $connection->delete(
+ $this->attributeResource->getTable($this->priceTable),
+ [
+ 'attribute_id = ?' => $this->getPriceAttributeId(),
+ 'store_id = ?' => $storeId,
+ $this->getEntityLinkField() . ' IN (?)' => $idsBunch
+ ]
+ );
+ }
+ foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) {
+ $connection->delete(
+ $this->attributeResource->getTable($this->datetimeTable),
+ [
+ 'attribute_id IN (?)' => [$this->getPriceFromAttributeId(), $this->getPriceToAttributeId()],
+ 'store_id = ?' => $storeId,
+ $this->getEntityLinkField() . ' IN (?)' => $idsBunch
+ ]
+ );
+ }
+ $connection->commit();
+ } catch (\Exception $e) {
+ $connection->rollBack();
+ throw new CouldNotDeleteException(__('Could not delete Prices'), $e);
}
- $connection->commit();
- } catch (\Exception $e) {
- $connection->rollBack();
- throw new \Magento\Framework\Exception\CouldNotDeleteException(
- __('Could not delete Prices'),
- $e
- );
}
return true;
}
+ /**
+ * Returns associative arrays of store_id as key and array of skus as value.
+ *
+ * @param \Magento\Catalog\Api\Data\SpecialPriceInterface[] $priceItems
+ * @return array
+ */
+ private function getStoreSkus(array $priceItems): array
+ {
+ $storeSkus = [];
+ foreach ($priceItems as $priceItem) {
+ $storeSkus[$priceItem->getStoreId()][] = $priceItem->getSku();
+ }
+
+ return $storeSkus;
+ }
+
/**
* Get link field.
*
@@ -312,9 +334,9 @@ private function retrieveAffectedIds(array $skus)
$affectedIds = [];
foreach ($this->productIdLocator->retrieveProductIdsBySkus($skus) as $productIds) {
- $affectedIds = array_merge($affectedIds, array_keys($productIds));
+ $affectedIds[] = array_keys($productIds);
}
- return array_unique($affectedIds);
+ return array_unique(array_merge([], ...$affectedIds));
}
}
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByCustomDateRangeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByCustomDateRangeActionGroup.xml
new file mode 100644
index 0000000000000..30b15abb234d5
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByCustomDateRangeActionGroup.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Filters the Admin Products grid by the provided Date Filter.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml
index d70c48f2b00e3..590b9a185e5e4 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml
@@ -75,6 +75,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateWithCustomLocaleTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateWithCustomLocaleTest.xml
new file mode 100644
index 0000000000000..eae9cebd7e638
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateWithCustomLocaleTest.xml
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php b/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php
index 5e7039912999b..f74d8ca358b3f 100644
--- a/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php
+++ b/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php
@@ -34,19 +34,27 @@ class UpdateUrlKeyForProducts implements DataPatchInterface, PatchVersionInterfa
*/
private $urlProduct;
+ /**
+ * @var \Magento\Framework\EntityManager\MetadataPool
+ */
+ private $metadataPool;
+
/**
* @param ModuleDataSetupInterface $moduleDataSetup
* @param EavSetupFactory $eavSetupFactory
* @param Url $urlProduct
+ * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool
*/
public function __construct(
ModuleDataSetupInterface $moduleDataSetup,
EavSetupFactory $eavSetupFactory,
- Url $urlProduct
+ Url $urlProduct,
+ \Magento\Framework\EntityManager\MetadataPool $metadataPool
) {
$this->moduleDataSetup = $moduleDataSetup;
$this->eavSetup = $eavSetupFactory->create(['setup' => $moduleDataSetup]);
$this->urlProduct = $urlProduct;
+ $this->metadataPool = $metadataPool;
}
/**
@@ -58,7 +66,7 @@ public function apply()
$table = $this->moduleDataSetup->getTable('catalog_product_entity_varchar');
$select = $this->moduleDataSetup->getConnection()->select()->from(
$table,
- ['value_id', 'value']
+ [$this->getProductLinkField(), 'attribute_id', 'store_id', 'value_id', 'value']
)->where(
'attribute_id = ?',
$this->eavSetup->getAttributeId($productTypeId, 'url_key')
@@ -99,4 +107,17 @@ public function getAliases()
{
return [];
}
+
+ /**
+ * Return product id field name - entity_id|row_id
+ *
+ * @return string
+ * @throws \Exception
+ */
+ private function getProductLinkField()
+ {
+ return $this->metadataPool
+ ->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class)
+ ->getLinkField();
+ }
}
diff --git a/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php b/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php
index 5338a16004a00..ceb0240af1dfd 100644
--- a/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php
+++ b/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php
@@ -86,30 +86,6 @@ public function beforeSavePaymentInformationAndPlaceOrder(
}
}
- /**
- * Check validation before saving the payment information
- *
- * @param \Magento\Checkout\Api\PaymentInformationManagementInterface $subject
- * @param int $cartId
- * @param \Magento\Quote\Api\Data\PaymentInterface $paymentMethod
- * @param \Magento\Quote\Api\Data\AddressInterface|null $billingAddress
- * @return void
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- * @throws \Magento\Framework\Exception\NoSuchEntityException
- * @throws \Magento\Framework\Exception\CouldNotSaveException
- */
- public function beforeSavePaymentInformation(
- \Magento\Checkout\Api\PaymentInformationManagementInterface $subject,
- $cartId,
- \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
- \Magento\Quote\Api\Data\AddressInterface $billingAddress = null
- ) {
- $quote = $this->quoteRepository->getActive($cartId);
- if ($this->isAgreementEnabled() && !$quote->getIsMultiShipping()) {
- $this->validateAgreements($paymentMethod);
- }
- }
-
/**
* Validate agreements base on the payment method
*
diff --git a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php
index b7e5127df1f8b..6aa3d62230091 100644
--- a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php
+++ b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php
@@ -126,11 +126,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrder()
->willReturn(true);
$searchCriteriaMock = $this->createMock(SearchCriteria::class);
$this->quoteMock
- ->expects($this->once())
->method('getIsMultiShipping')
->willReturn(false);
$this->quoteRepositoryMock
- ->expects($this->once())
->method('getActive')
->with($cartId)
->willReturn($this->quoteMock);
@@ -146,7 +144,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrder()
$this->paymentMock->expects(static::atLeastOnce())
->method('getExtensionAttributes')
->willReturn($this->extensionAttributesMock);
- $this->model->beforeSavePaymentInformation(
+ $this->model->beforeSavePaymentInformationAndPlaceOrder(
$this->subjectMock,
$cartId,
$this->paymentMock,
@@ -166,11 +164,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali
->willReturn(true);
$searchCriteriaMock = $this->createMock(SearchCriteria::class);
$this->quoteMock
- ->expects($this->once())
->method('getIsMultiShipping')
->willReturn(false);
$this->quoteRepositoryMock
- ->expects($this->once())
->method('getActive')
->with($cartId)
->willReturn($this->quoteMock);
@@ -186,7 +182,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali
$this->paymentMock->expects(static::atLeastOnce())
->method('getExtensionAttributes')
->willReturn($this->extensionAttributesMock);
- $this->model->beforeSavePaymentInformation(
+ $this->model->beforeSavePaymentInformationAndPlaceOrder(
$this->subjectMock,
$cartId,
$this->paymentMock,
@@ -198,40 +194,6 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali
);
}
- public function testBeforeSavePaymentInformation()
- {
- $cartId = 100;
- $agreements = [1, 2, 3];
- $this->scopeConfigMock
- ->expects($this->once())
- ->method('isSetFlag')
- ->with(AgreementsProvider::PATH_ENABLED, ScopeInterface::SCOPE_STORE)
- ->willReturn(true);
- $this->quoteMock
- ->expects($this->once())
- ->method('getIsMultiShipping')
- ->willReturn(false);
- $this->quoteRepositoryMock
- ->expects($this->once())
- ->method('getActive')
- ->with($cartId)
- ->willReturn($this->quoteMock);
- $searchCriteriaMock = $this->createMock(SearchCriteria::class);
- $this->agreementsFilterMock->expects($this->once())
- ->method('buildSearchCriteria')
- ->willReturn($searchCriteriaMock);
- $this->checkoutAgreementsListMock->expects($this->once())
- ->method('getList')
- ->with($searchCriteriaMock)
- ->willReturn([1]);
- $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements);
- $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(true);
- $this->paymentMock->expects(static::atLeastOnce())
- ->method('getExtensionAttributes')
- ->willReturn($this->extensionAttributesMock);
- $this->model->beforeSavePaymentInformation($this->subjectMock, $cartId, $this->paymentMock, $this->addressMock);
- }
-
/**
* Build payment extension mock.
*
diff --git a/app/code/Magento/Cms/Model/Page/DataProvider.php b/app/code/Magento/Cms/Model/Page/DataProvider.php
index 41010575a1f27..6afde01cfe6c6 100644
--- a/app/code/Magento/Cms/Model/Page/DataProvider.php
+++ b/app/code/Magento/Cms/Model/Page/DataProvider.php
@@ -5,24 +5,24 @@
*/
namespace Magento\Cms\Model\Page;
-use Magento\Cms\Model\Page;
+use Magento\Cms\Api\Data\PageInterface;
+use Magento\Cms\Api\PageRepositoryInterface;
+use Magento\Cms\Model\PageFactory;
use Magento\Cms\Model\ResourceModel\Page\CollectionFactory;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\RequestInterface;
-use Magento\Ui\DataProvider\Modifier\PoolInterface;
use Magento\Framework\AuthorizationInterface;
+use Magento\Framework\Exception\LocalizedException;
+use Magento\Ui\DataProvider\Modifier\PoolInterface;
+use Magento\Ui\DataProvider\ModifierPoolDataProvider;
+use Psr\Log\LoggerInterface;
/**
- * Class DataProvider
+ * Cms Page DataProvider
*/
-class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider
+class DataProvider extends ModifierPoolDataProvider
{
- /**
- * @var \Magento\Cms\Model\ResourceModel\Page\Collection
- */
- protected $collection;
-
/**
* @var DataPersistorInterface
*/
@@ -33,6 +33,11 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider
*/
protected $loadedData;
+ /**
+ * @var PageRepositoryInterface
+ */
+ private $pageRepository;
+
/**
* @var AuthorizationInterface
*/
@@ -49,9 +54,14 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider
private $customLayoutManager;
/**
- * @var CollectionFactory
+ * @var PageFactory
+ */
+ private $pageFactory;
+
+ /**
+ * @var LoggerInterface
*/
- private $collectionFactory;
+ private $logger;
/**
* @param string $name
@@ -65,6 +75,9 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider
* @param AuthorizationInterface|null $auth
* @param RequestInterface|null $request
* @param CustomLayoutManagerInterface|null $customLayoutManager
+ * @param PageRepositoryInterface|null $pageRepository
+ * @param PageFactory|null $pageFactory
+ * @param LoggerInterface|null $logger
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -78,33 +91,22 @@ public function __construct(
PoolInterface $pool = null,
?AuthorizationInterface $auth = null,
?RequestInterface $request = null,
- ?CustomLayoutManagerInterface $customLayoutManager = null
+ ?CustomLayoutManagerInterface $customLayoutManager = null,
+ ?PageRepositoryInterface $pageRepository = null,
+ ?PageFactory $pageFactory = null,
+ ?LoggerInterface $logger = null
) {
+ parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data, $pool);
$this->collection = $pageCollectionFactory->create();
- $this->collectionFactory = $pageCollectionFactory;
$this->dataPersistor = $dataPersistor;
- parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data, $pool);
$this->auth = $auth ?? ObjectManager::getInstance()->get(AuthorizationInterface::class);
$this->meta = $this->prepareMeta($this->meta);
$this->request = $request ?? ObjectManager::getInstance()->get(RequestInterface::class);
$this->customLayoutManager = $customLayoutManager
?? ObjectManager::getInstance()->get(CustomLayoutManagerInterface::class);
- }
-
- /**
- * Find requested page.
- *
- * @return Page|null
- */
- private function findCurrentPage(): ?Page
- {
- if ($this->getRequestFieldName() && ($pageId = (int)$this->request->getParam($this->getRequestFieldName()))) {
- //Loading data for the collection.
- $this->getData();
- return $this->collection->getItemById($pageId);
- }
-
- return null;
+ $this->pageRepository = $pageRepository ?? ObjectManager::getInstance()->get(PageRepositoryInterface::class);
+ $this->pageFactory = $pageFactory ?: ObjectManager::getInstance()->get(PageFactory::class);
+ $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class);
}
/**
@@ -128,29 +130,53 @@ public function getData()
if (isset($this->loadedData)) {
return $this->loadedData;
}
- $this->collection = $this->collectionFactory->create();
- $items = $this->collection->getItems();
- /** @var $page \Magento\Cms\Model\Page */
- foreach ($items as $page) {
- $this->loadedData[$page->getId()] = $page->getData();
- if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) {
- //Deprecated layout update exists.
- $this->loadedData[$page->getId()]['layout_update_selected'] = '_existing_';
+
+ $page = $this->getCurrentPage();
+ $this->loadedData[$page->getId()] = $page->getData();
+ if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) {
+ //Deprecated layout update exists.
+ $this->loadedData[$page->getId()]['layout_update_selected'] = '_existing_';
+ }
+
+ return $this->loadedData;
+ }
+
+ /**
+ * Return current page
+ *
+ * @return PageInterface
+ */
+ private function getCurrentPage(): PageInterface
+ {
+ $pageId = $this->getPageId();
+ if ($pageId) {
+ try {
+ $page = $this->pageRepository->getById($pageId);
+ } catch (LocalizedException $exception) {
+ $page = $this->pageFactory->create();
}
+
+ return $page;
}
$data = $this->dataPersistor->get('cms_page');
- if (!empty($data)) {
- $page = $this->collection->getNewEmptyItem();
- $page->setData($data);
- $this->loadedData[$page->getId()] = $page->getData();
- if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) {
- $this->loadedData[$page->getId()]['layout_update_selected'] = '_existing_';
- }
- $this->dataPersistor->clear('cms_page');
+ if (empty($data)) {
+ return $this->pageFactory->create();
}
+ $this->dataPersistor->clear('cms_page');
- return $this->loadedData;
+ return $this->pageFactory->create()
+ ->setData($data);
+ }
+
+ /**
+ * Returns current page id from request
+ *
+ * @return int
+ */
+ private function getPageId(): int
+ {
+ return (int) $this->request->getParam($this->getRequestFieldName());
}
/**
@@ -186,16 +212,20 @@ public function getMeta()
//List of custom layout files available for current page.
$options = [['label' => 'No update', 'value' => '_no_update_']];
- if ($page = $this->findCurrentPage()) {
- //We must have a specific page selected.
- //If custom layout XML is set then displaying this special option.
+
+ $page = null;
+ try {
+ $page = $this->pageRepository->getById($this->getPageId());
if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) {
$options[] = ['label' => 'Use existing layout update XML', 'value' => '_existing_'];
}
foreach ($this->customLayoutManager->fetchAvailableFiles($page) as $layoutFile) {
$options[] = ['label' => $layoutFile, 'value' => $layoutFile];
}
+ } catch (LocalizedException $e) {
+ $this->logger->error($e->getMessage());
}
+
$customLayoutMeta = [
'design' => [
'children' => [
diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_noroute_index.xml
similarity index 100%
rename from app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml
rename to app/code/Magento/Cms/view/frontend/layout/cms_noroute_index.xml
diff --git a/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php b/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php
index 0fab27161ce25..e14594daf8011 100644
--- a/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php
+++ b/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php
@@ -7,10 +7,12 @@
use Magento\Customer\Model\ResourceModel\Customer;
use Magento\Customer\Ui\Component\DataProvider\Document;
+use Magento\Framework\App\ObjectManager;
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Magento\Framework\Locale\ResolverInterface;
+use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult;
use Psr\Log\LoggerInterface as Logger;
@@ -24,6 +26,11 @@ class Collection extends SearchResult
*/
private $localeResolver;
+ /**
+ * @var TimezoneInterface
+ */
+ private $timeZone;
+
/**
* @inheritdoc
*/
@@ -42,6 +49,7 @@ class Collection extends SearchResult
* @param ResolverInterface $localeResolver
* @param string $mainTable
* @param string $resourceModel
+ * @param TimezoneInterface|null $timeZone
*/
public function __construct(
EntityFactory $entityFactory,
@@ -50,10 +58,13 @@ public function __construct(
EventManager $eventManager,
ResolverInterface $localeResolver,
$mainTable = 'customer_grid_flat',
- $resourceModel = Customer::class
+ $resourceModel = Customer::class,
+ TimezoneInterface $timeZone = null
) {
$this->localeResolver = $localeResolver;
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
+ $this->timeZone = $timeZone ?: ObjectManager::getInstance()
+ ->get(TimezoneInterface::class);
}
/**
@@ -81,6 +92,14 @@ public function addFieldToFilter($field, $condition = null)
return $this;
}
+ if ($field === 'created_at') {
+ if (is_array($condition)) {
+ foreach ($condition as $key => $value) {
+ $condition[$key] = $this->timeZone->convertConfigTimeToUtc($value);
+ }
+ }
+ }
+
if (is_string($field) && count(explode('.', $field)) === 1) {
$field = 'main_table.' . $field;
}
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup.xml
new file mode 100644
index 0000000000000..cbe227c1809f3
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ Clicks the "Print Order" link on the My Account->My Orders->Order View page
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup.xml
new file mode 100644
index 0000000000000..232667cd9a8e5
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ Clicks the top "View Order" link on the My Account->My Orders page
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml
index 5b6c4fd23e038..dd8b576ad7bb7 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml
@@ -21,9 +21,7 @@
-
-
-
+
@@ -40,9 +38,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml
index 62dcd6fc4d894..b3d432b7776aa 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml
@@ -20,9 +20,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml
index c6e72901b062c..15eae933ccdda 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml
@@ -20,9 +20,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml
index 52c8029b8f778..55c9315f42fa9 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml
@@ -20,9 +20,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml
index 77422c6e8da3f..b975cf62765c1 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml
@@ -6,7 +6,8 @@
*/
-->
-
+
@@ -23,37 +24,41 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -61,12 +66,11 @@
-
-
-
+
+
+
-
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml
index 257d4c9b2e3c2..4ffb59dd7c658 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml
@@ -25,9 +25,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml
index bac1c665cbe78..7a9743482f81e 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml
@@ -20,9 +20,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml
index 3f95e55c56132..3fa29aef9908e 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml
@@ -20,9 +20,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml
index fb6793b1751a6..971a93f64d800 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml
@@ -20,9 +20,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml
index 6a157c6312530..34cd34425815a 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml
@@ -42,9 +42,7 @@
-
-
-
+
@@ -62,9 +60,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml
index 130e1ba6723ae..9371a51e7770f 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml
@@ -102,9 +102,7 @@
-
-
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml
index 47b61b332f571..148afb6d67c21 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml
@@ -36,7 +36,7 @@
-
+
diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml
index a909582c32b3d..16a3ad59b5494 100644
--- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml
+++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml
@@ -51,11 +51,7 @@
-
-
-
-
-
+
diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml
index 4aa4e99e79489..b4a3bb88d2e28 100644
--- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml
+++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml
@@ -30,9 +30,7 @@
-
-
-
+
diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml
index 06dde74de20f9..0e620992ad6be 100644
--- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml
+++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml
@@ -30,9 +30,7 @@
-
-
-
+
diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml
index 66e1b60331e97..79691face4911 100644
--- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml
+++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml
@@ -39,9 +39,7 @@
-
-
-
+
diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml
index 79b465abe2ac6..2d7c2aee05cb0 100644
--- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml
+++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml
@@ -30,9 +30,7 @@
-
-
-
+
diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml
index c196abbce99ed..5142558eaff66 100644
--- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml
+++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml
@@ -29,9 +29,7 @@
-
-
-
+
diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml
index 4aa460327578a..33e9838f2c443 100644
--- a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml
+++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml
@@ -12,7 +12,7 @@
-
+
{{AdminMediaGalleryGridSection.noDataMessage}}
{{AdminEnhancedMediaGalleryMassActionSection.deleteImages}}
diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml
index da9f773d0f75e..77e42b780df81 100644
--- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml
+++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml
@@ -26,5 +26,6 @@
+
diff --git a/app/code/Magento/Sales/Block/Order/Items.php b/app/code/Magento/Sales/Block/Order/Items.php
index d7255a24aead5..be3f9ce14c98d 100644
--- a/app/code/Magento/Sales/Block/Order/Items.php
+++ b/app/code/Magento/Sales/Block/Order/Items.php
@@ -9,18 +9,28 @@
*/
namespace Magento\Sales\Block\Order;
+use Magento\Framework\App\ObjectManager;
+use Magento\Framework\Registry;
+use Magento\Framework\View\Element\AbstractBlock;
+use Magento\Framework\View\Element\Template\Context;
+use Magento\Sales\Block\Items\AbstractItems;
+use Magento\Sales\Model\Order;
+use Magento\Sales\Model\ResourceModel\Order\Item\Collection;
+use Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory;
+use Magento\Theme\Block\Html\Pager;
+
/**
* Sales order view items block.
*
* @api
* @since 100.0.2
*/
-class Items extends \Magento\Sales\Block\Items\AbstractItems
+class Items extends AbstractItems
{
/**
* Core registry
*
- * @var \Magento\Framework\Registry
+ * @var Registry
*/
protected $_coreRegistry = null;
@@ -32,30 +42,30 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems
private $itemsPerPage;
/**
- * @var \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory
+ * @var CollectionFactory
*/
private $itemCollectionFactory;
/**
- * @var \Magento\Sales\Model\ResourceModel\Order\Item\Collection|null
+ * @var Collection|null
*/
private $itemCollection;
/**
- * @param \Magento\Framework\View\Element\Template\Context $context
- * @param \Magento\Framework\Registry $registry
+ * @param Context $context
+ * @param Registry $registry
* @param array $data
- * @param \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory|null $itemCollectionFactory
+ * @param CollectionFactory|null $itemCollectionFactory
*/
public function __construct(
- \Magento\Framework\View\Element\Template\Context $context,
- \Magento\Framework\Registry $registry,
+ Context $context,
+ Registry $registry,
array $data = [],
- \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory $itemCollectionFactory = null
+ CollectionFactory $itemCollectionFactory = null
) {
$this->_coreRegistry = $registry;
- $this->itemCollectionFactory = $itemCollectionFactory ?: \Magento\Framework\App\ObjectManager::getInstance()
- ->get(\Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory::class);
+ $this->itemCollectionFactory = $itemCollectionFactory ?: ObjectManager::getInstance()
+ ->get(CollectionFactory::class);
parent::__construct($context, $data);
}
@@ -68,18 +78,12 @@ public function __construct(
protected function _prepareLayout()
{
$this->itemsPerPage = $this->_scopeConfig->getValue('sales/orders/items_per_page');
+ $this->itemCollection = $this->createItemsCollection();
- $this->itemCollection = $this->itemCollectionFactory->create();
- $this->itemCollection->setOrderFilter($this->getOrder());
-
- /** @var \Magento\Theme\Block\Html\Pager $pagerBlock */
+ /** @var Pager $pagerBlock */
$pagerBlock = $this->getChildBlock('sales_order_item_pager');
if ($pagerBlock) {
- $pagerBlock->setLimit($this->itemsPerPage);
- //here pager updates collection parameters
- $pagerBlock->setCollection($this->itemCollection);
- $pagerBlock->setAvailableLimit([$this->itemsPerPage]);
- $pagerBlock->setShowAmounts($this->isPagerDisplayed());
+ $this->preparePager($pagerBlock);
}
return parent::_prepareLayout();
@@ -122,7 +126,7 @@ public function getItems()
*/
public function getPagerHtml()
{
- /** @var \Magento\Theme\Block\Html\Pager $pagerBlock */
+ /** @var Pager $pagerBlock */
$pagerBlock = $this->getChildBlock('sales_order_item_pager');
return $pagerBlock ? $pagerBlock->toHtml() : '';
}
@@ -130,10 +134,39 @@ public function getPagerHtml()
/**
* Retrieve current order model instance
*
- * @return \Magento\Sales\Model\Order
+ * @return Order
*/
public function getOrder()
{
return $this->_coreRegistry->registry('current_order');
}
+
+ /**
+ * Prepare pager block
+ *
+ * @param AbstractBlock $pagerBlock
+ */
+ private function preparePager(AbstractBlock $pagerBlock): void
+ {
+ $collectionToPager = $this->createItemsCollection();
+ $collectionToPager->addFieldToFilter('parent_item_id', ['null' => true]);
+ $pagerBlock->setCollection($collectionToPager);
+
+ $pagerBlock->setLimit($this->itemsPerPage);
+ $pagerBlock->setAvailableLimit([$this->itemsPerPage]);
+ $pagerBlock->setShowAmounts($this->isPagerDisplayed());
+ }
+
+ /**
+ * Create items collection
+ *
+ * @return Collection
+ */
+ private function createItemsCollection(): Collection
+ {
+ $collection = $this->itemCollectionFactory->create();
+ $collection->setOrderFilter($this->getOrder());
+
+ return $collection;
+ }
}
diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup.xml
new file mode 100644
index 0000000000000..fe24996ba2834
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ Click create new status button
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminCreateOrderFormShippingAddressActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminCreateOrderFormShippingAddressActionGroup.xml
new file mode 100644
index 0000000000000..32cedca015c97
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminCreateOrderFormShippingAddressActionGroup.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+ Verify shipping address inputs on admin create order page. Start on admin create new order page.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml
index 7d6e2048c9432..9c99b3140bc0c 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml
@@ -94,9 +94,7 @@
-
-
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml
index 9f09a59fa8d5e..9680cbd1e289a 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml
@@ -35,9 +35,7 @@
10.00
-
-
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml
index 33bc1a39ca11a..fa11b567fee95 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml
@@ -57,10 +57,7 @@
-
-
-
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml
index 5c61a8b089b97..f3ce8106c2730 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml
@@ -27,7 +27,7 @@
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml
index 84bda226c9512..f8e7be5fdb5b6 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml
@@ -27,7 +27,7 @@
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml
index f4ad885429189..c5fc6170d2782 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml
@@ -27,7 +27,7 @@
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndProcessingTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndProcessingTest.xml
new file mode 100644
index 0000000000000..2671cd6989c51
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndProcessingTest.xml
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml
index 6eb4195524224..3400e07373f54 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml
@@ -8,15 +8,18 @@
-
+
-
+
+
+ Use AdminMassOrdersCancelClosedAndProcessingTest instead
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml
index 41964cbf605da..592c8b7981bed 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml
@@ -21,7 +21,6 @@
-
@@ -29,43 +28,49 @@
-
-
-
-
-
-
-
-
- $getOrderId
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
-
-
+
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml
index 163da4917b50a..e8b842a48890e 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml
@@ -20,7 +20,6 @@
-
@@ -28,40 +27,43 @@
-
-
-
-
-
-
-
-
- $getOrderId
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
-
-
+
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml
index 4799984b76745..f24ac5c587913 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml
@@ -29,9 +29,7 @@
-
-
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml
index 0224bca9d96ac..814be5ccd86bf 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml
@@ -26,7 +26,7 @@
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml
index 861a5a5bf42df..ac17d41c43c3d 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml
@@ -49,7 +49,7 @@
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml
index 08d5776b79ea0..32668bc5c857d 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml
@@ -75,9 +75,7 @@
-
-
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml
index 452d65ea5ae57..850dd9e1b5795 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml
@@ -57,9 +57,7 @@
-
-
-
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml
index 6b6b0b2ef4a16..8e41247a37b54 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml
@@ -89,10 +89,7 @@
-
-
-
-
+
diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml
index 638ac7e66f769..79bc1e3a8df36 100644
--- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml
+++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml
@@ -142,9 +142,10 @@ endif; ?>
order.bindAddressFields('{$block->escapeJs($_addressChoiceContainerId)}');
script;
- if ($block->getIsShipping() && $block->getIsAsBilling()):
- $scriptString .= <<