revolution icon indicating copy to clipboard operation
revolution copied to clipboard

Create document does not render template preview

Open eydolan opened this issue 3 years ago • 3 comments

image

Does not render image

Path is URL/connectors/system/phpthumb.php?src=PATH_TO_IMAGE&w=335&h=236&HTTP_MODAUTH=AUTH_ID&zc=1

Tried different php versions 7.4 8.0 8.1 Tried diff path absolute vs media source

eydolan avatar Aug 29 '22 03:08 eydolan

What is the response if you open the image URL "URL/connectors/system/phpthumb.php?src=PATH_TO_IMAGE&w=335&h=236&HTTP_MODAUTH=AUTH_ID&zc=1" directly in the browser?

With MODX 3.0.1 and PHP 8.1 I get an error message Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated at the start of the response and have to deactivate error_reporting in the processor to make it work.


What is the value of the base_url on your installation?

halftrainedharry avatar Aug 29 '22 11:08 halftrainedharry

also tried php8.0 again

I installed a fresh modx site on the same server with same settings and it works so it must, however only if I remove the a folder as it is installed in a sub directory ie it shows /subdir/ in the path that need to be removed

but on the othersites its does not render the image even if path is correct just white ouput

do must be something with that particular site.

so maybe can close this ticket as I am now not sure if this is a bug

eydolan avatar Aug 30 '22 21:08 eydolan

I would leave the issue open.

At least when the installation is in a subdirectory (base_url is different from /) the image path is incorrect and that needs to be fixed.

https://github.com/modxcms/revolution/blob/f7bc0133f5f09184418a7ddf6f9b98a3f0decd9e/core/src/Revolution/modElement.php#L1166-L1192

halftrainedharry avatar Aug 31 '22 08:08 halftrainedharry

This issue has been mentioned on MODX Community. There might be relevant details there:

https://community.modx.com/t/create-new-document-template-preview-image-is-not-showing/6257/2

rthrash avatar Jan 08 '23 10:01 rthrash