Skip to content

Commit 61fb87f

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #17960: [Forwardport] Move functions.php into Framework (by @fooman) - #17765: [Forwardport] Clean code (by @nmalevanec) - #17768: [Forwardport] Fix proxy generation return type (by @nmalevanec) - #17941: [Forwardport] Sales: Add unit test for validator model class (by @dmytro-ch) - #17946: [2.3] changed intval($val) to (int) $val, since `(int) $val ` is faster. (by @TBlindaruk) - #17938: Replace sort callbacks to spaceship operator (by @mage2pratik) - #17922: [Forwardport] API-functional test for Search (by @mage2pratik) - #17921: [Forwardport] Remove leading Countrycode from EU-VAT-Numbers (by @mage2pratik) - #17874: [Forwardport] Fix - Next Page button triggered when filtering Customer grid (by @ronak2ram) - #17911: [Forwardport] Resolved : Wishlist icon cut on Shopping cart page in mobile view #17851 #27 (by @hitesh-wagento) - #17848: Fix for invalid JSON if image label contains HTML markup, example " (by @jeroenschipper) - #17832: [Forwardport] Fix translation issue (by @nmalevanec) - #17837: [Forwardport] [Search] Unit test for SynonymAnalyzer model (by @furseyev) - #17829: [Forwardport] CSS load order incorrect using default_head_blocks.xml #1821 (by @nmalevanec) - #17750: [Forwardport] Unable to change attribute type from swatch (by @nmalevanec) - #17650: Use route ID when creating secret keys in backend menus instead of route name (by @lfolco) Fixed GitHub Issues: - #17789: Next Page button triggered when filtering Customer grid (reported by @lucasjor-summa) has been fixed in #17874 by @ronak2ram in 2.3-develop branch Related commits: 1. 92c1aa4 2. a2993a5 3. c580a46 - #17851: Wishlist icon cut on Shopping cart page in mobile view (reported by @hitesh-wagento) has been fixed in #17911 by @hitesh-wagento in 2.3-develop branch Related commits: 1. f0b5ecc - #1821: CSS load order incorrect using default_head_blocks.xml (reported by @chicgeek) has been fixed in #17829 by @nmalevanec in 2.3-develop branch Related commits: 1. d3e24ed 2. fe6c96f - #9307: Color attribute taking swatch instead of Drop down option for configurable options, (reported by @vishveskrish) has been fixed in #17750 by @nmalevanec in 2.3-develop branch Related commits: 1. 0f28b61 2. d159921 - #9923: Upgrading to 2.1.7 changed dropdown attributes to swatches (reported by @roseofgold) has been fixed in #17750 by @nmalevanec in 2.3-develop branch Related commits: 1. 0f28b61 2. d159921 - #11403: Product Attributes Not Updating on Frontend (reported by @rbur0425) has been fixed in #17750 by @nmalevanec in 2.3-develop branch Related commits: 1. 0f28b61 2. d159921 - #11703: Changing Swatches to Drop-down does not remove swatches from existing products (reported by @expgabe) has been fixed in #17750 by @nmalevanec in 2.3-develop branch Related commits: 1. 0f28b61 2. d159921 - #12695: Unable to change attribute type from swatch to dropdown (reported by @alena-marchenko) has been fixed in #17750 by @nmalevanec in 2.3-develop branch Related commits: 1. 0f28b61 2. d159921 - #7557: Backend Security key broken for controllers with frontname not equal to route ID (reported by @AlexandreKhayrullin) has been fixed in #17650 by @lfolco in 2.3-develop branch Related commits: 1. 2662dfa 2. a0dfb6d 3. 35eba04 4. 600a185 5. 062286e 6. c3d700a 7. be7c961 8. fa8a222 9. b738ce6 10. af3507a
2 parents cfaa388 + f767f7b commit 61fb87f

File tree

73 files changed

+677
-180
lines changed

Some content is hidden

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

73 files changed

+677
-180
lines changed

app/bootstrap.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
// Sets default autoload mappings, may be overridden in Bootstrap::create
3232
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);
3333

34-
require_once BP . '/app/functions.php';
35-
3634
/* Custom umask value may be provided in optional mage_umask file in root */
3735
$umaskFile = BP . '/magento_umask';
3836
$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;

app/code/Magento/Analytics/ReportXml/ReportProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(
5555
private function getIteratorName(Query $query)
5656
{
5757
$config = $query->getConfig();
58-
return isset($config['iterator']) ? $config['iterator'] : null;
58+
return $config['iterator'] ?? null;
5959
}
6060

6161
/**

app/code/Magento/Backend/App/DefaultPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public function __construct(\Magento\Backend\App\ConfigInterface $config)
4242
*/
4343
public function getPart($code)
4444
{
45-
return isset($this->_parts[$code]) ? $this->_parts[$code] : null;
45+
return $this->_parts[$code] ?? null;
4646
}
4747
}

app/code/Magento/Backend/Block/Menu.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,23 @@ class Menu extends \Magento\Backend\Block\Template
7474
*/
7575
private $anchorRenderer;
7676

