Well,
I have two languages in my website (English -en- and arabic -ar-).
I create exposed form in block to do search for some contents.
when i'm in arabic website/pages , the submit redirect me to english website where the page should show the results. which mean , exposed form in block submit redirect to default languages pages.
I saw the form tag in pages source, the action of form still have "ar/..." but when i click submit it redirect me to default language. this stop me to do any form_alter since the action for form is correct. Any idea how to solve this.
Thanx.
Note:
1) Language Configure (admin/settings/language/configure) => Path prefix with language fallback. ( i try also "Path prefix only" but not working)
2) I'm using i18n.
Comments
Comment #1
lovegame commentedOk i think i find the answer and how to fix this,
File : includes/form.inc
Function: _drupal_build_form($form_id, &$form_state)
Add this code before return :
Comment #2
merlinofchaos commentedUh, no, that putting the language in the path is an i18n thing. It's not Views' responsibility to put it there on form action.
Comment #3
lamp04ka commentedI have this problem too. What to do??? It's a seriously bag!!! Anonym user can't use the esposed form in his language!
Comment #4
lamp04ka commentedlovegame, i tryied this solution and it works!!! Thank you a lot!
but it works then you write
global $language;
$form["q"]["#value"]=$language->prefix."/".$form["q"]["#value"];
Comment #5
marthinal commented@lovegame THANKS!
Comment #6
torvall commentedSince this is the only place I can find where this issue is documented, I leave here the solution I found for D7. This should work for all exposed forms in a web site. (It does on my development site.)
As I use the session language detection method, using hook_form_alter, I simply added a hidden item with the name and value matching locale parameters:
Comment #7
pmkanse commented@lovegame THANKS!
works for D7 too.
Cheers!!!