From 024676efb960d83895c24d24544ed57a76e79d15 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 9 Aug 2007 19:06:13 +0000 Subject: [PATCH] r1600: Merging r1599 from trunk to fix bug://report/97 --- docs/changes.txt | 1 + includes/class_notification.php | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 79717ba..6eb9d96 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -4,6 +4,7 @@ - Fixed: Users could not be approved due to a improper email template paths - Fixed: After mass-updating a search result set, if the search criteria were changed the user would be stuck in a "no results" error (bug://report/93) - Change: Do not show the version number on non-admin pages (bug://report/95) +- Fixed: If a user has set a language that does not exist anymore, then bug notifications would fail (bug://report/97) 1.2.1 =============================== diff --git a/includes/class_notification.php b/includes/class_notification.php index 6309ea8..ce043c7 100644 --- a/includes/class_notification.php +++ b/includes/class_notification.php @@ -616,10 +616,12 @@ class NotificationCenter */ function _localeFromUserId($userid) { - $langid = $this->users[$userid]['languageid']; - $langid = (!$langid ? $this->registry->options['defaultlanguage'] : $langid); - - return $this->registry->datastore['language'][$langid]['langcode']; + $langcode = $this->registry->datastore['language'][$this->users[$userid]['languageid']]['langcode']; + if (!$langcode) + { + $langcode = $this->registry->datastore['language'][$this->registry->options['defaultlanguage']]['langcode']; + } + return $langcode; } } -- 2.43.5