1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Resolved Bug Reports' started by Kevin, Aug 15, 2011.

  1. Kevin

    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.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Isn't this a problem with the add-on?

    In the sense that the author hasn't disabled it correctly?
  3. Kevin

    Kevin Well-Known Member

    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.
    Jeremy P and Darkimmortal like this.
  4. ragtek

    ragtek Guest

    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
  5. Wootalyzer

    Wootalyzer Active Member

    +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?
  6. Mikey

    Mikey Well-Known Member

    You could run a check such as

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

    if (
    $options->myAddOnEnabled) {
    } else {
    throw new 
    I suppose? (sorry if any code is wrong, wrote from memory)
  7. Wootalyzer

    Wootalyzer Active Member

    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.
  8. Wootalyzer

    Wootalyzer Active Member

    This addon fixes this bug (but hopefully it will be fixed in 1.1 stock as well :)).

    Attached Files:

  9. Kier

    Kier XenForo Developer Staff Member

    Route prefixes for disabled add-ons are disabled in 1.1.
    duydangle, Dean, Wootalyzer and 3 others like this.

Share This Page