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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Skabbkladden created an issue. See original summary.

badrange’s picture

Status: Active » Needs review

Setting 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.

Skabbkladden’s picture

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

Just tested that it does affect 7.x-1.x as well.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for the patch. It fixed our infinite loop!

plach’s picture

Thanks, ticking credit boxes.

  • plach committed 698458a on 7.x-1.x authored by Skabbkladden
    Issue #2927815 by Skabbkladden, dawehner: Infinite loop with language...
plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks!

Status: Fixed » Closed (fixed)

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