I'm not really using the language feature, I have the Locale and thus get the English language setup. That's it. Yet, I get an E_NOTICE in the module on this line:

$languages = $languages['name'];

So I looked at the code and noticed that (1) the global variable $language was not always restored as expected and (2) that the statement that I just shown here was setting $languages instead of $language (notice the extra 's'?)

I'm not too sure I'm 100% right on this one since I'm not so sure you really need to get the language at that point since you overwrite the variable later in two different places. So... I think that the whole thing should be removed:

  [...]
  $initial_language = $language;

  // Is that needed at all?! and what represents $languages['name'] anyway?
  //if (function_exists('locale')) {
  //  $languages = locale_language_list();
  //  if (isset($languages['name'])) {
  //    $language = $languages['name'];
  //  }
  //}

  $node = node_load($nid);
  [...]

At this point the proposed patch does not remove that if() block, but it really feels like it's wrong.

CommentFileSizeAuthor
comment_notify-6.x-language.patch882 bytesAlexisWilke

Comments

greggles’s picture

Status: Needs review » Fixed

This looks good to me. I also don't use that feature but at least there is logic on your side ;)

I've committed it which will get it into the dev where folks will test it and hopefully in a month or so I'll do a new release. http://drupalcode.org/project/comment_notify.git/commit/c95c1f2

Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.