Skip to content

Commit e1b6b84

Browse files
committed
ACP2E-3208: [Cloud] Users with a specific role cannot login
1 parent 140433c commit e1b6b84

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed

app/code/Magento/Config/Block/System/Config/Edit.php

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,29 @@ protected function _prepareLayout()
7575
{
7676
/** @var $section \Magento\Config\Model\Config\Structure\Element\Section */
7777
$section = $this->_configStructure->getElement($this->getRequest()->getParam('section'));
78-
$this->_formBlockName = $section->getFrontendModel();
79-
if (empty($this->_formBlockName)) {
80-
$this->_formBlockName = self::DEFAULT_SECTION_BLOCK;
81-
}
82-
$this->setTitle($section->getLabel());
83-
$this->setHeaderCss($section->getHeaderCss());
78+
if ($section !== null) {
79+
$this->_formBlockName = $section->getFrontendModel();
80+
if (empty($this->_formBlockName)) {
81+
$this->_formBlockName = self::DEFAULT_SECTION_BLOCK;
82+
}
83+
$this->setTitle($section->getLabel());
84+
$this->setHeaderCss($section->getHeaderCss());
8485

85-
$this->getToolbar()->addChild(
86-
'save_button',
87-
\Magento\Backend\Block\Widget\Button::class,
88-
[
89-
'id' => 'save',
90-
'label' => __('Save Config'),
91-
'class' => 'save primary',
92-
'data_attribute' => [
93-
'mage-init' => ['button' => ['event' => 'save', 'target' => '#config-edit-form']],
86+
$this->getToolbar()->addChild(
87+
'save_button',
88+
\Magento\Backend\Block\Widget\Button::class,
89+
[
90+
'id' => 'save',
91+
'label' => __('Save Config'),
92+
'class' => 'save primary',
93+
'data_attribute' => [
94+
'mage-init' => ['button' => ['event' => 'save', 'target' => '#config-edit-form']],
95+
]
9496
]
95-
]
96-
);
97-
$block = $this->getLayout()->createBlock($this->_formBlockName);
98-
$this->setChild('form', $block);
97+
);
98+
$block = $this->getLayout()->createBlock($this->_formBlockName);
99+
$this->setChild('form', $block);
100+
}
99101
return parent::_prepareLayout();
100102
}
101103

app/code/Magento/Config/Model/Config/Structure.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ public function getFirstSection()
228228
*/
229229
public function getElementByPathParts(array $pathParts)
230230
{
231+
if (empty($pathParts)) {
232+
return null;
233+
}
231234
$path = implode('_', $pathParts);
232235
if (isset($this->_elements[$path])) {
233236
return $this->_elements[$path];

app/code/Magento/Paypal/Model/Config/StructurePlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static function getPaypalConfigCountries($addOther = false)
100100
*/
101101
public function aroundGetElementByPathParts(Structure $subject, \Closure $proceed, array $pathParts)
102102
{
103-
$isSectionChanged = $pathParts[0] == 'payment';
103+
$isSectionChanged = !empty($pathParts[0]) && $pathParts[0] === 'payment';
104104

105105
if ($isSectionChanged) {
106106
$requestedCountrySection = 'payment_' . strtolower($this->backendHelper->getConfigurationCountryCode());

app/code/Magento/Paypal/etc/acl.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
<resource id="Magento_Backend::stores">
1313
<resource id="Magento_Backend::stores_settings">
1414
<resource id="Magento_Config::config">
15-
<resource id="Magento_Paypal::paypal" title="PayPal Section" translate="title" sortOrder="50" />
15+
<resource id="Magento_Payment::payment">
16+
<resource id="Magento_Paypal::paypal" title="PayPal Section" translate="title" sortOrder="50" />
17+
</resource>
1618
</resource>
1719
</resource>
1820
</resource>

0 commit comments

Comments
 (0)