User tests: Successful: Unsuccessful:
Pull Request for Issue #46318
Insert tags into any email templates, written in upper or lower case. They should now work regardless of case.
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.
Now tags work regardless of being written in lower or upper case. E.g. {sitename} will now work the same way as {SITENAME}.
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
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
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..
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! )
I have tested this item ✅ successfully on 614c576
C:\xampp\htdocs\joomlapbf\libraries\src\Mail\MailTemplate.php
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
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.
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.
I have successfully tested this item.
| Labels |
Added:
PR-5.4-dev
|
||
Removed the closures, functionality should be unchanged.
please remove the unrelated ai generated code changes and just stick to fixing the issue