User should recive mails in the account preferred language. This affects to i18n_user module

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

akalam created an issue. See original summary.

akalam’s picture

akalam’s picture

Status: Active » Needs review
joseph.olstad’s picture

reviewed, made a change, if the user preferred language is not set then use language_default()

  • joseph.olstad committed fbdaa8d on 7.x-1.x authored by akalam
    Issue #2912113 by akalam, joseph.olstad: User should recive mails in the...
joseph.olstad’s picture

Status: Needs review » Fixed

  • joseph.olstad committed 7692f83 on 7.x-1.x authored by akalam
    Issue #2912113 by akalam, joseph.olstad: User should recive mails in the...

  • joseph.olstad committed 66ffc73 on 7.x-1.x
    Issue #2841943 by joseph.olstad, commonpike, akalam: Issue #2912113...
joseph.olstad’s picture

got a little more timid on this change,
message language, otherwise user preferred language and if not defined, then site default language

sano’s picture

I am getting an error after installing the 7.x-1.20 version:

( ! ) Fatal error: Cannot use isset() on the result of a function call (you can use "null !== func()" instead) in /var/www/rovdev/sites/all/modules/i18n/i18n_user/i18n_user.module on line 13

I fixed it by creating a variable for the user_preferred_language($message['params']['account']) call and then changed the isset to test that variable. I can produce a patch, but it will take me a while as I am a noob at that. Let me know if interested.

ansgar’s picture

I got the same error when updating on 1.20.

Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) in ... /i18n/i18n_user/i18n_user.module on line 13

Is the suggestion in the error message a solution?

 if ($message['module'] == 'user') {
    $user_preferred = language_default();
    if (null !== user_preferred_language($message['params']['account'])) {
      $user_preferred = user_preferred_language($message['params']['account']);
    }
joseph.olstad’s picture

Status: Fixed » Needs work

yes sorry, fix comming shortly.

  • joseph.olstad committed 8146a3f on 7.x-1.x authored by sano
    Issue #2912113 by akalam, joseph.olstad, sano, ansgar: User should...
joseph.olstad’s picture

Status: Needs work » Fixed

  • joseph.olstad committed 07fb6c0 on 7.x-1.x
    Issue #2912113 by akalam, joseph.olstad, sano, ansgar: User should...
joseph.olstad’s picture

fixed in release 7.x-1.22 , I put an extra check in the dev branch for next release but should work either way.

Status: Fixed » Closed (fixed)

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

akalam’s picture

FileSize
1.27 KB

Please reopen. In last dev fails when you try to recover password. Then the mail is sent in the current language, not in the user preferred

joseph.olstad’s picture

Status: Closed (fixed) » Needs review

  • joseph.olstad committed c5e9cde on 7.x-1.x authored by akalam
    Issue #2912113 by akalam: User should recive mails in the account...
joseph.olstad’s picture

Status: Needs review » Fixed

fixed in 7.x-1.x dev branch

Status: Fixed » Closed (fixed)

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