As in the subject, this patch makes overlays working fine on i18n environment.

Comments

zamorta’s picture

I like to thank you!

Works like a charm.

sibiru’s picture

trying to apply patch now :)

sibiru’s picture

Assigned: Unassigned » sibiru
Status: Needs review » Reviewed & tested by the community

this patch is really work, thank you

suggest to be merge to new version

iLLin’s picture

Status: Reviewed & tested by the community » Needs work

This patch does not work for my language setup. I setup Spanish as a second language and created two webforms. I gave them bot the same alias of "content/test-form" Here is my link:

print l('Test Form', 'content/test-form', array('query' => array('width' => '50%', 'height' => '50%'), 'attributes' => array('class' => array('colorbox-node'))));

If I am in English the webform for the english form popups up. If I switch languages and now "es" is in the URL. Drupal automatically puts "es/" in front of content/test-form so the url ends up like this: es/content/test-form.

If I click on that link, then colorbox prepends "colorbox" to the front of the URL and passes that onto the colorbox node module. It is then ran through this check on l ine 102 of colorbox_node.module.

function colorbox_node_url_load($arg, $path = array()) {
  // First lets remove colorbox
  array_shift($path);

  // Lets determine if we have a prefix from our languages.
  if (module_exists('locale') && function_exists('language_url_split_prefix')) {

It retrieves the correct path and displays the correct page. Make sure that gets fired correctly. There maybe a better approach then what I am doing in that function but that approach is not with javascript. By using your method, it prepends "es/" in front of colorbox which is incorrect. So end up with URL's like this: es/colorbox/es/content/test-form

agnese.stelce’s picture

StatusFileSize
new900 bytes

paolomainardi code works really great but patch unfortunately didn't apply well with my make file so I generated new patch file against 7.x.-2.x.

paolomainardi’s picture

Thanks Agnese :)

betz’s picture

Status: Needs work » Reviewed & tested by the community

smooth aligator!

#5 works perfect.

betz’s picture

StatusFileSize
new915 bytes

The patch in #5 forgot to add + parse.search to the path.
This is needed for extra url parameters like default parameters for webform...
Attached the modified patch.

iLLin’s picture

Status: Reviewed & tested by the community » Needs work

Please review my comment in #4.

harrrrrrr’s picture

Status: Needs work » Reviewed & tested by the community

#5 works.

iLLin’s picture

Status: Reviewed & tested by the community » Needs work

Again... review my comment in #4.

giorgosk’s picture

@iLLin
maybe the problem is Entity Translatable Nodes/Entities ?
does colorbox_node work with entity translatable nodes ?
BTW entity translation is part of Drupal 8 now !!
http://drupal.org/project/entity_translation

those would have the same NID so you could only tell them apart by the language prefix
en/node/1
de/node/1

@everyone is your i18n setup involving entity_translation ?

paolomainardi’s picture

@GiorgosK

No, i wrote my patch using just regular i18n modules, i didn't test it against entity translation modules.

agnese.stelce’s picture

@GiorgosK

No, my setup included only i18n modules, no entity translation.

thesame-’s picture

StatusFileSize
new922 bytes

I was facing the same problem as #4 as I ended up having path like this /[prefix]/colorbox/[prefix]/node/[nid]

I included patch that worked for me.

hefterbrumi’s picture

Is the patch in #15 works with entity translation? Icant apply anyways. Is that for 3.0?

Andre-B’s picture

Issue summary: View changes
Status: Needs work » Patch (to be ported)

upgraded affected version to 3.x since #2150593: Multilingual Support Problem reports an issue about i18n too.

patch probably needs rerolling to latest dev, shouldn't be too hard to include the language prefix.

Andre-B’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Patch (to be ported) » Needs work
upchuk’s picture

I also tried these solutions but unfortunately for my use case it doesn't really work.

My language settings are as follows:

example.com/path (for the default language)
example.com/en/path (for english)

And if I am on a page with the default language (without prefix) and want to load in a colorbox a node with the english language, it won't work because there is no 'en' path prefix to append to the 'link' variable.

This means the patches in this issue are not really sustainable as you are hardcoding the prefix in the ajax request from the page you currently are on. It should somehow accept it from the href.

I'm still trying to figure out a way...

jimmyko’s picture

StatusFileSize
new1.51 KB

I am facing the same problem on 7.x-3.x version. I have tried to patch it. Please help to review.

jimmyko’s picture

FYI. The patch I created on #20 is based on the 7.x-3.x branch on git.

iLLin’s picture

It is just URLs. As long as your URLs are built correctly, it should work. Please see my comment in #4

jimmyko’s picture

@iLLin

I have read your post but it is really not working in my case. I think the patch is a bit dirty but at least it can help at this moment.

Chris Gillis’s picture

This isn't working for me. I have

print l(t('Contact Us'), 'node/30', array('query' => array('width' => '500', 'height' => '500'), 'attributes' => array('class' => array('button', 'colorbox-node'))));

If I take out the "colorbox-node" class, I get a link to the right language. (e.g. from /ko/ I get a link to /ko/node/30 which appears in Korean). However, when I add the "colorbox-node" class, it displays the modal in English. Any ideas how to work around?

iLLin’s picture

Do you have a demo site with creds so I can take a look?

Chris Gillis’s picture

No, I don't sorry.

Also, because of this issue Ive decided to switch over to using modal_forms module instead. Seems to work fine.

korzh-nick’s picture

#20 works for me

madeltoro’s picture

#20 Works

madeltoro’s picture

StatusFileSize
new1.51 KB

#20 Updated patch

gonchiponchi’s picture

the patch #30 worked fine but i can't understand why this patch is not into the colorbox node , this bug is well know more than 2 years . i've the last colorbox node version installed and i still must install patch to work correctly.

giorgosk’s picture

Version: 7.x-3.x-dev » 7.x-3.4
Status: Needs work » Reviewed & tested by the community

#30 applies cleanly on latest code 3.4 (dev version is older)
and its same patch since #20
and its been tested and works properly
it think it should be committed

  • iLLin committed b389edd on 7.x-3.x authored by madeltoro
    Issue #1813122 by jimmyko, paolomainardi, madeltoro, agnese.stelce,...
iLLin’s picture

Status: Reviewed & tested by the community » Fixed

In DEV, I'll get a new release out soon.

Status: Fixed » Closed (fixed)

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