23001 Posts in 11854 Topics by 2828 members
|Go to End|
8 August 2013 at 1:48am Last edited: 8 August 2013 1:53am
This has been bugging me for the best part of a year now, and I'm beginning to think the use of wildcards in YAML isn't as innocent as it seems.
For my LanguagePrefix module, I'm still trying to overrule/replace the modelascontrollerroutes, without success. If I'm correct, this is how the framework/cms routes are prioritized (and I placed my rule where I think it should be):
rootroutes -> Before *
modelascontrollerroutes -> Before: *, After: rootroutes
languageprefixroutes -> Before: ???, After: ???
coreroutes -> Before: *, After: rootroutes, modelascontrollerroutes
adminroutes -> Before: *, After: rootroutes, coreroutes, modelascontrollerroutes
legacycmsroutes -> After: adminroutes
Obviously I want my lanuageprefixroutes after the modelascontrollerroutes, but before the coreroutes. After is easy, but Before always triggers the conflict error, whatever I try. Below one of many tries:
Before: 'framework/routes#coreroutes' <-- look, no wildcards
Has anyone ever succeeded in doing this? Can it actually be done?
11 August 2013 at 6:10pm
I think the Wildcard approach is not the right one. If you remove the Before: * for coreroutes, adminroutes does that solve your issue? I wonder if these should only define after segments and let modules conclude if they need to be placed after *.
12 August 2013 at 1:36am Last edited: 12 August 2013 1:37am
Thanks. I guess if I remove the Before:'*' from framework and cms routes, i won't have a problem positioning my rule after #coreroutes and before #adminroutes.
I absolutely think framework and cms routes can easily be set up without the use of wildcards, and that would definitely solve the problem for other modules.
I posted this on core dev some months ago, but unfortunately there was no response at that time
The documentation states that priority is determined based on the number of wildcards used, where Before '*' stands for three wildcards, Before:'#adminroutes' stands for two, so something like Before 'framework/routes#adminroutes' should at least have presedence, but that doesn't seem to be that simple.
Maybe I should set it up again, do all the test and submit a pull...
12 August 2013 at 7:25pm
Tests sound like the best place to start!
|Go to Top|