diff --git a/patches/d10-3.json b/patches/d10-3.json index aa39589b54660bc4699d1cd8573ef19d5b35a8b4..edfc3eb940d92478dc56bd05d0fbbae359af4234 100644 --- a/patches/d10-3.json +++ b/patches/d10-3.json @@ -124,6 +124,9 @@ "drupal/glossify": { "#3360633 HTML entities": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3360633.diff" }, + "drupal/group": { + "#3416324 Related entity tokens": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3416324.diff" + }, "drupal/http_client_manager": { "#3385117 Code generator": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3385117.diff" }, diff --git a/patches/d10-4.json b/patches/d10-4.json index 89558005d920dd225db55266470cebf82dcd0bb9..a80498f55126b45b343758ac8845a75a6d38e901 100644 --- a/patches/d10-4.json +++ b/patches/d10-4.json @@ -124,6 +124,9 @@ "drupal/glossify": { "#3360633 HTML entities": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3360633.diff" }, + "drupal/group": { + "#3416324 Related entity tokens": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3416324.diff" + }, "drupal/http_client_manager": { "#3385117 Code generator": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3385117.diff" }, diff --git a/patches/d10/3416324.diff b/patches/d10/3416324.diff new file mode 100644 index 0000000000000000000000000000000000000000..e7c7eda4c8ae3bfb27787983d249704a899e8a9e --- /dev/null +++ b/patches/d10/3416324.diff @@ -0,0 +1,26 @@ +diff --git a/group.tokens.inc b/group.tokens.inc +index 686b2756bd7d49bbd89b4ea7a3633473c933bc7b..1f904fdcb11ee3c11fa628c4304eeb2a44ecdca4 100644 +--- a/group.tokens.inc ++++ b/group.tokens.inc +@@ -272,5 +272,21 @@ function group_tokens($type, $tokens, array $data, array $options, BubbleableMet + if ($changed_tokens = $token_service->findWithPrefix($tokens, 'changed')) { + $replacements += $token_service->generate('date', $changed_tokens, ['date' => $group_relationship->getChangedTime()], $options, $bubbleable_metadata); + } ++ ++ // Provide access to tokens of the related entity. ++ if (str_starts_with($name, 'entity:')) { ++ $entity = $group_relationship->getEntity(); ++ $entityTypeId = $entity->getEntityTypeId(); ++ $bubbleable_metadata->addCacheableDependency($entity); ++ $parts = explode(':', $name); ++ $parts[0] = $entityTypeId; ++ $realTokens = [ ++ implode(':', $parts) => $original, ++ ]; ++ if ($entity_tokens = $token_service->findWithPrefix($realTokens, $entityTypeId)) { ++ $replacements += $token_service->generate($entityTypeId, $entity_tokens, [$entityTypeId => $entity], $options, $bubbleable_metadata); ++ } ++ } ++ + } + } diff --git a/patches/d11.json b/patches/d11.json index ec032caa32009c1323bfcc8a2276c8f1c742000c..a3083da959933e987628809974da16304751cf54 100644 --- a/patches/d11.json +++ b/patches/d11.json @@ -118,6 +118,9 @@ "drupal/gin_toolbar": { "#3319445 Permission check": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3319445.diff" }, + "drupal/group": { + "#3416324 Related entity tokens": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3416324.diff" + }, "drupal/glossify": { "#3360633 HTML entities": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3360633.diff" },