Permalink
Browse files

12759: Error loading language string when plugin is not current

Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
  • Loading branch information...
sveyret authored and dregad committed Feb 10, 2011
1 parent e39645d commit 9dda347b2b87f91b7432319582d064d38cd99f91
Showing with 8 additions and 5 deletions.
  1. +8 −5 core/plugin_api.php
View
@@ -243,15 +243,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 ) {

0 comments on commit 9dda347

Please sign in to comment.