Media browser in modx 3.2 - not showing image thumbnails

Summary

media browser in modx 3.2 - not showing image thumbnails

Step to reproduce

upgrade to modx 3.2 and go to “media browser”. see screen shots. the thumbnails won’t display in the media browser. the website images are fine, but not the media browser. i also see a new padlock on rollover on the “Filesystem” title and link on the “media source” screen - i presume it is related as i have not seen that before and it appears just as there is a possible ‘permission’ issue on displaying images in the media browser.

Observed behavior

the site is fine, but the media browser does not have thumbnail images

Expected behavior

##########################

Environment

php 8.4 or 8.5 - the bug appears. modx 3.2 . i was not there in 3.1.2 and that “padlock” icon was a “black pen” so some new modx code has gone in here.

update: the bug appears in php 8.4 and php 8.5, but not! php 8.3 . i flicked between the php versions a few times and i see that php.8.3 is fine. the “padlock” icon still appears, which is fine when the thumbnails are working :slight_smile: . but there is definitely an image issue in /manager for php 8.4 and 8.5 . the user profile image (bottom left corner of modx 3.2 /manager screen) was not appear too.

I tested it with PHP 8.4, but I’m not able to reproduce the issue.

Can you open the developer tools in the browser and use the inspector to see what the generated thumbnail URL is (Something like /connectors/system/phpthumb.php?src=...&w=0&h=80&HTTP_MODAUTH=...&f=png&q=90&wctx=mgr&source=1&ar=x)?
When you open this URL in the browser, what is the response?

Thanks Harry

one of the images in that media browser screen which is not displaying is:

< img src=" /connectors/system/phpthumb.php?src=twitter2.png&w=0&h=111&HTTP_MODAUTH=modxzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz&f=jpg&q=90&wctx=mgr&source=1&t=1700987358&ar=x" loading=“lazy” width=“111” height=“111” alt=“twitter2.png” title=“twitter2.png” >

p.s. i had to put in a space above between “src=”" and “/connectors…” so that the html could be pasted into this text area

So what is the response when you call this URL? Is there some error message?
Maybe also check the Console and Network tabs of the developer tools in the browser.
Also, do any related error messages get added to the MODX error log?


You probably shouldn’t share the value of HTTP_MODAUTH. Please edit your post above.

Next time try using a code block to avoid issues:

```// line with 3 back-ticks at the beginning
// your code here
```// line with 3 back-ticks at the end

thanks Harry. i edited that html. i don’t know how to track down the error and the firefox and chrome developer screens are not showing any issues in the console or other tabs. i did notice that the “path” in the broken media browser screen has an issue which the working media browser screen does not. Attached are the 2 screens - one is a working media browser screen and the other is a non working media browser screen. in both cases i tried to rename the file and i see a file name ‘confusion’ in the broken media browser (php 8.4) – fyi, those files are in a folder called “gallery6” and modx is trying to use that folder name but modx also adds in extra characters i.e a space plus the file name. in the working media browser (pho 8.3) the "gallery6 folder is not mentioned, which is also curious for other reasons, but at least the media browser works and it displays the thumbnails.


So in the developer tools → tab “Network”, when you click on one of the thumbnail-image request that fails, what is in the “Response” tab on the right (see screenshot below)?

Thanks Harry

in chrome, i refreshed that media browser pages and loads of events are on display in the network area, but on the right in the “Issues” tab there are 2 issues:

"
Deprecated feature used
Unload event listeners are deprecated and will be removed.

1 source
ext-base.js:21
Learn more: Check the feature status page for more details.
"
and the link to that .js files is : https://bwdservices.ie/manager/assets/ext3/adapter/ext/ext-base.js

"
No label associated with a form field
A isn’t associated with a form field.

To fix this issue, nest the in the or provide a for attribute on the that matches a form field id.

3 resources
Learn more: The label elements
"

when i open the “3 resources” it says

"
Violating node
Violating node
Violating node
"

and when i click on each of the 3 violating nodes, it highlights 1 of 3 html lines on the left “elements” panel:

