Skip to content

Commit 37f6f6a

Browse files
MC-18527: Merge release branch into 2.3-develop
- fix merge conflicts and update lock file
1 parent 546f576 commit 37f6f6a

File tree

10 files changed

+63
-37
lines changed

10 files changed

+63
-37
lines changed

app/code/Magento/Catalog/Model/Product.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
177177
protected $_catalogProduct = null;
178178

179179
/**
180-
* @var \Magento\Framework\Module\ModuleManagerInterface
180+
* @var \Magento\Framework\Module\Manager
181181
*/
182182
protected $moduleManager;
183183

@@ -381,7 +381,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
381381
* @param Product\Attribute\Source\Status $catalogProductStatus
382382
* @param Product\Media\Config $catalogProductMediaConfig
383383
* @param Product\Type $catalogProductType
384-
* @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager
384+
* @param \Magento\Framework\Module\Manager $moduleManager
385385
* @param \Magento\Catalog\Helper\Product $catalogProduct
386386
* @param ResourceModel\Product $resource
387387
* @param ResourceModel\Product\Collection $resourceCollection
@@ -422,7 +422,7 @@ public function __construct(
422422
\Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus,
423423
\Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig,
424424
Product\Type $catalogProductType,
425-
\Magento\Framework\Module\ModuleManagerInterface $moduleManager,
425+
\Magento\Framework\Module\Manager $moduleManager,
426426
\Magento\Catalog\Helper\Product $catalogProduct,
427427
\Magento\Catalog\Model\ResourceModel\Product $resource,
428428
\Magento\Catalog\Model\ResourceModel\Product\Collection $resourceCollection,

app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@
2424
<page name="AdminConfigDeveloperPage" url="admin/system_config/edit/section/dev/" area="admin" module="Magento_Config">
2525
<section name="AdminConfigSection" />
2626
</page>
27+
<page name="AdminConfigAdvancedAdmin" url="admin/system_config/edit/section/admin/" area="admin" module="Magento_Config">
28+
<section name="AdvanceAdminSection"/>
29+
</page>
2730
</pages>

app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ public function getConfigurableAttributesData()
215215
'code' => $attribute['code'],
216216
'label' => $attribute['label'],
217217
'position' => $attribute['position'],
218+
'__disableTmpl' => true
218219
];
219220

220221
foreach ($attribute['chosen'] as $chosenOption) {
@@ -234,7 +235,7 @@ public function getConfigurableAttributesData()
234235
* @return void
235236
* @throws \Zend_Currency_Exception
236237
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
237-
* phpcs:disable Generic.Metrics.NestingLevel
238+
* phpcs:disable Generic.Metrics.NestingLevel.TooHigh
238239
*/
239240
protected function prepareVariations()
240241
{
@@ -265,6 +266,7 @@ protected function prepareVariations()
265266
'id' => $attribute->getAttributeId(),
266267
'position' => $configurableAttributes[$attribute->getAttributeId()]['position'],
267268
'chosen' => [],
269+
'__disableTmpl' => true
268270
];
269271
$options = $attribute->usesSource() ? $attribute->getSource()->getAllOptions() : [];
270272
foreach ($options as $option) {
@@ -275,6 +277,7 @@ protected function prepareVariations()
275277
'id' => $option['value'],
276278
'label' => $option['label'],
277279
'value' => $option['value'],
280+
'__disableTmpl' => true
278281
];
279282
}
280283
}
@@ -286,6 +289,7 @@ protected function prepareVariations()
286289
'id' => $optionId,
287290
'label' => $variation[$attribute->getId()]['label'],
288291
'value' => $optionId,
292+
'__disableTmpl' => true
289293
];
290294
$variationOptions[] = $variationOption;
291295
$attributes[$attribute->getAttributeId()]['chosen'][$optionId] = $variationOption;
@@ -311,6 +315,7 @@ protected function prepareVariations()
311315
'newProduct' => 0,
312316
'attributes' => $this->getTextAttributes($variationOptions),
313317
'thumbnail_image' => $this->imageHelper->init($product, 'product_thumbnail_image')->getUrl(),
318+
'__disableTmpl' => true
314319
];
315320
$productIds[] = $product->getId();
316321
}
@@ -321,6 +326,7 @@ protected function prepareVariations()
321326
$this->productIds = $productIds;
322327
$this->productAttributes = array_values($attributes);
323328
}
329+
//phpcs: enable
324330

325331
/**
326332
* Get JSON string that contains attribute code and value

app/code/Magento/Customer/Model/Customer.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Magento\Framework\Reflection\DataObjectProcessor;
2121
use Magento\Store\Model\ScopeInterface;
2222
use Magento\Framework\App\ObjectManager;
23+
use Magento\Framework\Math\Random;
2324

2425
/**
2526
* Customer model
@@ -180,7 +181,7 @@ class Customer extends \Magento\Framework\Model\AbstractModel
180181
protected $_encryptor;
181182

182183
/**
183-
* @var \Magento\Framework\Math\Random
184+
* @var Random
184185
*/
185186
protected $mathRandom;
186187

