When using hook_pathauto_alias_alter() to set the alias language to LANGUAGE_NONE an infinite loop is triggered in ETs implementation of the same hook when saving a node with 'Provide a menu link' and 'Generate automatic URL alias' set to true.
The problem occurs in the foreach at line 2056-2063 in entity_translation.module. If $context['language'] and $pathauto_start_language are always set to LANGUAGE_NONE from another implementation of the same hook, they will no longer match the languages in $translations->data, triggering the creation of a new alias.
A possible solution would be to check if $context['language'] is set to LANGUAGE_NONE before entering the foreach-loop, see attached patch.
Comment | File | Size | Author |
---|---|---|---|
Infinite-loop-with-language-neutral-alias.patch | 717 bytes | Skabbkladden | |
|
Comments
Comment #2
badrange CreditAttribution: badrange at Digia commentedSetting to needs review because of the existing patch. Skabbkladden: Have you checked if this issue also affects 7.x-1.x, the most recent git revision of this module? Patches usually gets merged faster if the corresponding issue is set to affect the most recent git revision.
Comment #3
Skabbkladden CreditAttribution: Skabbkladden commentedJust tested that it does affect 7.x-1.x as well.
Comment #4
dawehnerThank you for the patch. It fixed our infinite loop!
Comment #5
plachThanks, ticking credit boxes.
Comment #7
plachCommitted and pushed, thanks!