when pathauto_i18n_update_alias is executing it iterates across the languages list and create a duplicated alias for the original language when the entity_type is not a node.
The attached patch corrects this behavior (basically a && instaed of ||)

hopes this helps

Comments

sanchiz’s picture

hi @ceonizm, thank for the bug report.

Can you provide some background information which entity do you use?

I tested your patch and it broke creation of aliases for source language.

Thanks!

sanchiz’s picture

Status: Active » Closed (works as designed)

Feel free to reopen issue with more context.

PascalAnimateur’s picture

I'm having the same problem with duplicate URL aliases being created for taxonomy terms in the source language. I'm using title + entity_translation to translate the term's name and description. The patch from #2 seemed to fix the problem, but it didn't work when bulk updating the aliases.

I think that part of my problem was $entity->language not being defined because entity_translation uses $entity->translations->original instead.

So here's a patch that fixes the problem when using pathauto_i18n with entity_translation. This check should handle both cases (entity_translation / content translation) before being committed to pathauto_i18n.

PascalAnimateur’s picture

Status: Closed (works as designed) » Needs work
PascalAnimateur’s picture

StatusFileSize
new725 bytes

Better check for the entity language.. previous patch caused problem with user entity saving.

sanchiz’s picture

Status: Needs work » Needs review

trigger bot

The last submitted patch, pathauto_i18n.module.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 5: pathauto_i18n-duplicate_alias_source_language-2353603-5.patch, failed testing.

sanchiz’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new711 bytes

Hi @PascalAnimateur,

Could you please try this patch? As I see entity always has language property even with entity_translation.

Please let me know if it works for you.

  • sanchiz committed f78cc25 on 7.x-1.x
    Issue #2353603 by PascalAnimateur, sanchiz, ceonizm: duplicated alias of...

Status: Needs review » Needs work

The last submitted patch, 9: pathauto_i18n-duplicate_alias_source_language-2353603-7.patch, failed testing.

sanchiz’s picture

Issue tags: +CodeSprintUA, +dcuacs2015
sanchiz’s picture

Status: Needs work » Needs review
StatusFileSize
new608 bytes

Re-roll.

Status: Needs review » Needs work
sanchiz’s picture

Status: Needs work » Fixed

Committed. Available now in 7.x-1.x-dev or in in 7.x-1.4 and later once released.

Status: Fixed » Closed (fixed)

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