- 🇮🇹Italy maurizio.ganovelli Arezzo
I have a similar problem in 2.x version too; i'm trying to give access to a specific group role to all submissions of a specific webform.
In Drupal\webform_group\WebformGroupManager the function getCurrentGroupRelationship return always FALSE due to:
$source_entity = $this->requestHandler->getCurrentSourceEntity(['webform_submission']);
returning always a NULL value fot paths like "node/X/webform/results/submissions".
I tried to extract node parameter from current route but without luck (i found no route name nor route parameters in request using \Drupal::routeMatch()).
As a temporary quick & dirty fix (for nodes only) i use:$source_entity = $this->requestHandler->getCurrentSourceEntity(['webform_submission']); if (!$source_entity) { if (preg_match("/^(\/.*)?\/node\/([1-9][0-9]*)\/webform\/results\/(submissions|download)$/", \Drupal::service('path.current')->getPath(), $matches)) { $source_entity = $this->getEntityStorage('node')->load($matches[2]); } if (!$source_entity) { return $this->currentGroupRelationship; } }
I'm sure that there is a better solution than raw url pattern matching .. any idea is welcome!