77+
/**
78+
* @var ConfigInterface
79+
*/
80+
private $routeConfig;
81+
7782
/**
7883
* @param Template\Context $context
7984
* @param \Magento\Backend\Model\UrlInterface $url
8085
* @param \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory
8186
* @param \Magento\Backend\Model\Auth\Session $authSession
8287
* @param \Magento\Backend\Model\Menu\Config $menuConfig
8388
* @param \Magento\Framework\Locale\ResolverInterface $localeResolver
89+
* @param \Magento\Framework\App\Route\ConfigInterface $routeConfig
8490
* @param array $data
8591
* @param MenuItemChecker|null $menuItemChecker
8692
* @param AnchorRenderer|null $anchorRenderer
93+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8794
*/
8895
public function __construct(
8996
\Magento\Backend\Block\Template\Context $context,
@@ -94,7 +101,8 @@ public function __construct(
94101
\Magento\Framework\Locale\ResolverInterface $localeResolver,
95102
array $data = [],
96103
MenuItemChecker $menuItemChecker = null,
97-
AnchorRenderer $anchorRenderer = null
104+
AnchorRenderer $anchorRenderer = null,
105+
\Magento\Framework\App\Route\ConfigInterface $routeConfig = null
98106
) {
99107
$this->_url = $url;
100108
$this->_iteratorFactory = $iteratorFactory;
@@ -103,6 +111,9 @@ public function __construct(
103111
$this->_localeResolver = $localeResolver;
104112
$this->menuItemChecker = $menuItemChecker;
105113
$this->anchorRenderer = $anchorRenderer;
114+
$this->routeConfig = $routeConfig ?:
115+
\Magento\Framework\App\ObjectManager::getInstance()
116+
->get(\Magento\Framework\App\Route\ConfigInterface::class);
106117
parent::__construct($context, $data);
107118
}
108119

@@ -203,8 +214,9 @@ protected function _afterToHtml($html)
203214
*/
204215
protected function _callbackSecretKey($match)
205216
{
217+
$routeId = $this->routeConfig->getRouteByFrontName($match[1]);
206218
return \Magento\Backend\Model\UrlInterface::SECRET_KEY_PARAM_NAME . '/' . $this->_url->getSecretKey(
207-
$match[1],
219+
$routeId,
208220
$match[2],
209221
$match[3]
210222
);

app/code/Magento/Backend/Block/Widget/Button/ButtonList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ public function getItems()
127127
*/
128128
public function sortButtons(Item $itemA, Item $itemB)
129129
{
130-
$sortOrderA = intval($itemA->getSortOrder());
131-
$sortOrderB = intval($itemB->getSortOrder());
130+
$sortOrderA = (int) $itemA->getSortOrder();
131+
$sortOrderB = (int) $itemB->getSortOrder();
132132

133133
if ($sortOrderA == $sortOrderB) {
134134
return 0;

app/code/Magento/Backend/Model/Menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function add(Item $item, $parentId = null, $index = null)
8383
}
8484
$parentItem->getChildren()->add($item, null, $index);
8585
} else {
86-
$index = intval($index);
86+
$index = (int) $index;
8787
if (!isset($this[$index])) {
8888
$this->offsetSet($index, $item);
8989
$this->_logger->info(

app/code/Magento/Backend/Model/Menu/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ public function getResult(\Magento\Backend\Model\Menu $menu)
102102
*/
103103
protected function _getParam($params, $paramName, $defaultValue = null)
104104
{
105-
return isset($params[$paramName]) ? $params[$paramName] : $defaultValue;
105+
return $params[$paramName] ?? $defaultValue;
106106
}
107107
}

app/code/Magento/Backend/view/adminhtml/templates/widget/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ $numColumns = !is_null($block->getColumns()) ? sizeof($block->getColumns()) : 0;
107107
<?= /* @escapeNotVerified */ __('of %1', '<span>' . $block->getCollection()->getLastPageNumber() . '</span>') ?>
108108
</label>
109109
<?php if ($_curPage < $_lastPage): ?>
110-
<button title="<?= /* @escapeNotVerified */ __('Next page') ?>"
110+
<button type="button" title="<?= /* @escapeNotVerified */ __('Next page') ?>"
111111
class="action-next"
112112
onclick="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.setPage('<?= /* @escapeNotVerified */ ($_curPage + 1) ?>');return false;">
113113
<span><?= /* @escapeNotVerified */ __('Next page') ?></span>

app/code/Magento/Backup/Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function getBackupsDir()
110110
public function getExtensionByType($type)
111111
{
112112
$extensions = $this->getExtensions();
113-
return isset($extensions[$type]) ? $extensions[$type] : '';
113+
return $extensions[$type] ?? '';
114114
}
115115

116116
/**

app/code/Magento/Backup/Model/Config/Backend/Cron.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public function afterSave()
7676

7777
if ($enabled) {
7878
$cronExprArray = [
79-
intval($time[1]), # Minute
80-
intval($time[0]), # Hour
79+
(int) $time[1], # Minute
80+
(int) $time[0], # Hour
8181
$frequency == $frequencyMonthly ? '1' : '*', # Day of the Month
8282
'*', # Month of the Year
8383
$frequency == $frequencyWeekly ? '1' : '*', # Day of the Week

0 commit comments

Comments
 (0)