Skip to content

Commit 1f9bf2b

Browse files
Merge branch 2.3-develop into ENGCOM-3810-magento-magento2-20001
2 parents fb80748 + 75cf826 commit 1f9bf2b

File tree

161 files changed

+4813
-1005
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+4813
-1005
lines changed

app/code/Magento/Backend/App/Request/BackendValidator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ private function createException(
146146
$exception = new InvalidRequestException($response);
147147
} else {
148148
//For regular requests.
149+
$startPageUrl = $this->backendUrl->getStartupPageUrl();
149150
$response = $this->redirectFactory->create()
150-
->setUrl($this->backendUrl->getStartupPageUrl());
151+
->setUrl($this->backendUrl->getUrl($startPageUrl));
151152
$exception = new InvalidRequestException(
152153
$response,
153154
[

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/ListProduct.php

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ private function getDefaultListingMode()
178178
}
179179

180180
/**
181-
* Need use as _prepareLayout - but problem in declaring collection from
182-
* another block (was problem with search result)
181+
* Need use as _prepareLayout - but problem in declaring collection from another block.
182+
* (was problem with search result)
183+
*
183184
* @return $this
184185
*/
185186
protected function _beforeToHtml()
@@ -188,7 +189,9 @@ protected function _beforeToHtml()
188189

189190
$this->addToolbarBlock($collection);
190191

191-
$collection->load();
192+
if (!$collection->isLoaded()) {
193+
$collection->load();
194+
}
192195

193196
return parent::_beforeToHtml();
194197
}
@@ -262,6 +265,8 @@ public function getToolbarHtml()
262265
}
263266

264267
/**
268+
* Set collection.
269+
*
265270
* @param AbstractCollection $collection
266271
* @return $this
267272
*/
@@ -272,7 +277,9 @@ public function setCollection($collection)
272277
}
273278

274279
/**
275-
* @param array|string|integer| Element $code
280+
* Add attribute.
281+
*
282+
* @param array|string|integer|Element $code
276283
* @return $this
277284
*/
278285
public function addAttribute($code)
@@ -282,6 +289,8 @@ public function addAttribute($code)
282289
}
283290

284291
/**
292+
* Get price block template.
293+
*
285294
* @return mixed
286295
*/
287296
public function getPriceBlockTemplate()
@@ -371,6 +380,8 @@ public function getAddToCartPostParams(Product $product)
371380
}
372381

373382
/**
383+
* Get product price.
384+
*
374385
* @param Product $product
375386
* @return string
376387
*/
@@ -396,8 +407,8 @@ public function getProductPrice(Product $product)
396407
}
397408

398409
/**
399-
* Specifies that price rendering should be done for the list of products
400-
* i.e. rendering happens in the scope of product list, but not single product
410+
* Specifies that price rendering should be done for the list of products.
411+
* (rendering happens in the scope of product list, but not single product)
401412
*
402413
* @return Render
403414
*/

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)