@@ -248,6 +249,7 @@ class Customer extends \Magento\Framework\Model\AbstractModel
248249
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
249250
* @param array $data
250251
* @param AccountConfirmation|null $accountConfirmation
252+
* @param Random|null $mathRandom
251253
*
252254
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
253255
*/
@@ -272,7 +274,8 @@ public function __construct(
272274
\Magento\Framework\Indexer\IndexerRegistry $indexerRegistry,
273275
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
274276
array $data = [],
275-
AccountConfirmation $accountConfirmation = null
277+
AccountConfirmation $accountConfirmation = null,
278+
Random $mathRandom = null
276279
) {
277280
$this->metadataService = $metadataService;
278281
$this->_scopeConfig = $scopeConfig;
@@ -291,6 +294,7 @@ public function __construct(
291294
$this->indexerRegistry = $indexerRegistry;
292295
$this->accountConfirmation = $accountConfirmation ?: ObjectManager::getInstance()
293296
->get(AccountConfirmation::class);
297+
$this->mathRandom = $mathRandom ?: ObjectManager::getInstance()->get(Random::class);
294298
parent::__construct(
295299
$context,
296300
$registry,
@@ -815,8 +819,7 @@ public function isConfirmationRequired()
815819
*/
816820
public function getRandomConfirmationKey()
817821
{
818-
// phpcs:ignore Magento2.Security.InsecureFunction
819-
return md5(uniqid());
822+
return $this->mathRandom->getRandomString(32);
820823
}
821824

822825
/**

app/code/Magento/Customer/Model/Session.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,9 @@ public function setCustomerGroupId($id)
370370
}
371371

372372
/**
373-
* Get customer group id. If customer is not logged in system, 'not logged in' group id will be returned.
373+
* Get customer group id.
374+
*
375+
* If customer is not logged in system, 'not logged in' group id will be returned.
374376
*
375377
* @return int
376378
* @throws \Magento\Framework\Exception\LocalizedException
@@ -431,10 +433,10 @@ public function checkCustomerId($customerId)
431433
*/
432434
public function setCustomerAsLoggedIn($customer)
433435
{
436+
$this->regenerateId();
434437
$this->setCustomer($customer);
435438
$this->_eventManager->dispatch('customer_login', ['customer' => $customer]);
436439
$this->_eventManager->dispatch('customer_data_object_login', ['customer' => $this->getCustomerDataObject()]);
437-
$this->regenerateId();
438440
return $this;
439441
}
440442

@@ -446,6 +448,7 @@ public function setCustomerAsLoggedIn($customer)
446448
*/
447449
public function setCustomerDataAsLoggedIn($customer)
448450
{
451+
$this->regenerateId();
449452
$this->_httpContext->setValue(Context::CONTEXT_AUTH, true, false);
450453
$this->setCustomerData($customer);
451454

app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
<group value="Downloadable"/>
2020
</annotations>
2121
<before>
22+
<magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add static.magento.com"/>
2223
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2324
</before>
2425
<after>
2526
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
2627
<argument name="product" value="DownloadableProduct"/>
2728
</actionGroup>
29+
<magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/>
2830
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
2931
</after>
3032

app/code/Magento/Store/Model/System/Store.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ public function getStoreValuesForForm($empty = false, $all = false)
152152
}
153153
}
154154
}
155+
array_walk(
156+
$options,
157+
function (&$item) {
158+
$item['__disableTmpl'] = true;
159+
}
160+
);
155161
return $options;
156162
}
157163

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
},
101101
"replace": {
102102
"magento/module-marketplace": "*",
103+
"magento/module-admin-analytics": "*",
103104
"magento/module-admin-notification": "*",
104105
"magento/module-advanced-pricing-import-export": "*",
105106
"magento/module-amqp": "*",

composer.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/internal/Magento/Framework/App/ProductMetadata.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class ProductMetadata implements ProductMetadataInterface
3030
const PRODUCT_NAME = 'Magento';
3131

3232
/**
33-
* Cache key for Magento product version
33+
* Magento version cache key
3434
*/
35-
private const MAGENTO_PRODUCT_VERSION_CACHE_KEY = 'magento-product-version';
35+
const VERSION_CACHE_KEY = 'mage-version';
3636

3737
/**
3838
* Product version
@@ -58,13 +58,16 @@ class ProductMetadata implements ProductMetadataInterface
5858
private $cache;
5959

6060
/**
61+
* ProductMetadata constructor.
6162
* @param ComposerJsonFinder $composerJsonFinder
62-
* @param CacheInterface|null $cache
63+
* @param \Magento\Framework\App\CacheInterface $cache
6364
*/
64-
public function __construct(ComposerJsonFinder $composerJsonFinder, CacheInterface $cache = null)
65-
{
65+
public function __construct(
66+
ComposerJsonFinder $composerJsonFinder,
67+
CacheInterface $cache = null
68+
) {
6669
$this->composerJsonFinder = $composerJsonFinder;
67-
$this->cache = $cache ?: ObjectManager::getInstance()->get(CacheInterface::class);
70+
$this->cache = $cache ?? ObjectManager::getInstance()->get(CacheInterface::class);
6871
}
6972

7073
/**
@@ -74,18 +77,17 @@ public function __construct(ComposerJsonFinder $composerJsonFinder, CacheInterfa
7477
*/
7578
public function getVersion()
7679
{
77-
if ($cachedVersion = $this->cache->load(self::MAGENTO_PRODUCT_VERSION_CACHE_KEY)) {
78-
$this->version = $cachedVersion;
79-
}
80+
$versionFromCache = $this->cache->load(self::VERSION_CACHE_KEY);
81+
$this->version = $this->version ?: $versionFromCache;
8082
if (!$this->version) {
8183
if (!($this->version = $this->getSystemPackageVersion())) {
8284
if ($this->getComposerInformation()->isMagentoRoot()) {
8385
$this->version = $this->getComposerInformation()->getRootPackage()->getPrettyVersion();
8486
} else {
8587
$this->version = 'UNKNOWN';
8688
}
89+
$this->cache->save($this->version, self::VERSION_CACHE_KEY, [Config::CACHE_TAG]);
8790
}
88-
$this->cache->save($this->version, self::MAGENTO_PRODUCT_VERSION_CACHE_KEY);
8991
}
9092
return $this->version;
9193
}

0 commit comments

Comments
 (0)