Skip to content

Commit

Permalink
Make sure that thirdparty is actually loaded before using it's countr…
Browse files Browse the repository at this point in the history
…y for lang (#32107)
  • Loading branch information
dbeniamine authored Nov 27, 2024
1 parent 13b8f5f commit d2d592e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions htdocs/adherents/class/adherent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3105,11 +3105,14 @@ public function sendReminderForExpiredSubscription($daysbeforeendlist = '10', $f
$nbko++;
$listofmembersko[$adherent->id] = $adherent->id;
} else {
$adherent->fetch_thirdparty();

// Language code to use ($languagecodeformember) is default language of thirdparty, if no thirdparty, the language found from country of member then country of thirdparty, and if still not found we use the language of company.
$languagefromcountrycode = getLanguageCodeFromCountryCode($adherent->country_code ? $adherent->country_code : $adherent->thirdparty->country_code);
$languagecodeformember = (empty($adherent->thirdparty->default_lang) ? ($languagefromcountrycode ? $languagefromcountrycode : $mysoc->default_lang) : $adherent->thirdparty->default_lang);
$thirdpartyres = $adherent->fetch_thirdparty();
if ($thirdpartyres === -1 ) {
$languagecodeformember = $mysoc->default_lang;
} else {
// Language code to use ($languagecodeformember) is default language of thirdparty, if no thirdparty, the language found from country of member then country of thirdparty, and if still not found we use the language of company.
$languagefromcountrycode = getLanguageCodeFromCountryCode($adherent->country_code ? $adherent->country_code : $adherent->thirdparty->country_code);
$languagecodeformember = (empty($adherent->thirdparty->default_lang) ? ($languagefromcountrycode ? $languagefromcountrycode : $mysoc->default_lang) : $adherent->thirdparty->default_lang);
}

// Send reminder email
$outputlangs = new Translate('', $conf);
Expand Down

0 comments on commit d2d592e

Please sign in to comment.