meldsolutions/Meld-Google-Sitemaps

Relative References to Mura Files

Closed this issue · 1 comments

We are running into some issues with the relative file paths used to refer to Mura files. The issue is that we are working in a clustered environment and our plugins are not located in the default /plugins location. We are using pluginDir setting to locate our plugins in a network share to ensure that all instances within the cluster are synchronized. So since our plugins directory is location in /mnt/mura-cms/plugins when the code looks for ../../config/applicationSettings.cfm it is actually resolving to /mnt/config/applicationSettings.cfm instead of /var/www/config/applicationSettings.cfm

I think what you want to do is retrieve the Mura application root from Mura itself rather than making an assumption about the location of the plugin. Perhaps using $.globalConfig('AssetDir'). I am working on a fix and will submit a pull request.

Hmmm, I guess I am not really sure how to best resolve the issue. It is actually $.globalConfig('webRoot') that should be used, unfortuately it looks like the serviceFactory isn't available at that point in the code so I am not sure how to best proceed. This was my initial approach.

...
<cfset $ = application.serviceFactory.getBean("$") />
<cfinclude template="#$.globalConfig('webRoot')#/config/applicationSettings.cfm">
<cfinclude template="#$.globalConfig('webRoot')#/config/mappings.cfm">
<cfinclude template="#$.globalConfig('pluginDir')#/mappings.cfm">
...

But that isn't going to work for the reason I stated above.