Steps to reproduce:
1) Add a group type 'My Group'
2) Create a pathauto pattern for the group type just created (/admin/config/search/path/patterns/add)
(select 'group' from Pattern type dropdown)
(check 'My Group')
pattern: all-groups/[group:title]
3) Clear all caches
4) Add a group (/group/add/my_group)
title: 'Pizzaioli group'
5) The new group is now available ONLY at /group/1
and not at /all-groups/pizzaioli-group as expected
6) clear the cache just to be sure: does not resolve
7) Edit the group (just save it at /group/1/edit
8) Now the alias has been correctly created:
/all-groups/pizzaioli-group
Please fix this: the pathauto alias should be immediately available at group creation an not only at group edit/save
Thank you!
PS: tested also on simplytest.me -> https://dazi.ply.st/ (until available)
2018-04-17 UPDATE: the issue is thrown ONLY when the option:
Group creator must complete their membership
Is checked on the group edit settings.
(so when a further step is necessary to fill membership details)
Unchecking the above field (that it is fine only when there are no fields to fill in the membership relation) pathauto do correctly its work and the group alias is correctly created.
Comments
Comment #2
joshuamiI saw something similar. This appears to be a bug in pathauto: https://www.drupal.org/project/pathauto/issues/2950701 that has a patch in process.
Comment #3
joshuamiComment #4
joshuamiThat patch does not fix this issue, but I do think the issue has to do with traversing the parent:child relationship between entities. (The other issue was reported on a book page not inheriting its book hierarchy on node creation.)
Comment #5
mxtUPDATE: the issue is thrown ONLY when the option:
Is checked on the group edit settings.
(so when a further step is necessary to fill membership details)
Unchecking the above field (that it is fine only when there are no fields to fill in the membership relation) pathauto does correctly its work and the group alias is correctly created.
Comment #6
mxtComment #7
joshuami@MXT, thanks for posting that work around. It suggests that the node save is being interrupted by the membership entity. I don't believe the related issue I added is applicable. I'm removing that.
Comment #8
hlopes commentedThis also happens if there's an image field on the group (but only if you add an image).
Even with "Group creator must complete their membership" unchecked.
Meaning
is not correct.
I've also noticed that replacing the method in the patch at #2950701 to ->createEntityAlias works.
Comment #9
acAlso happens when there is a file field on the group. This seems like a bug (not sure if it is in pathauto or group).
Comment #10
bobbygryzyngerI am also seeing this behavior. Some debugging shows that, for whatever reason,
pathauto_entity_insertis not called after group creation.Comment #11
lolcode commentedI can confirm #5, #8 and #10.
The group will not get an url alias in either of these two cases:
If both of the above are false then the url alias will be generated correctly.
Comment #12
lolcode commentedThis issue has been reported more generally against Pathauto.
The second related issue I am adding provides a patch that fixes this for me.
"Alias is not generated when Pathauto widget is hidden"