[ColdBox4] interceptor with same name as a module gets ignored

I have two modules, security & mysiteapp

mysiteapps’s config looks like

Jeremy,

That is because the filename becomes the interceptor name, at least that is how it used to work. In this example you need to add the name attribute to the key value pairs like so.

interceptors = [
{name = “myIntercptor”, class=“modules.security.interceptors.security”}
];

When dealing with file names, I usually name the file to what it is rather than just security, I would call it requestSecurity or eventSecurity so that the name reflects what it is as well.

I also forgot to add, that the name can be something like this as well.

interceptors = [
{name = “security”, class=“modules.security.interceptors.security”}
];

interceptors = [
{name = “security@moduleName”, class=“modules.security.interceptors.security”}
];

Which sort of helps break it down some more.

i like the second option of naming it in the config! much better. Totally forgot about that!

Thanks for your help Andrew! You’re the best!

I’m thinking of a ticket that would automatically add the module namespace to interceptor names… Anyone?

It definitely seems worthwhile to prevent this from happening on accident when you drop someone else’s module into your code with a commonly named interceptor like “security”.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

agree! that is what happened. my module from another project.

https://ortussolutions.atlassian.net/browse/COLDBOX-442

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

sweet - my first cb4 ticket – woot woot!

A bit off topic, but I want know why andyscott.id.au is offline. I used to found a lot of information on that blog. Please Andrew why don’t you want share your knowledge with us anymore?

Still OT, and a year later, Andy’s site says “down for maintenance, check again soon.” Anyone know what happened to the bloke?

I am here… I can no longer afford to run my site.

Hi Andrew Scott,

Is there anything we can help your blog up and running. More than happy to pay for hosting.

Let me know.