Trying to access array offset on value of type bool LikeDislikePermissions.p

Created on 4 October 2024, 6 months ago

Problem/Motivation

[warning] Trying to access array offset on value of type bool LikeDislikePermissions.php:122
[error] Adding non-existent permissions to a role is not allowed. The incorrect permissions are "view update notifications".

Proposed resolution

i create this patch

--- a/src/LikeDislikePermissions.php
+++ b/src/LikeDislikePermissions.php
@@ -120,7 +120,7 @@
foreach ($bundles as $bundle) {
// Corrección para evitar el acceso a un valor booleano en lugar de array.
$bundle_info = $this->bundleInfoService->getBundleInfo($entity_type_id);
- $bundle_info = $bundle_info[$bundle];
+ $bundle_info = (is_array($bundle_info) && isset($bundle_info[$bundle])) ? $bundle_info[$bundle] : [];

/** @var \Drupal\votingapi\VoteTypeInterface $vote_type */
foreach ($vote_types as $vote_type) {

🐛 Bug report
Status

Active

Component

Code

Created by

🇪🇸Spain ctodon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024