MIGX icon indicating copy to clipboard operation
MIGX copied to clipboard

Errors with migxResourceMediaPath and MODX 2.6.1

Open crimsonpixel opened this issue 8 years ago • 8 comments

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 avatar Dec 29 '17 14:12 crimsonpixel

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?

crimsonpixel avatar Feb 05 '18 15:02 crimsonpixel

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 avatar Jun 22 '18 14:06 mdehaan

On the media source for this gallery I use migxResourceMediaPath.

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

mdehaan avatar Jun 25 '18 07:06 mdehaan

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

mdehaan avatar Jun 25 '18 08:06 mdehaan

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

Mark-H avatar Jul 06 '18 14:07 Mark-H

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}/`]]

mdehaan avatar Jul 09 '18 12:07 mdehaan

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

crimsonpixel avatar Jul 23 '18 16:07 crimsonpixel

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)

mcnickel avatar Nov 13 '18 15:11 mcnickel