Call to undefined method Drupal\ggroup\Graph\SqlGroupGraphStorage::loadMultiple()

Created on 15 September 2022, almost 2 years ago
Updated 6 June 2024, 19 days ago

Problem/Motivation

With the release ov version 2.0, it seems one function/functionality is missing.

in 1.0, we have the function:

  /**
   * {@inheritdoc}
   */
  public function getGroupSupergroups($group_id) {
    $subgroup_ids = $this->getGroupSupergroupIds($group_id);
    return $this->entityTypeManager->getStorage('group')->loadMultiple($subgroup_ids);
  }

(also valid with getGroupSubgroups)

in 2.0, this function is now

  /**
   * {@inheritdoc}
   */
  public function getGroupSupergroups($group_id) {
    $subgroup_ids = $this->getGroupSupergroupIds($group_id);
    return $this->groupGraphStorage->loadMultiple($subgroup_ids);
  }

but under Drupal\ggroup\Graph\SqlGroupGraphStorage; such function does not exists, and therefore you get this error when calling the function

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\ggroup\Graph\SqlGroupGraphStorage::loadMultiple() in Drupal\ggroup\GroupHierarchyManager->getGroupSupergroups() (line 129 of modules/contrib/ggroup/src/GroupHierarchyManager.php). 

Steps to reproduce

Call the function that is triggering the error when trying to get the parent of a group

Proposed resolution

Add the missing function or use the group storage as it was before

Remaining tasks

Create the patch

Thnks

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium gorkagr

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024