Skip to content

Commit 46fb116

Browse files
committed
Merge remote-tracking branch 'origin/MC-33069-CE-3' into MC-33069
2 parents 5afac73 + f18a9af commit 46fb116

File tree

8 files changed

+18
-13
lines changed

8 files changed

+18
-13
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ private function prepareDefaultAddress($address): array
165165
if (isset($addressData['street']) && !\is_array($address['street'])) {
166166
$addressData['street'] = explode("\n", $addressData['street']);
167167
}
168-
$addressData['country'] = $this->countryFactory->create()
169-
->loadByCode($addressData['country_id'])->getName();
168+
$countryId = $addressData['country_id'] ?? null;
169+
$addressData['country'] = $this->countryFactory->create()->loadByCode($countryId)->getName();
170170
}
171171

172172
return $addressData;

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ public function getLinkField()
766766
if (!$this->linkIdField) {
767767
$indexList = $this->getConnection()->getIndexList($this->getEntityTable());
768768
$pkName = $this->getConnection()->getPrimaryKeyName($this->getEntityTable());
769-
$this->linkIdField = $indexList[$pkName]['COLUMNS_LIST'][0];
769+
$this->linkIdField = $indexList[$pkName]['COLUMNS_LIST'][0] ?? null;
770770
if (!$this->linkIdField) {
771771
$this->linkIdField = $this->getEntityIdField();
772772
}

app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8383

8484
$startTime = microtime(true);
8585
$indexerConfig = $this->getConfig()->getIndexer($indexer->getId());
86-
$sharedIndex = $indexerConfig['shared_index'];
86+
$sharedIndex = $indexerConfig['shared_index'] ?? null;
8787

8888
// Skip indexers having shared index that was already complete
8989
if (!in_array($sharedIndex, $this->sharedIndexesComplete)) {

app/code/Magento/Indexer/Model/Processor.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,17 @@ public function reindexAllInvalid()
6565
$indexerConfig = $this->config->getIndexer($indexerId);
6666
if ($indexer->isInvalid()) {
6767
// Skip indexers having shared index that was already complete
68-
if (!in_array($indexerConfig['shared_index'], $sharedIndexesComplete)) {
68+
$sharedIndex = $indexerConfig['shared_index'] ?? null;
69+
if (!in_array($sharedIndex, $sharedIndexesComplete)) {
6970
$indexer->reindexAll();
7071
} else {
7172
/** @var \Magento\Indexer\Model\Indexer\State $state */
7273
$state = $indexer->getState();
7374
$state->setStatus(StateInterface::STATUS_VALID);
7475
$state->save();
7576
}
76-
if ($indexerConfig['shared_index']) {
77-
$sharedIndexesComplete[] = $indexerConfig['shared_index'];
77+
if ($sharedIndex) {
78+
$sharedIndexesComplete[] = $sharedIndex;
7879
}
7980
}
8081
}

app/code/Magento/VaultGraphQl/Model/Resolver/DeletePaymentToken.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function resolve(
5858
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
5959
}
6060

61+
$args['public_hash'] = $args['public_hash'] ?? '';
6162
$token = $this->paymentTokenManagement->getByPublicHash($args['public_hash'], $context->getUserId());
6263
if (!$token) {
6364
throw new GraphQlNoSuchEntityException(

lib/internal/Magento/Framework/App/Route/Config.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function _getRoutes($scope = null)
9090
}
9191

9292
$routers = $this->_reader->read($scope);
93-
$routes = $routers[$this->_areaList->getDefaultRouter($scope)]['routes'];
93+
$routes = $routers[$this->_areaList->getDefaultRouter($scope)]['routes'] ?? null;
9494
$routesData = $this->getSerializer()->serialize($routes);
9595
$this->_cache->save($routesData, $cacheId);
9696
$this->_routes[$scope] = $routes;
@@ -101,7 +101,7 @@ protected function _getRoutes($scope = null)
101101
* Retrieve route front name
102102
*
103103
* @param string $routeId
104-
* @param null $scope
104+
* @param null|string $scope
105105
* @return string
106106
*/
107107
public function getRouteFrontName($routeId, $scope = null)
@@ -111,6 +111,8 @@ public function getRouteFrontName($routeId, $scope = null)
111111
}
112112

113113
/**
114+
* @inheritdoc
115+
*
114116
* @param string $frontName
115117
* @param string $scope
116118
* @return bool|int|string
@@ -127,6 +129,8 @@ public function getRouteByFrontName($frontName, $scope = null)
127129
}
128130

129131
/**
132+
* @inheritdoc
133+
*
130134
* @param string $frontName
131135
* @param string $scope
132136
* @return string[]

lib/internal/Magento/Framework/DB/FieldDataConverter.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ class FieldDataConverter
2121
*/
2222
const BATCH_SIZE_VARIABLE_NAME = 'DATA_CONVERTER_BATCH_SIZE';
2323

24-
/**
25-
* Default batch size
26-
*/
2724
const DEFAULT_BATCH_SIZE = 50000;
2825

2926
/**
@@ -131,7 +128,7 @@ private function getBatchSize()
131128
{
132129
if (null !== $this->envBatchSize) {
133130
$batchSize = (int) $this->envBatchSize;
134-
if (bccomp($this->envBatchSize, PHP_INT_MAX, 0) === 1 || $batchSize < 1) {
131+
if (bccomp($batchSize, PHP_INT_MAX, 0) >= 0 || $batchSize < 1) {
135132
throw new \InvalidArgumentException(
136133
'Invalid value for environment variable ' . self::BATCH_SIZE_VARIABLE_NAME . '. '
137134
. 'Should be integer, >= 1 and < value of PHP_INT_MAX'

lib/internal/Magento/Framework/Phrase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public function render()
101101
{
102102
try {
103103
return self::getRenderer()->render([$this->text], $this->getArguments());
104+
} catch (\Error $e) {
105+
return $this->getText();
104106
} catch (\Exception $e) {
105107
return $this->getText();
106108
}

0 commit comments

Comments
 (0)