<![CDATA[ Errors with migxResourceMediaPath and MODX 2.6.1 - MODX Community Forums]]> https://forums.modx.com/thread/?thread=103472 <![CDATA[Errors with migxResourceMediaPath and MODX 2.6.1]]> https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-556719
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.

The site is hosted on MODX Cloud and was using PHP 7.1 but have reverted to PHP 5.6 but this hasn't resolved that issue... had another issue relating to AJAX Upload which seemed to be linked to a compatability isssue with PHP 7.1 which was almost resolved with rolling back to 5.6. Can use AJAX multi upload but not individual upload as I think there is an issue with the media source...

Any suggestions / solutions to this problem. I have also posted it to github... https://github.com/Bruno17/MIGX/issues/304]]>
boomerang Feb 05, 2018, 03:46 PM https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-556719
<![CDATA[Re: Errors with migxResourceMediaPath and MODX 2.6.1]]> https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-561772 In my case I found that Firefox strips the HTTP_REFERER of any additional path information besides the protocol and domain
https://example.com
.
But since migxResourceMediaPath snippet seems to depend on parsing the referer for the current resource ID when called via an AJAX request, it now can't find the neccessary ID to build the dynamic path.

One resource I found on that is https://blog.mozilla.org/security/2018/01/31/preventing-data-leaks-by-stripping-path-information-in-http-referrers/. This only talks about browsing in private mode though. But using FF 62.0.2 I can observe this behaviour in non-private mode.
]]>
itWillBeOk Sep 27, 2018, 07:54 PM https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-561772
<![CDATA[Re: Errors with migxResourceMediaPath and MODX 2.6.1]]> https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-559211 &pathTpl by removing the forward slash after assets?

In Helens example this would be:

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

Looking at the difference in the code between MODX 2.5.2 and 2.6.1 in the file core/model/modx/sources/modfilemediasource.class.php it looks as if the newer code may add a forward slash to the path. My PHP is not good enough to be sure of this - I am just speculating!

MODX 2.6.1
    public function getBases($path = '') {
        $properties = $this->getProperties();
        $bases = array();
        $path = $this->fileHandler->sanitizePath($path);
        $bases['path'] = $properties['basePath']['value'];
        $bases['pathIsRelative'] = false;
        if (!empty($properties['basePathRelative']['value'])) {
            $bases['pathAbsolute'] = realpath("{$this->ctx->getOption('base_path',MODX_BASE_PATH)}{$bases['path']}"). '/';
            $bases['pathIsRelative'] = true;
        } else {
            $bases['pathAbsolute'] = $bases['path'];
        }


MODX 2.5.2
    public function getBases($path = '') {
        $properties = $this->getProperties();
        $bases = array();
        $path = $this->fileHandler->sanitizePath($path);
        $bases['path'] = $properties['basePath']['value'];
        $bases['pathIsRelative'] = false;
        if (!empty($properties['basePathRelative']['value'])) {
            $bases['pathAbsolute'] = $this->ctx->getOption('base_path',MODX_BASE_PATH).$bases['path'];
            $bases['pathIsRelative'] = true;
        } else {
            $bases['pathAbsolute'] = $bases['path'];
        }
]]>
andytough Jun 25, 2018, 11:50 AM https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-559211
<![CDATA[Re: Errors with migxResourceMediaPath and MODX 2.6.1]]> https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-559210 [2018-06-25 07:58:50] (ERROR @ /cache/includes/elements/modsnippet/8.include.cache.php : 69) [migxResourceMediaPath]: docid could not be determined.]]> mdehaan Jun 25, 2018, 07:59 AM https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-559210 <![CDATA[Re: Errors with migxResourceMediaPath and MODX 2.6.1]]> https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-557498 scoder Mar 20, 2018, 01:39 PM https://forums.modx.com/thread/103472/errors-with-migxresourcemediapath-and-modx-2-6-1#dis-post-557498