As reported also here #5
Pathauto seems not to work correctly and adds some bugs.
I also tried also on a fresh drupal install with only Pathauto, Entity token and token but the bugs persist.

Without pathauto instead, the custom url seems to work fine, in fact, just enter the custom path in admin/config/search/path and it works.

With pathauto instead:

When you create the group the checkbox "Generate automatic URL alias" is activated, and so everything is right.

In the list admin/config/search/path, the alias autogenerated and applied well, in this case is group [group: title] and so far ok.

But if you try to type the new url alias, the site give 404 ... and the page only work with the system url like group/1, also if alias is active and present in the list.

If I try to edit the already created group, i've noted that the checkbox "Generate automatic URL alias" is magically turned off, it is always off in the edit form.

If I try to re active this checkbox(in the edit form).. this every time generate a duplicate of same alias in the admin/config/search/path.

CommentFileSizeAuthor
#6 group-2422437-6.patch1011 byteskristiaanvandeneynde
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Issue summary: View changes
Anonymous’s picture

Ok seems that the problem is here:
function group_pathauto_update_alias(Group $group, $op, $language = NULL)
should be:
function group_pathauto_update_alias(Group $group, $op, $language = LANGUAGE_NONE)

Seems that the default value NULL cause this big problem for me..
D7 use LANGUAGE_NONE Link

kristiaanvandeneynde’s picture

Hi there, I cannot seem to reproduce the bug but it does seem as if the default value should be LANGUAGE_NONE instead of NULL. Could you manually hack your copy to say LANGUAGE_NONE in group_pathauto_update_alias and post results here?

Also: Could you tell me how to reproduce the bug on a clean install? I need to verify the fix before committing it :)

Anonymous’s picture

This on fresh drupal install, on localhost:
1-Install last version of Drupal 7 (7.34).
2-Enable Group,Pathauto,Entity API, Entity Tokens and Token Modules.
3-Create Group with "Generate automatic URL alias" checked.
4-The url alias generated in admin/config/search/path is group/test, because the title of the group is "test" and the token is the default group/[group:title].
5-Go to group/test instead of group/1 url and we have "Page not found".

With LANGUAGE_NONE instead of NULL, this and the other problems related seem totally solved.

The result of group_pathauto_update_alias in save() with NULL is this:

group_pathauto_update_alias(...) array(5)
'source' => string(8) "group/34"
'alias' => string(11) "group/test1"
'language' => NULL
'pathauto' => boolTRUE
'pid' => string(4) "9354"

Instead with LANGUAGE_NONE is this:

group_pathauto_update_alias(...) array(5)
'source' => string(8) "group/33"
'alias' => string(11) "group/test1"
'language' => string(3) "und"
'pathauto' => boolTRUE
'pid' => string(4) "9353"
kristiaanvandeneynde’s picture

Assigned: Unassigned » kristiaanvandeneynde

Hi there, sorry for the late reply. I was out skiing for a week :)

Thanks for the detailed report, I'll try to verify and fix this as soon as possible.

kristiaanvandeneynde’s picture

Assigned: kristiaanvandeneynde » Unassigned
Status: Active » Needs review
FileSize
1011 bytes

Patch attached, if light goes green and simplytest.me shows the error is gone, I'll commit it.

kristiaanvandeneynde’s picture

Status: Needs review » Fixed

Works, so committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.