summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Reyero2008-09-25 18:56:22 (GMT)
committer Jose Reyero2008-09-25 18:56:22 (GMT)
commitb28c2734e850463c76e92ec38416b149e07bf305 (patch)
tree88270fabbe12c50f826116a74ce588b47d1e5680
parente00e546d3d9785a92ada30b7faa080b555b16a28 (diff)
- Fixed issue with language dependent front page, that couldn't be used before
-rw-r--r--CHANGELOG.txt2
-rw-r--r--i18n.module20
2 files changed, 16 insertions, 6 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 1b39466..c27215a 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -9,9 +9,9 @@ TO DO
6.x-beta3 to 6.x-beta4
----------------------
+- Fixed issue with language dependent front page, that couldn't be used before
- Fixed postgresql compatibility issue, by miopa, #308554
- Fixed profile category string issues, #304451
-
- Renamed some modules, updated descriptions
- Fixed / improved some module help texts.
- Fixed multiple localization issues, by hass, #310852
diff --git a/i18n.module b/i18n.module
index c513574..c17dba7 100644
--- a/i18n.module
+++ b/i18n.module
@@ -24,12 +24,20 @@ define('LANGUAGE_SUPPORT_EXTENDED', 2);
*
* Will initialize language dependent variables
* Modify rewriting conditions when viewing specific nodes
+ *
+ * Special fix for site_frontpage, that may have been used before the language variables are loaded
*/
function i18n_init(){
// If not in bootstrap, variable init
if(!_i18n_is_bootstrap()){
- //include drupal_get_path('module', 'i18n').'/i18n.inc';
- i18n_variable_init();
+ $default_frontpage = variable_get('site_frontpage', 'node');
+
+ i18n_variable_init();
+
+ // Now we check whether this is the frontpage and it should be a different one
+ if ($default_frontpage != variable_get('site_frontpage', 'node') && $_GET['q'] == drupal_get_normal_path($default_frontpage)) {
+ $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node'));
+ }
}
}
@@ -585,18 +593,20 @@ function i18n_variable_form_submit($form, &$form_state) {
* @param $prefix
* Variable name prefix to load just a selected group of variables
*/
-function i18n_variable_init($language = NULL, $prefix = ''){
+function i18n_variable_init($langcode = NULL, $prefix = ''){
global $conf;
global $i18n_conf;
- $language = $language ? $language : i18n_get_lang();
+
+ $langcode = $langcode ? $langcode : i18n_get_lang();
if ($i18n_variables = variable_get('i18n_variables', '')){
if (!$i18n_conf) {
$i18n_conf = array();
}
- $variables = _i18n_variable_init($language, $prefix);
+ $variables = _i18n_variable_init($langcode, $prefix);
foreach($i18n_variables as $name){
$i18n_conf[$name] = isset($variables[$name]) ? $variables[$name] : (isset($conf[$name]) ? $conf[$name] : '');
}
+
$conf = array_merge($conf, $i18n_conf);
}
}