Skip to content

Commit a5c79f9

Browse files
merge magento/2.3-develop into magento-epam/EPAM-PR-42
2 parents e6ec147 + ef58edb commit a5c79f9

File tree

22 files changed

+799
-360
lines changed

22 files changed

+799
-360
lines changed

app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace Magento\Backend\Block\System\Design\Edit\Tab;
88

9+
/**
10+
* General system tab block.
11+
*/
912
class General extends \Magento\Backend\Block\Widget\Form\Generic
1013
{
1114
/**
@@ -90,7 +93,7 @@ protected function _prepareForm()
9093
]
9194
);
9295

93-
$dateFormat = $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT);
96+
$dateFormat = $this->_localeDate->getDateFormatWithLongYear();
9497
$fieldset->addField(
9598
'date_from',
9699
'date',

app/code/Magento/Catalog/Block/Product/View/Attributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getAdditionalData(array $excludeAttr = [])
9494

9595
if (is_string($value) && strlen(trim($value))) {
9696
$data[$attribute->getAttributeCode()] = [
97-
'label' => __($attribute->getStoreLabel()),
97+
'label' => $attribute->getStoreLabel(),
9898
'value' => $value,
9999
'code' => $attribute->getAttributeCode(),
100100
];

app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Catalog\Controller\Adminhtml\Product;
79

10+
use Magento\Catalog\Api\Data\ProductInterface;
811
use Magento\Catalog\Model\ProductFactory;
912
use Magento\Cms\Model\Wysiwyg as WysiwygModel;
1013
use Magento\Framework\App\RequestInterface;
@@ -15,6 +18,11 @@
1518
use Magento\Catalog\Model\Product;
1619
use Magento\Catalog\Model\Product\Type as ProductTypes;
1720

21+
/**
22+
* Build a product based on a request
23+
*
24+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
25+
*/
1826
class Builder
1927
{
2028
/**
@@ -79,10 +87,11 @@ public function __construct(
7987
* Build product based on user request
8088
*
8189
* @param RequestInterface $request
82-
* @return \Magento\Catalog\Model\Product
90+
* @return ProductInterface
8391
* @throws \RuntimeException
92+
* @throws \Magento\Framework\Exception\LocalizedException
8493
*/
85-
public function build(RequestInterface $request)
94+
public function build(RequestInterface $request): ProductInterface
8695
{
8796
$productId = (int) $request->getParam('id');
8897
$storeId = $request->getParam('store', 0);
@@ -92,6 +101,9 @@ public function build(RequestInterface $request)
92101
if ($productId) {
93102
try {
94103
$product = $this->productRepository->getById($productId, true, $storeId);
104+
if ($attributeSetId) {
105+
$product->setAttributeSetId($attributeSetId);
106+
}
95107
} catch (\Exception $e) {
96108
$product = $this->createEmptyProduct(ProductTypes::DEFAULT_TYPE, $attributeSetId, $storeId);
97109
$this->logger->critical($e);
@@ -113,6 +125,8 @@ public function build(RequestInterface $request)
113125
}
114126

115127
/**
128+
* Create a product with the given properties
129+
*
116130
* @param int $typeId
117131
* @param int $attributeSetId
118132
* @param int $storeId

0 commit comments

Comments
 (0)