Skip to content

[5.4] Use correct language for autoupdate notification mails#46050

Merged
muhme merged 14 commits intojoomla:5.4-devfrom
SniperSister:54-autoupdate-notificationlanguage
Sep 11, 2025
Merged

[5.4] Use correct language for autoupdate notification mails#46050
muhme merged 14 commits intojoomla:5.4-devfrom
SniperSister:54-autoupdate-notificationlanguage

Conversation

@SniperSister
Copy link
Contributor

@SniperSister SniperSister commented Sep 9, 2025

Summary of Changes

The default admin language and the selected user language are correctly taken into consideration to determine the correct language for an autoupdate notification mail.

Testing Instructions

Actual result BEFORE applying this Pull Request

Notification mail is sent in EN, ignoring the selected default language.

Expected result AFTER applying this Pull Request

Notification mail is sent in the selected non-en language.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@brianteeman
Copy link
Contributor

have you got the before and after the wrong way around?

@SniperSister
Copy link
Contributor Author

@brianteeman good catch. Lesson learned: FIRST coffee, THEN code.

@richard67 richard67 added the bug label Sep 9, 2025
@tecpromotion
Copy link
Contributor

I have tested this item ✅ successfully on 8d16414


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46050.

@joomdonation
Copy link
Contributor

From what I see, the change here is not enough yet. You would need to do the same with how we handle mail template language in User - Joomla plugin https://github.com/joomla/joomla-cms/blob/5.4-dev/plugins/user/joomla/src/Extension/Joomla.php#L216-L228

My quick test with current code:

  • Site is in English language
  • Configure two users receive email with Backend Language set to German

Result:

  • Only first user receives email in German
  • The second user (and everyone after that) still receive email in English

@richard67
Copy link
Member

@tecpromotion Could you test again and in addition test also the scenario described in @joomdonation 's comment #46050 (comment) ? Thanks in advance.

@richard67
Copy link
Member

@SniperSister Now PHPStan complains about direct access to the $language property of the Factory class. Could you change that? If it is not possible or reasonable to change it, you have to update the phpstan-baseline.neon file with ./libraries/vendor/bin/phpstan -b to add exclusions for these cases.

@tecpromotion
Copy link
Contributor

I have tested this item ✅ successfully on 6c08ecf


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46050.

@tecpromotion
Copy link
Contributor

I have tested this with several languages.
For the German language, we have a total of 5 language packs:

  • de-de
  • de-at
  • de-ch
  • de-li
  • de-lu

I then changed the subject line in the emails and received different emails.

@SniperSister
Copy link
Contributor Author

Done @richard67

@richard67
Copy link
Member

Done @richard67

@SniperSister Where?

@SniperSister
Copy link
Contributor Author

Here.

@richard67
Copy link
Member

I've restored the previous human test result in the issue tracker as the commits which have invalidated the test count were just a change of the phpstan baseline file and code style.

@richard67
Copy link
Member

@SniperSister Can it be tested by using the first code snippet from the testing instructions of PR #45721 to trigger the notification mail?

@SniperSister
Copy link
Contributor Author

@richard67 the code snippet, an API call, or reaching out to me - whatever works :)

@joomdonation
Copy link
Contributor

@SniperSister Can it be tested by using the first code snippet from the testing instructions of PR #45721 to trigger the notification mail?

I also used that instructions for testing.

…onModel.php

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@SniperSister
Copy link
Contributor Author

SniperSister commented Sep 10, 2025

I also used that instructions for testing.

Admin Application and API application differ in setup, might be worth to actually trigger the notification via curl instead to make sure the app context does not influence the result:

curl --location --request POST 'http//YOUR_SITE/api/index.php/v1/joomlaupdate/notificationSuccess' --header 'X-JUpdate-Token: YOUR_UPDATE_TOKEN'

@joomdonation
Copy link
Contributor

It really depends on the active language of the current running application. The issue will happen if:

  • The user language is the same with the language of the current running application
  • And the backend language is different

I do not understand how the auto update trigger that email yet but I can see the potential issue by reading logic the code. But if no one else see the issue, you can ignore it.

@joomdonation
Copy link
Contributor

I have not tested this item.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46050.

@tecpromotion
Copy link
Contributor

It really depends on the active language of the current running application. The issue will happen if:

  • The user language is the same with the language of the current running application
  • And the backend language is different

I do not understand how the auto update trigger that email yet but I can see the potential issue by reading logic the code. But if no one else see the issue, you can ignore it.

