Skip to content

Commit dbdba45

Browse files
committed
check if node id exists before checking its admin
When there are nodes in the aclResources that not have a member 'id', you will get an error on the comparison $node['id'] == 'Magento::admin' First check if the member 'id' exists Signed-off-by: BlackEagle <ike.devolder@gmail.com>
1 parent ce5dbd5 commit dbdba45

File tree

2 files changed

+4
-2
lines changed
  • app/code/Magento

2 files changed

+4
-2
lines changed

app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Webapi.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ private function getAclResources()
190190
$configResource = array_filter(
191191
$resources,
192192
function ($node) {
193-
return $node['id'] == 'Magento_Backend::admin';
193+
return isset($node['id'])
194+
&& $node['id'] == 'Magento_Backend::admin';
194195
}
195196
);
196197
$configResource = reset($configResource);

app/code/Magento/User/Block/Role/Tab/Edit.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ private function getAclResources()
210210
$configResource = array_filter(
211211
$resources,
212212
function ($node) {
213-
return $node['id'] == 'Magento_Backend::admin';
213+
return isset($node['id'])
214+
&& $node['id'] == 'Magento_Backend::admin';
214215
}
215216
);
216217
$configResource = reset($configResource);

0 commit comments

Comments
 (0)