New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix actionlogs information emails containing HTML links #40033
Conversation
This pull request has been automatically rebased to 5.0-dev. No new features will be merged into Joomla! 4.3 series. Joomla! 4.4 series is a bridge release to make migration from Joomla! 4 to 5 as smooth as possible. |
From a users perspective I would not classify this a s a new feature, but I also don't want to argue about that :-) (From the code point of view it is a new feature...) To get this finally into 5.0, I would like to have some feedback if the slight b/c break here is accepatable:
|
This needed multiple changes: * MailTemplate now supports an extra set of replacement values for the plain-text mode. This will only be used if set explicitely, and will fall back to the old behaviour otherwise. The 'default' data and the plain data are _not_ merged. Callers have to ensure that both sets of values contain the same keys, or otherwise output might be missing. * ActionlogModel uses this new facility to provide values without HTML links. * ActionlogsHelper::getHumanReadableLogMessage already had a parameter $generateLinks, that did not do what was documented. It only controlled the conversion from relative to absolute URLs. Now it will also remove link tags from the message templates, if set to false.
Co-authored-by: Quy <quy@nomonkeybiz.com>
I have rebased this to the current 5.0-dev. Can someone test this that we can get this timely for 5.0? @Quy |
I have tested this item ✅ successfully on b8995aa This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40033. |
This pull request has been automatically rebased to 5.1-dev. |
I have tested this item ✅ successfully on b8995aa This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40033. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40033. |
Thanks you! |
Pull Request for Issue #39851. This is essentially my strategy "3" as outlined in the issue, with the difference that the two replacement arrays are not merged. As I did not receive any comments on the issue, I just went ahead to implement this solution....
Summary of Changes
This needed multiple changes:
MailTemplate
now supports an extra set of replacement values for the plain-text mode. This will only be used if set explicitely, and will fall back to the old behaviour otherwise. The 'default' data and the plain data are not merged. Callers have to ensure that both sets of values contain the same keys, or otherwise output might be missing.ActionlogModel
uses this new facility to provide values without HTML links.ActionlogsHelper::getHumanReadableLogMessage()
already had a parameter$generateLinks
, that did not do what was documented. It only controlled the conversion from relative to absolute URLs. Now it will also remove link tags from the message templates, if set to false.Note: This also affects the CSV export feature of the actionlogs components. Until now, the exported files contained relative urls in the administrator application (which is - I think - quite useless anyway). With this PR, links are also stripped. (This is the the only other call site that changed the value of
$generateLinks
to false.)Testing Instructions
Actual result BEFORE applying this Pull Request
Plain text emails contain HTML links
Expected result AFTER applying this Pull Request
Plain text emails do not contain HTML links and only the link text.
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