Skip to content

Commit

Permalink
MC-18527: Merge release branch into 2.3-develop
Browse files Browse the repository at this point in the history
- fix merge conflicts and update lock file
  • Loading branch information
krissyhiserote committed Oct 9, 2019
1 parent 546f576 commit 37f6f6a
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 37 deletions.
6 changes: 3 additions & 3 deletions app/code/Magento/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
protected $_catalogProduct = null;

/**
* @var \Magento\Framework\Module\ModuleManagerInterface
* @var \Magento\Framework\Module\Manager
*/
protected $moduleManager;

Expand Down Expand Up @@ -381,7 +381,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
* @param Product\Attribute\Source\Status $catalogProductStatus
* @param Product\Media\Config $catalogProductMediaConfig
* @param Product\Type $catalogProductType
* @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager
* @param \Magento\Framework\Module\Manager $moduleManager
* @param \Magento\Catalog\Helper\Product $catalogProduct
* @param ResourceModel\Product $resource
* @param ResourceModel\Product\Collection $resourceCollection
Expand Down Expand Up @@ -422,7 +422,7 @@ public function __construct(
\Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus,
\Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig,
Product\Type $catalogProductType,
\Magento\Framework\Module\ModuleManagerInterface $moduleManager,
\Magento\Framework\Module\Manager $moduleManager,
\Magento\Catalog\Helper\Product $catalogProduct,
\Magento\Catalog\Model\ResourceModel\Product $resource,
\Magento\Catalog\Model\ResourceModel\Product\Collection $resourceCollection,
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
<page name="AdminConfigDeveloperPage" url="admin/system_config/edit/section/dev/" area="admin" module="Magento_Config">
<section name="AdminConfigSection" />
</page>
<page name="AdminConfigAdvancedAdmin" url="admin/system_config/edit/section/admin/" area="admin" module="Magento_Config">
<section name="AdvanceAdminSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public function getConfigurableAttributesData()
'code' => $attribute['code'],
'label' => $attribute['label'],
'position' => $attribute['position'],
'__disableTmpl' => true
];

foreach ($attribute['chosen'] as $chosenOption) {
Expand All @@ -234,7 +235,7 @@ public function getConfigurableAttributesData()
* @return void
* @throws \Zend_Currency_Exception
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* phpcs:disable Generic.Metrics.NestingLevel
* phpcs:disable Generic.Metrics.NestingLevel.TooHigh
*/
protected function prepareVariations()
{
Expand Down Expand Up @@ -265,6 +266,7 @@ protected function prepareVariations()
'id' => $attribute->getAttributeId(),
'position' => $configurableAttributes[$attribute->getAttributeId()]['position'],
'chosen' => [],
'__disableTmpl' => true
];
$options = $attribute->usesSource() ? $attribute->getSource()->getAllOptions() : [];
foreach ($options as $option) {
Expand All @@ -275,6 +277,7 @@ protected function prepareVariations()
'id' => $option['value'],
'label' => $option['label'],
'value' => $option['value'],
'__disableTmpl' => true
];
}
}
Expand All @@ -286,6 +289,7 @@ protected function prepareVariations()
'id' => $optionId,
'label' => $variation[$attribute->getId()]['label'],
'value' => $optionId,
'__disableTmpl' => true
];
$variationOptions[] = $variationOption;
$attributes[$attribute->getAttributeId()]['chosen'][$optionId] = $variationOption;
Expand All @@ -311,6 +315,7 @@ protected function prepareVariations()
'newProduct' => 0,
'attributes' => $this->getTextAttributes($variationOptions),
'thumbnail_image' => $this->imageHelper->init($product, 'product_thumbnail_image')->getUrl(),
'__disableTmpl' => true
];
$productIds[] = $product->getId();
}
Expand All @@ -321,6 +326,7 @@ protected function prepareVariations()
$this->productIds = $productIds;
$this->productAttributes = array_values($attributes);
}
//phpcs: enable

/**
* Get JSON string that contains attribute code and value
Expand Down
11 changes: 7 additions & 4 deletions app/code/Magento/Customer/Model/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Magento\Framework\Reflection\DataObjectProcessor;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Math\Random;

/**
* Customer model
Expand Down Expand Up @@ -180,7 +181,7 @@ class Customer extends \Magento\Framework\Model\AbstractModel
protected $_encryptor;

/**
* @var \Magento\Framework\Math\Random
* @var Random
*/
protected $mathRandom;

