Skip to content

Conversation

@e4e5Ke2
Copy link

@e4e5Ke2 e4e5Ke2 commented Jan 30, 2026

Pull Request for Issue #46318

Summary of Changes

  • Made the replaceTags method (of MailTemplate.php) case insensitive
    - Simplified some redundant code in said method with a closure

Testing Instructions

Insert tags into any email templates, written in upper or lower case. They should now work regardless of case.

Actual result BEFORE applying this Pull Request

E.g. the tag {sitename} as part of a mail template did not work. Only in upper case the tag {SITENAME} gets replaced with a value.

Expected result AFTER applying this Pull Request

Now tags work regardless of being written in lower or upper case. E.g. {sitename} will now work the same way as {SITENAME}.

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

please remove the unrelated ai generated code changes and just stick to fixing the issue

@e4e5Ke2
Copy link
Author

e4e5Ke2 commented Jan 30, 2026

Yeah, I didnt use AI for anything.. just saw a simplification since I was touching this method anyways. I'd be happy to contribute more fixes in the future, but not sure I like the tone here..

@exlemor
Copy link

exlemor commented Jan 30, 2026

Yeah, I didnt use AI for anything.. just saw a simplification since I was touching this method anyways. I'd be happy to contribute more fixes in the future, but not sure I like the tone here..

Hi @e4e5Ke2,

Welcome! Thank you for your 1st contribution to Joomla!

Please join us on Mattermost and get to know the Community!

( The AI comment wasn't meant negatively. Hope that you get to know Joomla coding standards, to exchange with you in Mattermost, to seeing you during PBF tomorrow and to your future participation! Cheers! )

@465645
Copy link

465645 commented Jan 31, 2026

I have tested this item ✅ successfully on 614c576

C:\xampp\htdocs\joomlapbf\libraries\src\Mail\MailTemplate.php


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

@465645
Copy link

465645 commented Jan 31, 2026

I have tested this item ✅ successfully on 614c576

C:\xampp\htdocs\joomlapbf\libraries\src\Mail\MailTemplate.php
This single-line change wraps the $key variable with strtoupper() to convert tag keys to uppercase before creating the placeholder pattern. This ensures that:

Tag keys are normalized to uppercase (e.g., 'sitename' becomes 'SITENAME')
The placeholder pattern becomes {SITENAME} regardless of how the key was originally defined
str_ireplace() can then match {SITENAME}, {sitename}, {SiteName}, etc. in the template text


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

@Simran2525-eng
Copy link

I have not tested this item.

Tested this patch on Joomla 5.4-dev.

Before applying the patch, only uppercase email template tags like {SITENAME} worked.
After applying the patch, tags work correctly in both uppercase and lowercase
(e.g. {SITENAME}, {sitename}).

Patch works as expected. Test successful.


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

@Simran2525-eng
Copy link

I have tested this item ✅ successfully on 614c576

Tested this patch on Joomla 5.4-dev.

Before applying the patch, only uppercase email template tags like {SITENAME} worked.
After applying the patch, tags work correctly in both uppercase and lowercase
(e.g. {SITENAME}, {sitename}).

Patch works as expected. Test successful.


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

@dusries
Copy link

dusries commented Jan 31, 2026

I have successfully tested this item.


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

@e4e5Ke2
Copy link
Author

e4e5Ke2 commented Jan 31, 2026

Removed the closures, functionality should be unchanged.

@richard67 richard67 added the RMDQ ReleaseManagerDecisionQueue label Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-5.4-dev RMDQ ReleaseManagerDecisionQueue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants