Can we have Pathauto try and generate a unique variant of the alias in cases where the alias generated conflicts with an existing callback function? Is there a reason why Pathauto treats this kind of conflict differently that conflicts with existing aliases?

I'd be willing to attempt writing a patch for this if it makes sense to the community.

CommentFileSizeAuthor
#4 callback-conflict-variant-1316976.patch2.15 KBnmc
FAILED: [[SimpleTest]]: [MySQL] 552 pass(es), 3 fail(s), and 0 exception(es). View
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

Dave Reid’s picture

I'm not sure I quite understand? Could you expand on this?

nmc’s picture

There are at least two cases where an alias may be in conflict. Example: when trying to create the alias domain.com/hello-world

  1. Case where domain.com/hello-world alias already exists and likely points to a different node
  2. Case where domain.com/hello-world resolves to an existing callback likely implemented by a hook_menu function in some module

In case 1, pathauto tries to generate a variant (domain.com/hello-world-0), but in case 2, pathauto does not try to generate a variant. I'd like pathauto to be able to generate a variant for case 2 as well.

Dave Reid’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev

Ok thanks, that is helpful. I see what the problem is now.

nmc’s picture

Status: Active » Needs review
FileSize
2.15 KB
FAILED: [[SimpleTest]]: [MySQL] 552 pass(es), 3 fail(s), and 0 exception(es). View

Attached is the patch....

Status: Needs review » Needs work

The last submitted patch, callback-conflict-variant-1316976.patch, failed testing.

hgoto’s picture

Probably this issue has been resolved in the following issue.

#1909370: Allow other modules to chime in when checking if a to-be-generated alias is already reserved

(I'm not confident and don't change the status.)