Expand Down Expand Up @@ -248,6 +249,7 @@ class Customer extends \Magento\Framework\Model\AbstractModel
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
* @param array $data
* @param AccountConfirmation|null $accountConfirmation
* @param Random|null $mathRandom
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
Expand All @@ -272,7 +274,8 @@ public function __construct(
\Magento\Framework\Indexer\IndexerRegistry $indexerRegistry,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = [],
AccountConfirmation $accountConfirmation = null
AccountConfirmation $accountConfirmation = null,
Random $mathRandom = null
) {
$this->metadataService = $metadataService;
$this->_scopeConfig = $scopeConfig;
Expand All @@ -291,6 +294,7 @@ public function __construct(
$this->indexerRegistry = $indexerRegistry;
$this->accountConfirmation = $accountConfirmation ?: ObjectManager::getInstance()
->get(AccountConfirmation::class);
$this->mathRandom = $mathRandom ?: ObjectManager::getInstance()->get(Random::class);
parent::__construct(
$context,
$registry,
Expand Down Expand Up @@ -815,8 +819,7 @@ public function isConfirmationRequired()
*/
public function getRandomConfirmationKey()
{
// phpcs:ignore Magento2.Security.InsecureFunction
return md5(uniqid());
return $this->mathRandom->getRandomString(32);
}

/**
Expand Down
7 changes: 5 additions & 2 deletions app/code/Magento/Customer/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ public function setCustomerGroupId($id)
}

/**
* Get customer group id. If customer is not logged in system, 'not logged in' group id will be returned.
* Get customer group id.
*
* If customer is not logged in system, 'not logged in' group id will be returned.
*
* @return int
* @throws \Magento\Framework\Exception\LocalizedException
Expand Down Expand Up @@ -431,10 +433,10 @@ public function checkCustomerId($customerId)
*/
public function setCustomerAsLoggedIn($customer)
{
$this->regenerateId();
$this->setCustomer($customer);
$this->_eventManager->dispatch('customer_login', ['customer' => $customer]);
$this->_eventManager->dispatch('customer_data_object_login', ['customer' => $this->getCustomerDataObject()]);
$this->regenerateId();
return $this;
}

Expand All @@ -446,6 +448,7 @@ public function setCustomerAsLoggedIn($customer)
*/
public function setCustomerDataAsLoggedIn($customer)
{
$this->regenerateId();
$this->_httpContext->setValue(Context::CONTEXT_AUTH, true, false);
$this->setCustomerData($customer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
<group value="Downloadable"/>
</annotations>
<before>
<magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add static.magento.com"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
<argument name="product" value="DownloadableProduct"/>
</actionGroup>
<magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
</after>

Expand Down
6 changes: 6 additions & 0 deletions app/code/Magento/Store/Model/System/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ public function getStoreValuesForForm($empty = false, $all = false)
}
}
}
array_walk(
$options,
function (&$item) {
$item['__disableTmpl'] = true;
}
);
return $options;
}

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
},
"replace": {
"magento/module-marketplace": "*",
"magento/module-admin-analytics": "*",
"magento/module-admin-notification": "*",
"magento/module-advanced-pricing-import-export": "*",
"magento/module-amqp": "*",
Expand Down
34 changes: 17 additions & 17 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions lib/internal/Magento/Framework/App/ProductMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class ProductMetadata implements ProductMetadataInterface
const PRODUCT_NAME = 'Magento';

/**
* Cache key for Magento product version
* Magento version cache key
*/
private const MAGENTO_PRODUCT_VERSION_CACHE_KEY = 'magento-product-version';
const VERSION_CACHE_KEY = 'mage-version';

/**
* Product version
Expand All @@ -58,13 +58,16 @@ class ProductMetadata implements ProductMetadataInterface
private $cache;

/**
* ProductMetadata constructor.
* @param ComposerJsonFinder $composerJsonFinder
* @param CacheInterface|null $cache
* @param \Magento\Framework\App\CacheInterface $cache
*/
public function __construct(ComposerJsonFinder $composerJsonFinder, CacheInterface $cache = null)
{
public function __construct(
ComposerJsonFinder $composerJsonFinder,
CacheInterface $cache = null
) {
$this->composerJsonFinder = $composerJsonFinder;
$this->cache = $cache ?: ObjectManager::getInstance()->get(CacheInterface::class);
$this->cache = $cache ?? ObjectManager::getInstance()->get(CacheInterface::class);
}

/**
Expand All @@ -74,18 +77,17 @@ public function __construct(ComposerJsonFinder $composerJsonFinder, CacheInterfa
*/
public function getVersion()
{
if ($cachedVersion = $this->cache->load(self::MAGENTO_PRODUCT_VERSION_CACHE_KEY)) {
$this->version = $cachedVersion;
}
$versionFromCache = $this->cache->load(self::VERSION_CACHE_KEY);
$this->version = $this->version ?: $versionFromCache;

This comment has been minimized.

Copy link
@beberlei

beberlei Dec 11, 2019

@krissyhiserote this merge conflict is resolved wrong. See #26001

if (!$this->version) {
if (!($this->version = $this->getSystemPackageVersion())) {
if ($this->getComposerInformation()->isMagentoRoot()) {
$this->version = $this->getComposerInformation()->getRootPackage()->getPrettyVersion();
} else {
$this->version = 'UNKNOWN';
}
$this->cache->save($this->version, self::VERSION_CACHE_KEY, [Config::CACHE_TAG]);
}
$this->cache->save($this->version, self::MAGENTO_PRODUCT_VERSION_CACHE_KEY);
}
return $this->version;
}
Expand Down

0 comments on commit 37f6f6a

Please sign in to comment.