Skip to content

[4.2] Fix MailTemplate array regression from 4.2.7#39850

Merged
fancyFranci merged 2 commits intojoomla:4.2-devfrom
ManuelHu:fix-39774
Feb 22, 2023
Merged

[4.2] Fix MailTemplate array regression from 4.2.7#39850
fancyFranci merged 2 commits intojoomla:4.2-devfrom
ManuelHu:fix-39774

Conversation

@ManuelHu
Copy link
Contributor

@ManuelHu ManuelHu commented Feb 12, 2023

Pull Request for Issue #39774.

Summary of Changes

PR #38305 changed the logic for array values in mail templates. That PR "fixed" the output of plain arrays, dismissing that core actually uses arrays in a different way, by using nested template tags.

One feature where nested tags are used are the user information emails, and thus they are broken since 4.2.7.

This PR restores the old behavior, but only if the new one is not used. As described by @ReLater in 39774, this fixes the mails not working (on my sites, with default templates) - and it also doesn't break the use-case of the changes in 4.2.7.

Additional remarks on #38305

Note: I find the changes in #38305 confusing as is breaks the current semantics of templates: beforehand, only text in curly braces was treated as "key", and now also text outside of them. imho, {com_fields}{xyz}{/com_fields} would have been better than the syntax {com_fields}xyz{/com_fields} as implemented by #38305...

I suppose the decision on how to put forward the mail templating "language" is not on me, but this PR at least unbreaks old functionality and does not introduce b/c problems to 4.2.7.

Testing Instructions

  • Install joomla 4.2.7
  • Make sure action logs for user events are enabled and configure working system email sending
  • In the user settings for a user with a valid email address (you can receive mail on), enable user action information emails for the user component.
  • Log out and log back in
  • Look at the emails you should have received

Actual result BEFORE applying this Pull Request

  • You get information emails about user activity, but they only contain the table header and no specific contents,

Expected result AFTER applying this Pull Request

  • You get information emails that also contain information about the user action (like <=4.2.6)

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

@toivo
Copy link
Contributor

toivo commented Feb 13, 2023

I have tested this item ✅ successfully on e349ab4

Tested successfully in Joomla 4.2.8-dev of 13 February in Wampserver 3.2.9 using PHP 8.1.10


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

@viocassel
Copy link
Contributor

I have tested this item ✅ successfully on e349ab4


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

@Quy
Copy link
Contributor

Quy commented Feb 13, 2023

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 13, 2023
@fancyFranci fancyFranci merged commit 77736a9 into joomla:4.2-dev Feb 22, 2023
@fancyFranci fancyFranci added this to the Joomla! 4.2.9 milestone Feb 22, 2023
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 22, 2023
@fancyFranci
Copy link
Contributor

Thank you for bringing this back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

Comments