- πΊπΈ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
over 1 year 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
7 months 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?