stevewithington / MuraFW1

Base Mura CMS plugin using FW/1 as its application framework.
Apache License 2.0
27 stars 23 forks source link

admin links created with buildUrl missing plugins subdir #31

Closed jsieber closed 9 years ago

jsieber commented 9 years ago

I'm running Railo 4.2.1.008, IIS 7.5, Mura 6.1.6102 and the latest master of MuraFW1. When I install the base plugin, the admin links created by buildUrl are missing the /plugins/ portion of the path and producing 404's. Is there a configuration or mapping that I'm missing is or this somehow related to my environment?

When I add the missing "/plugins" to the url, it is valid and works correctly. I feel like I'm missing something obvious, but it is not standing out.

jsieber commented 9 years ago

This is only an issue when index.cfm is removed in the settings.ini.cfm at the Mura level. Proper links are created only when indexfileinurls=1 in my settings.ini.cfm.

Am I missing a required configuration within my plugin, or does it require the index.cfm in the url's?

jsieber commented 9 years ago

I'm wondering if this issue is somehow related to https://github.com/stevewithington/MuraFW1/issues/12? It is not the exact same behavior, as I'm only seeing the issue on the admin side, the public side is working correctly.

jsieber commented 9 years ago

I did verify that this is also happening on ACF 10 update 15, as well as the two Railo 4 enviroments I originally found the issue on.

stevewithington commented 9 years ago

@jsieber-aca, could you please try this instead and let me know if it works for you:

    public any function resolvePath(string path='#variables.framework.baseURL#') {
        // don't modify a submitted path
        if ( arguments.path != variables.framework.baseURL ) {
            return arguments.path;
        }

        var uri =  getPageContext().getRequest().getRequestURI();
        var arrURI = ListToArray(uri, '/');
        var indexPos = ArrayFind(arrURI, 'index.cfm');
        var useIndex = YesNoFormat(application.configBean.getValue('indexfileinurls'));
        var useSiteID = YesNoFormat(application.configBean.getValue('siteidinurls'));

        if ( !useIndex && indexPos ) {
            ArrayDeleteAt(arrURI, indexPos);
            uri = '/' & ArrayToList(arrURI, '/') & '/';
        }

        return uri;
    }
jsieber commented 9 years ago

Yes, this now works as expected. Thanks Steve.

stevewithington commented 9 years ago

Awesome, thanks for confirming!

Cheers, Steve

scriptminion commented 7 years ago

I have changed my post to https://github.com/stevewithington/MuraFW1/issues/12