- ๐บ๐ธUnited States kroh San Antonio, TX
Re-rolled patch from #90 to work with 2.0.x
The last submitted patch, 93: group-2774827-93.patch, failed testing. View results โ
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- Status changed to Needs work
almost 2 years ago 4:01pm 23 May 2023 - ๐ช๐ธSpain rteijeiro
I'm experiencing an issue with this. After applying the patch in #90, I create new content in a group and it seems the tokens in [node:group:*] are empty just when the content is created. If I try to recreate the path aliases, then it works. Not sure if the issue is caused for some misconfiguration but I'm still investigating.
Sharing this if someone else experienced the same or not.
- ๐ช๐ธSpain rteijeiro
I solved the issue in #95 forcing the path alias to be created in `hook_entity_presave` only for newly created entities. I'll test if this is just an issue in my environment or if I can reproduce it in the latest versions of Drupal and the contrib modules. In the meantime I'll leave the code below if someone experiences the same issue:
if ($entity->isNew()) { $entity->path = \Drupal::service('pathauto.generator')->updateEntityAlias($entity, 'insert'); }
- ๐บ๐ธUnited States caesius
I assume from the comments and patches this applies up to 3.x, so updating the version for visibility.
- ๐จ๐ฆCanada JayDarnell Guelph, Ontario
I've tested the patch from #90 on a few sites now and it seems to work really well.
- ๐บ๐ธUnited States adriancotter
I have an error with #93 after I upgraded to 2.2.2, I am getting:
ArgumentCountError: Too few arguments to function Drupal\group\Access\GroupPermissionsHashGenerator::__construct(), 3 passed in ...web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 5 expected in Drupal\group\Access\GroupPermissionsHashGenerator->__construct() (line 70 of modules/contrib/group/src/Access/GroupPermissionsHashGenerator.php).
Any admin page throws an error. Group pages and related nodes also get the error. But non-group content is still viewable on the front end.
Steps to reproduce
We are still on Drupal 9.5.11
I got this after upgrading my Group module from 2.2.0 to 2.2.2
I was able to update to 2.2.1 okI decided to check if this patch might have an impact, when I saw the Token functions in the stack trace.
I don't immediately see where the patch might need to be tweaked.When I took out the patch the errors went away.
Drupal\group\Access\GroupPermissionsHashGenerator->__construct(Object, Object, Object) (Line: 259) Drupal\Component\DependencyInjection\Container->createService(Array, 'group_permission.hash_generator') (Line: 177) Drupal\Component\DependencyInjection\Container->get('group_permission.hash_generator', 1) (Line: 434) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 237) Drupal\Component\DependencyInjection\Container->createService(Array, 'cache_context.user.group_permissions') (Line: 177) Drupal\Component\DependencyInjection\Container->get('cache_context.user.group_permissions') (Line: 223) Drupal\Core\Cache\Context\CacheContextsManager->getService('user.group_permissions') (Line: 185) Drupal\Core\Cache\Context\CacheContextsManager->optimizeTokens(Array) (Line: 111) Drupal\Core\Cache\Context\CacheContextsManager->convertTokensToKeys(Array) (Line: 317) Drupal\Core\Render\RenderCache->createCacheID(Array) (Line: 66) Drupal\Core\Render\RenderCache->get(Array) (Line: 109) Drupal\Core\Render\PlaceholderingRenderCache->get(Array) (Line: 77) Drupal\Core\Render\RenderCache->get(Array) (Line: 109) Drupal\Core\Render\PlaceholderingRenderCache->get(Array) (Line: 273) Drupal\Core\Render\Renderer->doRender(Array) (Line: 446) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204) Drupal\Core\Render\Renderer->render(Array) (Line: 479) Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 43) __TwigTemplate_f60975c3bcef63585ca1e008bb6405ed->doDisplay(Array, Array) (Line: 405) Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378) Twig\Template->display(Array) (Line: 390) Twig\Template->render(Array) (Line: 55) twig_render_template('themes/contrib/seven/templates/page.html.twig', Array) (Line: 384) Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 433) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204) Drupal\Core\Render\Renderer->render(Array) (Line: 479) Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 86) __TwigTemplate_18e80ba8011e325cf036296dbb23f15b->doDisplay(Array, Array) (Line: 405) Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378) Twig\Template->display(Array) (Line: 390) Twig\Template->render(Array) (Line: 55) twig_render_template('themes/contrib/seven/templates/classy/layout/html.html.twig', Array) (Line: 384) Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 433) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204) Drupal\Core\Render\Renderer->render(Array) (Line: 162) Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 163) Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90) Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) call_user_func(Array, Object, 'kernel.view', Object) (Line: 142) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 44) Drupal\redirect_after_login\RedirectMiddleware->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Status changed to Needs review
about 1 year ago 7:43pm 6 May 2024 - ๐บ๐ธUnited States karlshea Minneapolis ๐บ๐ธ
Created MRs for both 3.x and 2.x from the latest patches.
- ๐จ๐ฆCanada slydevil Halifax
Applied the patch for the 2.x branch and it works well. Not moving to RTBC since I did not try the 3x branch.
- ๐จ๐ฆCanada vamirbekyan Toronto
pls note that for group v3.x in the subject patch the GroupContent is replaced with GroupRelationship
- ๐บ๐ธUnited States dave.weiner
This patch looks exactly like what I need, but I'm new to the group module, and I'm not understanding how this patch works. I've patched the group module (3.x) with the diff from the MR and it applies cleanly, but I'm still not seeing any group tokens when I select Content as the pattern type in pathauto.
Can someone please explain it to me like I'm a 1st grader? :)
- ๐บ๐ธUnited States karlshea Minneapolis ๐บ๐ธ
You should be able to use
[node:group]
tokens. I'm still using Group 2.x (MR 157), if you're on 3.x (MR 156) the MR might be wrong, but I haven't been able to test it. - ๐บ๐ธUnited States dave.weiner
Karlshea, I must be missing something. I'm running version 3.2.2, the patch from MR 156 applied cleanly, and I also have group_content_menu v3.0.3 and group_context_path_prefix v1.1.2 installed. When I go into the Pathauto configuration and select content for the pattern type, I don't have a
[node:group]
token in the list of available tokens. Selecting group or group relationship, there are nonode
tokens in the list of available tokens. What am I missing? Is there a configuration option I'm not setting? - ๐บ๐ธUnited States karlshea Minneapolis ๐บ๐ธ
Is node one of the available types of content in one of your groups? Tried clearing caches? Otherwise you might have to debug yourself or wait for someone running Group 3.x to chime in, I'm not sure.
- ๐บ๐ธUnited States dave.weiner
I found the issue -- I don't know if this was part of it, but disabled group_contenxt_path_prefix and then enabled it again. It also looks like I was hitting the pathauto configuration page inside of the group. Once I did it at the top level, I had the token available. I had to delete an existing pattern for article and basic page, and now it's working how I expect it to. Thanks for the help!
- ๐จ๐ฆCanada mandclu
This is exactly what I was looking for. After applying the changes in MR!156 I was able to use a node token that references the parent group. Thanks to everyone whose work made this possible!
- ๐บ๐ธUnited States dalemoore
Like @mandclu, I've tested the MR!156 in Group 3 and it works! Though I only tested it on content that belongs to one group. Next up: to see if I can create a path based on a Group Content Menu...
- ๐ฌ๐งUnited Kingdom rachel_norfolk UK
and trying again - itโs persistent today ;-)
- ๐บ๐ธUnited States dave.weiner
MR 156 is working for me as well. Any idea when this might be merged in?
- ๐ฌ๐งUnited Kingdom rachel_norfolk UK
Iโm going to assume you didnโt mean to change the status, Dave.weiner?
- Status changed to RTBC
3 months ago 2:51pm 15 February 2025 - ๐ณ๐ฑNetherlands edvanleeuwen Waalwijk
I am trying to patch this to the latest version (3.3.4). I now get:
Error: Class "Drupal\group\Entity\GroupContent" not found in gnode_tokens() (line 59 of /home/myuser/domains/mydomain/public_html/web/modules/contrib/group/modules/gnode/gnode.tokens.inc).
- Assigned to tim-diels
- Status changed to Needs work
10 days ago 6:55am 30 April 2025 - ๐ง๐ชBelgium tim-diels Belgium ๐ง๐ช
Hiding the patches files as the current approach is to use MRs. There are 2 MRs that seem to solve the issue and patch from #41 looks the same as MR157.
I've tested MR156 and that provided the tokens I was looking for.
But it seems no pipelines are running? I'll rebase and see if that triggers the pipeline.
- ๐ง๐ชBelgium tim-diels Belgium ๐ง๐ช
I rebased both MRs but for the 2.x I rebased on the 2.3.x so that MR needs to be changed to 2.3.x instead of 2.2.x. I4m not able to do this, anyone else have this option?
- ๐ง๐ชBelgium tim-diels Belgium ๐ง๐ช
Also with the pipelines running now, there is more work to do.
- ๐ฎ๐ณIndia dhaval_panara
@tim-diels : Due recent changes "https://git.drupalcode.org/project/group/-/merge_requests/157.patch is started to getting failed on our installed group module 2.3.1.
- ๐ง๐ชBelgium tim-diels Belgium ๐ง๐ช
@dhaval_panara please do not use mr diff links in your workflow. This is very dangerous! Please read https://github.com/cweagans/composer-patches/issues/347
- ๐จ๐ฆCanada slydevil Halifax
slydevil โ changed the visibility of the branch 2774827-2-get-a-token to hidden.
- ๐จ๐ฆCanada slydevil Halifax
slydevil โ changed the visibility of the branch 2774827-2-get-a-token to active.
- ๐จ๐ฆCanada slydevil Halifax
I've created a new MR which isolates the changes from the 2.2.x branch for the 2.3.x branch.
- ๐ต๐ญPhilippines bryanmanalo
Since MR pathces are dangerous as mentioned, is the recommended way for now to create a patch on DO based on an existing MR?
Adding a patch for 2.3.1 MR 232