Pending

User tests: Successful: Unsuccessful:

avatar bembelimen
bembelimen
15 Nov 2025

Summary of Changes

When extending the MailTemplate class with my own implementation to override the getTemplate(...) method. The send(...) method is still using the original method.

Testing Instructions

Create the file libraries/src/Mail/MailTemplateExtended.php with the following code:

<?php

namespace Joomla\CMS\Mail;

\defined('_JEXEC') or die;

class MailTemplateExtended extends MailTemplate
{
    public static function getTemplate($key, $language)
    {
        exit('hello world');
    }
}
  • Initialize the new class:
$mailtemplate = new MailTemplateExtended('com_messages.new_message', 'en-GB');
$mailtemplate->addRecipient('test@example.com');
$mailtemplate->send();

Actual result BEFORE applying this Pull Request

The old getTemplate is called.

Expected result AFTER applying this Pull Request

The script stops with "hello world", which means, the new method is called.

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 bembelimen bembelimen - open - 15 Nov 2025
avatar bembelimen bembelimen - change - 15 Nov 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Nov 2025
Category Libraries
avatar bembelimen bembelimen - change - 15 Nov 2025
The description was changed
avatar bembelimen bembelimen - edited - 15 Nov 2025
avatar TLWebdesign TLWebdesign - test_item - 15 Nov 2025 - Tested successfully
avatar TLWebdesign
TLWebdesign - comment - 15 Nov 2025

I have tested this item ✅ successfully on 58b5996


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

avatar alikon alikon - test_item - 16 Nov 2025 - Tested successfully
avatar alikon
alikon - comment - 16 Nov 2025

I have tested this item ✅ successfully on 58b5996


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

avatar alikon alikon - change - 16 Nov 2025
Status Pending Ready to Commit
avatar alikon
alikon - comment - 16 Nov 2025

RTC


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

avatar richard67 richard67 - change - 16 Nov 2025
Title
[5.4.] Fix static getTemplate call in mail template
[5.4] Fix static getTemplate call in mail template
avatar richard67 richard67 - edited - 16 Nov 2025
avatar bembelimen bembelimen - change - 16 Nov 2025
The description was changed
avatar bembelimen bembelimen - edited - 16 Nov 2025

Add a Comment

Login with GitHub to post a comment