Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: notification: error 500 in fixed emails due to a bad copy/paste #29580

Merged
merged 2 commits into from
May 3, 2024

Conversation

marc-dll
Copy link
Contributor

@marc-dll marc-dll commented May 2, 2024

The fixed e-mails are not translated but #29407 copy/pasted code from per-user notifications, that do use variable $outputlangs

}
if (!empty($mailTemplateLabel) && is_object($emailTemplate) && $emailTemplate->id > 0) {
// Set output language
$outputlangs = $langs;
if ($obj->default_lang && $obj->default_lang != $langs->defaultlang) {
Copy link
Member

@eldy eldy May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing the use of the recipient user language ?
Can you check the alternative fix I pushed is ok for you ? (fdb63a6)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eldy Your fix doesn't seem right to me as $obj too doesn't exist in this context (this code has been copy/pasted from ~200 lines above by the contributer of PR #29407 but not thouroughly adapted to the context).

Those mails are target to a fixed list of email addresses set in module settings, and not to Dolibarr users, so there is no way the get a custom language from. The translation of the mail body in the block of code above my fix use $langs and not $outputlangs anyway, and as far as I understand, this is the right thing to do.

Copy link
Member

@eldy eldy May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right $obj must be replaced with $object
Done this way in fix in develop branch.

eldy added a commit that referenced this pull request May 2, 2024
@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label May 2, 2024
@eldy eldy merged commit 3258b00 into Dolibarr:16.0 May 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants