In my content type Gallery, I wanted to have a node referrer field, so from my gallery I can return in my content type A.
It's working when I'm in French, but not when I'm in German always because of that nodereference field which cannot supply the correct nid depending of language.

I tried 2 ways :

Changing the value in preprocess treatment. But how can I overide the already existing function node_gallery_preprocess_node(&$vars) of node_gallery module?

I tried to let Drupal go on and change the value in node gallery template.
I can print the field with a correct value, but how to have my variable which is KO outside $content?

Comments

scroogie’s picture

I don't think you should override this on theme level, rather on module level (perhaps with a self-written custom module).

The problem seems to be these issues:

#523374: Multilingual nodereferences supporting language neutral nodereferences
#671406: NodeReference and multilanguage contents / db_rewrite_sql()

Perhaps the solution lies in the answers there.

sahuni’s picture

You're right, I should not do it in template, but it's my solution for now.
I just had to exclude my referrer field in cck display field administration, for not to have it twice (once as result of my code and once because inside $content).
Exemple : http://www.suonenmuseum.ch/gallery/clavau

Well I think everything is working now with node_gallery and multilingual :
the views are OK : http://www.suonenmuseum.ch/albums and http://www.musee-des-bisses.ch/albums
the bisse content has link to gallery
And gallery has link to bisse.

The noderef problem if same if gallery is not managed for multilingual or if gallery is managed with multi, but stay neutral.
It's a pity, and I'm not sure it will be solved one day. No reply of maintener for years on that subject.

I'll stay like that for some days, just to benefit of self satisfaction, and then I'll work to make it more clean, I suppose with hook-node-api

Thanks for helping. You're the best.

Would it help if I test node_gallery 6.x-3.0-alpha3 for you?

scroogie’s picture

Status: Active » Fixed

Yes, that would help us indeed, every feedback is welcome. What works, what doesn't, whats missing, etc.
But please apply the upgrade on a development server, so you don't risk your data. Everything should work, but better safe than sorry. :)

Status: Fixed » Closed (fixed)

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