We had the issue that entity translation nodes were not redirected correctly when the option Language Path Checking was enabled in Global Redirect.
Therefore I have created a patch which I want to provide you here.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Cyclodex’s picture

Assigned: Cyclodex » Unassigned
Status: Active » Needs review
FileSize
1.93 KB

Providing here the patch to the latest dev version.

Would be great to hear some feedback so please test and review!

This Patch is sponsored by Nothing Interactive.

fuse’s picture

Great patch. Tried it out and seems to be working.

nevergone’s picture

Status: Needs review » Reviewed & tested by the community

I tested and works well!

Cyclodex’s picture

Howdy!
Can this patch get into next release as it seems to work for the people?
Would be great, thanks!

anou’s picture

Patch from Cyclodex is just fine and works nicely !
Thanks.

wizonesolutions’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Can you add tests to this? Lots of people use the module, and we want to make sure it doesn't break for them.

Ideally you could show us the tests failing without the patch and then passing (as well as all the other existing ones, etc.) with it.

Cyclodex’s picture

Hey

Ok, I totally understand this. I am not yet used to the tests.
I will try to look into it, anyone else willing to help with this?

Perhaps I will have next week some time for doing this.

kitikonti’s picture

Issue summary: View changes

Hi, i have the same problem, but have not tried the patch now. Bevore i try the patch and maybe try adding some testing, i wantet ask if the "Language Path Checking" option makes any sence if we use entity translation?
Anyway there could still be the setup where a site uses both translation technics.

goron’s picture

I don't have time to write tests for this right now, but I just wanted to comment that it does seem to work.

@kitiknti, yeah, I'm keeping it because I need both translation options available.

goron’s picture

I'm actually including a new patch for this, because I had a few problems with the last patch:
- The new function's name (_globalredirect_translation_supported_type) and comment were confusing, even if consistent with names from other translation modules. I renamed the function and changed the doc to explain better what the function is doing. Also changed the other comment to be a bit more concise.
- Switched it to use the function that comes with entity_translation for detecting whether it's enabled for the node type, instead of duplicating the logic here.
- Moved the helper function down to the bottom of the file. Probably shouldn't be up there with hook_init and hook_help.

Still needs tests, which I don't have time to add at this point.

gge’s picture

Just testes #10 and the nodes are now redirected properly. Before applying this patch, I only had problems with nodes translated by TMGMT module.

jcnventura’s picture

Status: Needs work » Needs review
darby3’s picture

Does this patch only work if you're also using content/node translation? A bit out of my depth but I think that's what I'm seeing. Can it/could it be used for solely entity-translation driven sites?

sokru’s picture

#10 worked fine on my content translation + entity-translation combo. +1 for writing tests also.

cbrody’s picture

Using entity_translation, the globalredirect module, whether patched or not, does not redirect to the default language path (i.e. with no language prefix) when no translations exist for a node. Menu and home page links are not redirected either. Where should I look for a fix for this issue?

betoscopio’s picture

Patch #10 worked well for me with some hunks when applied. Here is a reroll for the current dev.

betoscopio’s picture

After some testing, and trying both versions of the patch I realized that it fix the problem with translated nodes, but while doing this, also the option Language Path Checking stops to work. So, in practice the effect is the same than disable the option.