Bruno17 / MIGX

MIGX for revo 2.2 and above
83 stars 78 forks source link

Errors with migxResourceMediaPath and MODX 2.6.1 #304

Open crimsonpixel opened 6 years ago

crimsonpixel commented 6 years ago

I have a site which has been using the migxResourceMediaPath as a location for images however, this seems to have become unusable in recent MODX upgrade to 2.6.1. Files are no longer located under the Media Source.

The call for basePath and baseURL have been unchanged are as follows:

[[migxResourceMediaPath? &pathTpl=assets/foldername/resourceimages/{id}/]]

Whilst this did list images under the media source there the following error would appear in the logs;

/paas/site/www/core/cache/includes/elements/modsnippet/13.include.cache.php : 69) [migxResourceMediaPath]: docid could not be determined.

However there is a new error appearing:

/paas/site/www/core/model/modx/sources/modfilemediasource.class.php : 53) PHP warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/paas/site)

Plus the images are now no longer listed under the Media Source although the folder still exists...

crimsonpixel commented 6 years ago

If I use PHP 5.6 I can use the upload but I can't actually access the media source if I use image upload. Works fine if you Ajaz upload but not for individual images.

Any suggestions?

mdehaan commented 6 years ago

I have exact this same problem. After updating from 2.5.0 to 2.6.4 I get the error "Server error. Upload directory isn't writable." when trying to upload an image with the ajaxupload (red button) from migx. (image upload directory isnt writable)

Also when switching form PHP 5.3 to 7.0 the uploadbutton disappears (image probleem 2)

probleem 2 - geen rode upload button upload directory isnt writable ,

mdehaan commented 6 years ago

On the media source for this gallery I use migxResourceMediaPath.

assets/uploads/[[migxResourceMediaPath? &pathTpl={id}/]]

mdehaan commented 6 years ago

[2018-06-25 08:15:21] (ERROR @ /home/***/gearbox/cache/includes/elements/modsnippet/8.include.cache.php : 69) [migxResourceMediaPath]: docid could not be determined.

Mark-H commented 6 years ago

the php7 issue with the upload form is fixed with #317

mdehaan commented 6 years ago

Thanx Mark :) The problem with relative paths on the mediasource not working still exists.

When I use the absolute path in this example it works fine. But when I change it to the relative example, then no folder/file is created on upload.

Absolute: basePathRelative: False basePath: [[migxResourceMediaPath? &pathTpl=`/home/domain/public_html/assets/photogallery/{id}/`]]

Relative: basePathRelative: True basePath: [[migxResourceMediaPath? &pathTpl=`assets/photogallery/{id}/`]]

crimsonpixel commented 6 years ago

Tried the fix Mark-H but unfortunately it didn't work. Would be good to get this resolved as the work round for the client is a little frustrating.

Site is now on 2.6.5

mcnickel commented 5 years ago

Same here since using PHP 7.x.

BTW: The missing upload button is related to #277 (http instead of https in line 10 in /core/components/migx/templates/mgr/iframechunks/ajaxupload.html)