Fixed Bug? Route Prefix Still Enabled If Associated Add-On Is Disabled

Kevin

Well-known member
Some thing I came across this weekend and wasn't expecting...

Running XF 1.0.4 I have an add-on installed & configured. That add-on includes a Route Prefix (eg: mySite.com/myPage). There is also a Code Event Listener to add a new navbar link.

Everything works fine when the add-on is enabled but when the add-on is disabled in the ACP (it shows as unchecked, name is greyed out, and is shown with a strike-thru) the listener is disabled as expected so the navbar link does not show but going to the URL directly still serves the page instead of showing the 'page not found' error as expected. It appears then that the route prefix is still enabled even though the add-on is disabled.

I tried as both an admin account and as a guest and got the same results.

I tried with two different add-ons that include route prefixes and got the same results with both.
 
Isn't this a problem with the add-on?

In the sense that the author hasn't disabled it correctly?
 
Isn't this a problem with the add-on?

In the sense that the author hasn't disabled it correctly?
If the add-on is disabled in the ACP then I would think that all associated properties are also disabled automatically. Just like the listener is disabled then the route prefix should be disabled also, otherwise disabling the add-on in the ACP really doesn't do much good.
 
If the add-on is disabled in the ACP then I would think that all associated properties are also disabled automatically. Just like the listener is disabled then the route prefix should be disabled also, otherwise disabling the add-on in the ACP really doesn't do much good.
Sadly it isn't :(

Also own (add-on) node handlers stay active, if the add-on is deactivated:(
I have 3 add-ons which adds node handlers to the system. And when i deactivate all 3, i can still create new nodes & see the nodes on the frontpage... :(
I can also access all add-on pages (gallery, photo page, article page,....) even the add-ons are deactivate:(

I've reported this already some months ago, but.... :P
 
+1 for this bug. I was wondering why the pages for my disabled addons were still mysteriously appearing ;).

Until it is fixed, is there a way to detect if my addon is disabled, then throw a 404 in the controller?
 
+1 for this bug. I was wondering why the pages for my disabled addons were still mysteriously appearing ;).

Until it is fixed, is there a way to detect if my addon is disabled, then throw a 404 in the controller?
You could run a check such as

PHP:
$options = XenForo::Application->get('options');

if ($options->myAddOnEnabled) {
//something
} else {
throw new error_something_im_sure_xenforo_has_one_of_these
}

I suppose? (sorry if any code is wrong, wrote from memory)
 
if ($options->myAddOnEnabled) {

I know how to throw a 404, but I'm not quite sure how to check on the status of an addon (I'm referring to the built-in XenForo addon "disabled" checkbox -- not an option in my plugin). I'll post back once I look into it.
 
Top Bottom