<label id="ext-comp-1022">Filter:</label>

<label id="ext-comp-1023">Sort By:</label>

<label id="ext-comp-1025">View:</label>

These seem to be some minor javascript issues unrelated to the image thumbnails.


Please look for the actual requests that are supposed to return the thumbnail images (as the problem seems to be, that the requests don’t return valid images.)
These requests show phpthumb.php?src=... in the “Name” column (Chrome) or “File” column (Firefox).

Then click on one of these requests and check the “Response” tab (that should show up on the right hand side).

Thanks Harry

there are loads of those lines and they are all appearing as “STATUS CODE: 200 OK” - HERE IS ONE OF THEM:

Request URL

https ://xxxxxxxxxxxxxxxxx.ie/connectors/system/phpthumb.php?src=view-cart-button.gif&w=96&h=0&HTTP_MODAUTH=modxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&f=jpg&q=90&wctx=mgr&source=1&t=1700987358&ar=x

Request Method

GET

Status Code

200 OK

Remote Address

111.222.57.23:443

Referrer Policy

strict-origin-when-cross-origin

i examined a working modx 3.2 on php8.3 and when i see the “media browser” section in the developer screen, those phpthumb links all work and if you put them separately into a browser tab it leads to the live image. with the above modx 3.2 php8.4 “media browser” screen, those links do not lead to a live image, they lead to an error screen with this on it (p.s. i removed a live web link below but no other changes):

#######################

Deprecated : League\Flysystem\Local\LocalFilesystemAdapter::__construct(): Implicitly marking parameter $visibility as nullable is deprecated, the explicit nullable type must be used instead in /home/dsrservices/public_html/xxxxxxxxxxx.ie/core/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php on line 84

Deprecated : League\Flysystem\Local\LocalFilesystemAdapter::__construct(): Implicitly marking parameter $mimeTypeDetector as nullable is deprecated, the explicit nullable type must be used instead in /home/dsrservices/public_html/xxxxxxxx.ie/core/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php on line 87

Deprecated : League\Flysystem\Filesystem::__construct(): Implicitly marking parameter $pathNormalizer as nullable is deprecated, the explicit nullable type must be used instead in /home/dsrservices/public_html/xxxxx.ie/core/vendor/league/flysystem/src/Filesystem.php on line 24

Warning : Cannot modify header information - headers already sent by (output started at /home/dsrservices/public_html/xxxxxx.ie/core/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php:84) in /home/dsrservices/public_html/xxxxxx.ie/core/src/Revolution/modPhpThumb.php on line 299

Warning : Cannot modify header information - headers already sent by (output started at /home/dsrservices/public_html/xxxxxx.ie/core/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php:84) in /home/dsrservices/public_html/xxxxxxxx.ie/core/src/Revolution/modPhpThumb.php on line 307

����JFIF``��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 90 ��C aa    ��C   ��`"��ea���� ��������l�_,�k g\���}�$�a�� !1���Kg6�N3��8_8N��s9�v�����Dn����4�7�W8%�2]��O���/�36fl�ٙ�3ff�͙�36g �{���0��?O��0��?O��/a�!23A�Q�1qBas�"������?t�]�X����cU����۱��W�]��װ2�_��z��ƫՕ��>���B�!>�h�z��ť��G���ƫՕ�5^��0������?0�ÿu��\X=1s����������mK�����K��܋�)�g���)�R�8⊊���:ӭ�n�JPM��”��K����J��6�%�m�Nu��a� ��F��5�Q�p�AZ�+;����T

It looks like the processor adds some deprecation warnings to the response, which breaks the image data (at the end of the response).

Try to disable the display_errors setting in the PHP config (on the server), so that no warnings/errors get shown in the response.
And maybe also adjust the error_reporting setting.

awesome as allways Harry !! that was it - the user.ini file and php.ini had “display_errors = On” - which did not matter to php8.3 but to php8.4 and 8.5 it broke the links to all those media browser thumbnail images. now 8.3, 8.4 and 8.5 are working fine. thnaks for taking the time to fix it - i hope you have a great day

2 Likes