User tests: Successful: Unsuccessful:
Pull Request for Issue #35940.
Currently, if an image contain space in filename is selected in a media form field, it won't be rendered properly. The reason is because media manager encode the filename (replace space character with %20), and that file could not be found by php is_file
function. This PR attempts to solve it by replacing %20 back to space before is_file
check.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
@brianteeman I don't look at the code carefully enough to be sure. However, we use same logic to find css and js file, too.
is_file check is needed so that if Joomla could not find .min file (for css and js), it will use none minified files.
yes but why use it for this image here and not on similar fields. intro and full image both work perfectly with an image with a space in the name that fails in com_contacts.
Ah, I see. For article, we use different method to rendering image (not use HTMLHelper::_('image') like in com_contact
The issue in com_contact should be sorted by #35780 . However, I will still leave the PR here in case we want to fix issue if someone stills use HTMLHelper::_('image') in their extension.
I usually never put any spacing in image files. For this Issue I did.
a) within article:
<p>change text</p>
<p>change text change - change text.</p>
<p><img src="/mysite/images/test/schau%20mal%20test.jpg" alt="schau mal test" width="525" height="700"></p> </div>`
```<div class="com-contact__thumbnail thumbnail">
<img src="/mysite/images/test/schau mal test.jpg" alt="name" itemprop="image">
<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/35948">issues.joomla.org/tracker/joomla-cms/35948</a>.</sub>
sorry, hv problems with the markup :-) continue 1:
b) within contact formular:
<img src="/mysite/images/test/schau mal test.jpg" alt="name" itemprop="image"><hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/35948">issues.joomla.org/tracker/joomla-cms/35948</a>.</sub>
continue 2-summary:
Images are not broken. But I think, it belongs to linux (broken images) and not to windows.
So, tried PR with a) but there is no difference. Still having 20% (article)
@ChristineWk For contact, without this PR, the markup is something like
<img src="/joomla4/" alt="Image With Space" itemprop="image">
So image won't be displayed. After the PR, the mark up will be:
<img src="/joomla4/images/space%20in%20filename.jpg" alt="Image With Space"" itemprop="image">
So without the PR, image is not being displayed. But with pr, it is displayed.
thank you for your informations.
Without the PR, image is displayed/shown (file with spaces):
What shall I do :-)
To be sure:
Always thought the opposite: on Linux: no (maybe in generell) on Windows yes (OK).
Do you mean server from the hoster or PC?
Do you mean server from the hoster or PC?
It's the server which the site is hosted.
OK, will check :-)
@ChristineWk Thanks. Seems a windows issue, then.
Using J4.1.0dev on WAMP running on a Windows 10 box with php8.11 I cannot replicate the issue. The contact thumb displays fine without the PR patch applied.
@Abernyte-Git but does it display in the front end?
Strange. I thought it might relate to PHP version, so I switched to use PHP 8 but it is still not working for me without the patch. I'm unsure why it works for you two but not for me.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
@khu5h1 your image has no space in the filename.
I have tested this item
I have tested this item
I have tested this item
I'm not sure if this fix is correct, because %20 means it's urlencoded and a simple %20 to space convert wouldn't cover all other urlencoded charters.
@HLeithner Just for information, the space to %20 is handled in local adapter plugin https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/filesystem/local/src/Adapter/LocalAdapter.php#L754 , and that's the reason I only do simple %20 to space convert in this PR.
The problem in that case is other adapters aren't going to have that encoding which compounds the problem. Somehow we're going to have to push in the non-encoded paths into this function rather than trying to fix it in this function
Status | Ready to Commit | ⇒ | Pending |
Status | Pending | ⇒ | Needs Review |
Labels |
Added:
?
?
|
Setting status "Needs Review" in the issue tracker.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-02-12 12:11:54 |
Closed_By | ⇒ | joomdonation | |
Labels |
Added:
?
Removed: ? |
why is it even doing an isfilecheck here and not in other places