- πͺπΈSpain akalam
I'm able to reproduce it with ggroups v1, but looking at the code I suspect it may happen with newer releases as well. I'm looking at following scenario:
- Create 3 groups: Group 1 (gid: 1), Group 2 (gid: 2), Group 3 (gid: 3)
- Build the following hierarchy tree: Group 1 > Group 2 > Group 3
- Open a drush php terminal and execute: \Drupal::service('ggroup.group_graph_storage')->getAncestors(3). You will get the following outoput, which is correct: [3, 2, 1]
- Remove the group relationship between Group 1 and Group 2
- Open a new drush php terminal to avoid static cache, and execute the same code: \Drupal::service('ggroup.group_graph_storage')->getAncestors(3). You will get the same outoput: [3, 2, 1], instead of getting [3, 2].
Taking a look to the database, there's still a row with start_vertex 1 and end_vertex 3, with hop 1. The \Drupal\ggroup\GroupHierarchyManager::removeSubgroup method removes properly the direct relationships from the graph but doesn't clean the entries with hop different from 0