bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar SniperSister
SniperSister
22 Jan 2025

Summary of Changes

The mail templates list view shows a list of all available templates from the #__mail_templates table. While doing so, it checks if the associated extension is enabled.

However, it uses the value of the "name" column in the #__extensions table for the subquery (which might hold a human-readable name and not the technical "element" name), causing templates to be not listed if the name and element of the associated extension do not align.

Testing Instructions

  • Temporarly change the value of the "name" column of com_contact in #__extensions from com_contact to Contact
  • List the available mail templates

Actual result BEFORE applying this Pull Request

  • com_contact templates missing

Expected result AFTER applying this Pull Request

  • com_contact templates listed

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

avatar SniperSister SniperSister - open - 22 Jan 2025
avatar SniperSister SniperSister - change - 22 Jan 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Jan 2025
Category Administration
avatar Hackwar Hackwar - change - 22 Jan 2025
The description was changed
avatar Hackwar Hackwar - edited - 22 Jan 2025
avatar richard67
richard67 - comment - 22 Jan 2025

Hmm, when filling the mail templates table for new installations it seems we are using the extensions name and not the element:

https://github.com/joomla/joomla-cms/blob/5.2-dev/installation/sql/mysql/supports.sql#L410-L440

So I'm not really sure if this PR is right or if it needs changes at additional places.

Pity that the extension column of the #__mail_templates is a string with a name or whatever else and not an integer with the extension ID (which would allow a foreign key whenever we will support that).

avatar SniperSister
SniperSister - comment - 22 Jan 2025

it seems we are using the extensions name and not the element:

Those are the elements? See the #__extensions table

avatar richard67
richard67 - comment - 22 Jan 2025

it seems we are using the extensions name and not the element:

Those are the elements? See the #__extensions table

Yes, because for components, modules and templates the name and the element columns have the same value in our installation SQL. For other modules they differ.

Are the extensions which can be assigned to mail templates restricted to certain types, e.g. components?

If so, it could make sense to add a restriction for that (WHERE type IN ...) to the where clause of the subquery which is modified by this PR.

avatar SniperSister
SniperSister - comment - 22 Jan 2025

Are the extensions which can be assigned to mail templates restricted to certain types, e.g. components?

Nope, basically anything works.

avatar HLeithner
HLeithner - comment - 15 Apr 2025

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 15 Apr 2025
Title
[5.2] Fix extension query in mailtemplates
[5.3] Fix extension query in mailtemplates
avatar HLeithner HLeithner - edited - 15 Apr 2025
avatar HLeithner
HLeithner - comment - 15 Oct 2025

This pull request has been automatically rebased to 5.4-dev.

avatar richard67 richard67 - change - 2 Nov 2025
Title
[5.3] Fix extension query in mailtemplates
[5.4] Fix extension query in mailtemplates
avatar richard67 richard67 - edited - 2 Nov 2025
avatar richard67 richard67 - change - 2 Nov 2025
Labels Added: bug PR-5.4-dev
avatar muhme muhme - test_item - 30 Jan 2026 - Tested unsuccessfully
avatar muhme
muhme - comment - 30 Jan 2026

I have tested this item 🔴 unsuccessfully on 27319fc

Tested with JBT

  • Before PR 28 mail templates are listed, changed table #__extensions, entry com_contact, field name from com_contact to Contact, only 26 mail templates are listed
  • Applied PR with Patch Tester
  • ❌ Only 24 mail templates are shown
  • Reverted #__extensions, entry com_contact, field name to com_contact, still 24 mail templates
  • Reverted PR and 28 templates are shown, difference (not found after PR) are:
    • plg_user_joomla.mail
    • plg_task_updatenotification.mail
    • plg_task_privacyconsent.request.reminder
    • plg_multifactorauth_email.mail

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44769.
avatar SniperSister SniperSister - change - 30 Jan 2026
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2026-01-30 17:38:56
Closed_By SniperSister
avatar SniperSister SniperSister - close - 30 Jan 2026

Add a Comment

Login with GitHub to post a comment