Closed (fixed)
Project:
Variable
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Sep 2012 at 09:04 UTC
Updated:
5 Jan 2013 at 23:40 UTC
When I tried setting the language_default variable in a domain realm variable form the site was broken afterwards since the language code ("en") got stored in variable_store table instead of the language object. The attached patch fixes this issue for me.
| Comment | File | Size | Author |
|---|---|---|---|
| locale.variable.inc.patch | 597 bytes | patrick r. |
Comments
Comment #1
spike22 commentedWe (my company) also ran into this problem, by installing the latest stable Domain Access, Variable, Domain Variable modules.
We got a lot of error/notice messages, so we digged in a bit with my collegue, and this is how we solved that:
in the locale_variable_language_default_element function of inc/locale.variable.inc at line
$element['#default_value'] = $element['#default_value']->language;we added an if() statement likeif (!empty($element['#default_value']->language)) { $element['#default_value'] = $element['#default_value']->language; }this is against the default value.
And in locale_variable_language_element_validate function we just replaced the line of
$form_state['values'][$element['#name']] = $languages[$form_state['values'][$element['#name']]];to$form_state['values']['variables']['regional_settings']['language_default'] = $languages[$element['#value']];this will place the object to the right place...
I haven't tried Patrick's patch, but smtg really has to be changed in locale.variable.inc to avoid these errors.
Comment #2
bforchhammer commentedThanks. Commited & pushed the patch #0.
@spike22: I did not see the mentioned notice anywhere, please let us know if it still needs to be fixed as well.