I have expanded my test scenario.

I now have six differently configured users.
The starting point is an English backend
One user now uses the backend default language and also receives the email in English.
One user has explicitly set English as the backend language and also receives the email in English.
One user has de-DE as their language and receives the email in German (de-de).
One user has de-AT as their language and receives the email in German (de-at).
One user has de-CH as their language and receives the email in German (de-ch).

@joomdonation which case is not covered and can be tested by me?

@joomdonation
Copy link
Contributor

@tecpromotion Please try with the case :

  • Backend set to German
  • Only one active super user account
  • That user account has backend language set to English

I'm unsure if you can re-procedure the issue because as I said, I test it by calling the code to send notification directly as described in #45721 (So I logged in using the super user account to trigger the code, mean the active application at that time running on English)

@tecpromotion
Copy link
Contributor

@tecpromotion Please try with the case :

  • Backend set to German
  • Only one active super user account
  • That user account has backend language set to English

I'm unsure if you can re-procedure the issue because as I said, I test it by calling the code to send notification directly as described in #45721 (So I logged in using the super user account to trigger the code, mean the active application at that time running on English)

  • Backend set to German
  • Only one active super user account
  • That user account has backend language set to English

Result: The email is in German (default backend language), but the only user has English as the backend language in their profile.

…onModel.php

Co-authored-by: Tuan Pham Ngoc <github@joomdonation.com>
@SniperSister
Copy link
Contributor Author

thx @joomdonation

@richard67
Copy link
Member

@joomdonation Could you give it a final test and submit a test result?

@tecpromotion Could you submit a test result? I assume you have already tested with the latest change.

@joomdonation
Copy link
Contributor

I have tested this item ✅ successfully on b3393a4


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46050.

@tecpromotion
Copy link
Contributor

If you also want the versions to be displayed in the update email, you can use this command.

curl --location --request POST 'https://YOUR_SITE/api/index.php/v1/joomlaupdate/notificationSuccess' \
--data '{"toVersion":"5.4.115","fromVersion":"5.4.105"}' \
--header 'X-JUpdate-Token: YOUR_UPDATE_TOKEN'

@tecpromotion
Copy link
Contributor

I have tested this item ✅ successfully on b3393a4

The final test has now worked with several variants in the language pack configuration.

Thanks @joomdonation and everyone else.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46050.

@tecpromotion
Copy link
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46050.

1 similar comment
@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46050.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 10, 2025
@muhme
Copy link
Contributor

muhme commented Sep 11, 2025

Final test before merge with manual installation in public available site

  • With Nightly Build
    • The test instruction was slightly modified to cause a failed update and prevent the PR from being overinstalled. The apache user has been denied write permission for files: chown -R root:root public_html
    • Problem reproduced with setting Administrator default language as German > Email sent in English
  • With PRs full package
    • Setting Administrator default language as German > Backend is German
      • ✅ Enabled Automated Updates > Automated Update failed email is sent in German
    • Disabled Automated Updates, created users (system-emails enabled, Super Users group) heiko with explicit German set as backend language and gary with backend language explicit set to English and enabled Automated Updates
      • ✅ The email about the failed Automated Update is sent to admin and heiko in German, and in English to gary
    • Disabled Automated Updates, Created system-emails enabled users richard (default backend language) and phil (explicit set backend language to English), created group 'update-to-be-informed' with the two users and configured 'update-to-be-informed' group and enabled Automated Updates
      • ✅ The email about the failed Automated Update is sent to richard in German, and in English to phil

@muhme muhme merged commit b143bf8 into joomla:5.4-dev Sep 11, 2025
40 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 11, 2025
@muhme muhme added this to the Joomla! 5.4.0 milestone Sep 11, 2025
@muhme
Copy link
Contributor

muhme commented Sep 11, 2025

Thank you @SniperSister for your contribution. Thank you @brianteeman, @joomdonation and @richard67 for supporting. Thank you @joomdonation and @tecpromotion for testing.

@joomdonation
Copy link
Contributor

I made PR #46071 to clean up/improve code further. As you are familiar with update notification email, it would be great if you can help testing it @tecpromotion, @muhme. Thanks !

dgrammatiko pushed a commit to dgrammatiko/joomla-cms that referenced this pull request Jan 25, 2026
…46050)

* Use correct default admin language for update notification mails

---------

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Tuan Pham Ngoc <github@joomdonation.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants