No Code Attached Yet
avatar Razzo1987
Razzo1987
13 Apr 2024

Steps to reproduce the issue

  1. Create 2 different user, both with "Receive System Emails" enabled.
  2. Form one user send a Private Message to the other
  3. Insert an image in the message body (eg. https://<your joomla>/images/sampledata/cassiopeia/nasa1-1200.jpg):
    image
  4. Send the message
  5. Check your inbox mail
  6. Logout and login thi the oter user
  7. Check your Private Messages

Expected result

  1. Mail have the image
  2. Private Messages must have the image

Actual result

  1. Mais haven't the image:
    image
  2. your Private Messages have the wrong image url
    image

System information (as much as possible)

Joomla 5.1.0-rc2

Additional comments

The image url does not have the initial /
image
If the URL begins without a slash, it will be relative to the current page. Example: src="img_girl. jpg". If the URL begins with a slash, it will be relative to the domain.

@brianteeman It could be related to PR #42448 ?

avatar Razzo1987 Razzo1987 - open - 13 Apr 2024
avatar joomla-cms-bot joomla-cms-bot - change - 13 Apr 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Apr 2024
avatar Razzo1987 Razzo1987 - change - 13 Apr 2024
The description was changed
avatar Razzo1987 Razzo1987 - edited - 13 Apr 2024
avatar Razzo1987 Razzo1987 - change - 13 Apr 2024
The description was changed
avatar Razzo1987 Razzo1987 - edited - 13 Apr 2024
avatar Razzo1987 Razzo1987 - change - 13 Apr 2024
The description was changed
avatar Razzo1987 Razzo1987 - edited - 13 Apr 2024
avatar brianteeman
brianteeman - comment - 13 Apr 2024

#42448 was about adding images etc to the mail TEMPLATE so that you can do some branding
What you are talking about here is adding an image to the private message. Different thing

avatar Razzo1987
Razzo1987 - comment - 14 Apr 2024

Ok, is different bug :(

avatar Kubik-Rubik
Kubik-Rubik - comment - 15 Apr 2024

This is not a bug of the Messaging component but a feature provided by the TinyMCE editor to convert absolute URLs to relative URLs.

To "fix" this issue, go to "System" - "Plugins" - "Editor TinyMCE" and set the option URLs to Absolute:

grafik
avatar brianteeman
brianteeman - comment - 15 Apr 2024

Sorry but that is not correct for this. Making that change will change it everywhere not just in private messages.

avatar Kubik-Rubik
Kubik-Rubik - comment - 15 Apr 2024

Yes, you are right. I explained the reason for this behaviour.

We need to apply the same logic for such relative URLs as we do in the SEF plugin (add the base path if required - \Joomla\Plugin\System\Sef\Extension\Sef::onAfterRender).

avatar brianteeman
brianteeman - comment - 15 Apr 2024

The correct way to address this is in the messaging component where the editor is rendered. Too late for me to write tested and working code but it would be something like

$params = ['relative_urls' => 'true']
$content = $editor->display($name, $content , $width, $height, $col, $row, true, $id, null, null, $params);
avatar Hackwar
Hackwar - comment - 5 Aug 2024

Actually we have to apply the logic of the SEF plugin partially to the output. Setting this option for tinymce will break the moment people use a different editor. Basically we have to copy the code to make the URLs absolute from the SEF plugin to the output of the message. Any takers?

avatar Quy Quy - close - 8 Aug 2024
avatar Quy Quy - change - 8 Aug 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-08-08 16:01:29
Closed_By Quy
avatar Quy
Quy - comment - 8 Aug 2024

Please test PR #43897. Thanks.

Add a Comment

Login with GitHub to post a comment