From 63a288c1010754852473d448703304d36a30854a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=82phane=20Veyret?= Date: Thu, 10 Feb 2011 14:58:57 +0100 Subject: [PATCH] 12759: Error loading language string when plugin is not current --- core/plugin_api.php | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/plugin_api.php b/core/plugin_api.php index e4188f8..cdeaae0 100644 --- a/core/plugin_api.php +++ b/core/plugin_api.php @@ -228,15 +228,18 @@ function plugin_config_defaults( $p_options ) { * @return string Language string */ function plugin_lang_get( $p_name, $p_basename = null ) { - if( is_null( $p_basename ) ) { - $t_basename = plugin_get_current(); - } else { - $t_basename = $p_basename; + if( !is_null( $p_basename ) ) { + plugin_push_current( $p_basename ); } + $t_basename = plugin_get_current(); $t_name = 'plugin_' . $t_basename . '_' . $p_name; + $t_string = lang_get( $t_name ); - return lang_get( $t_name ); + if( !is_null( $p_basename ) ) { + plugin_pop_current(); + } + return $t_string; } function plugin_history_log( $p_bug_id, $p_field_name, $p_old_value, $p_new_value = '', $p_user_id = null, $p_basename = null ) { -- 1.7.1