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

Enable Debug Mode From AdminCP 1.1a

Provides a new Admin permission to make an "Enable Debug" switch appear on the AdminCP home.

  1. Chris D

    Chris D XenForo Developer Staff Member

    Chris Deeming submitted a new resource:

    Enable Debug Mode From AdminCP (version 1.0) - Provides a new Admin permission to make an "Enable Debug" switch appear on the AdminCP home.

    Read more about this resource...

    EDIT: Just a note on this. The default behaviour of this add-on is to create the Debug Switch and the default state is "OFF".

    This means, if you currently have Debug mode enabled, installing this add-on will effectively disable it until you flick the switch to ON.
     
    Thomas.B, Alfa1, erich37 and 6 others like this.
  2. oman

    oman Well-Known Member

    I've been waiting for this for a long time! I hate having to turn it on and off manually. Great add on Chris.
     
    Chris D likes this.
  3. Morgain

    Morgain Well-Known Member

    ooooooh chris I luv you!
     
  4. ArnyVee

    ArnyVee Well-Known Member

    Living up to your "making the lazier lazier" moniker perfectly! :D
     
  5. tajhay

    tajhay Well-Known Member

    this should have been core. thank you so much chris
     
  6. Jaxel

    Jaxel Well-Known Member

    I just keep my forum in debug mode all the time using:
    Code:
    $debugs = array('MY IP ADDRESS');
    $config['debug'] = (in_array($_SERVER['REMOTE_ADDR'], $debugs));
    Is there really a downside to this?
     
  7. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    only if you have dynamic IP addresses like mine... for that I use:
    PHP:
    $config['debug'] = strpos($_SERVER['REMOTE_ADDR'], 'xxx.xxx') !== false true false;
    btw Chris, I've posted a fix in my review (and I am too lazy to re-post it here :p ): http://xenforo.com/community/resour...-admincp.1356/reviews?resource_rating_id=3017 ;)
     
  8. Veer

    Veer Well-Known Member

    Thank you Chris, Excellent work :)
     
  9. Morgain

    Morgain Well-Known Member

    Yes there is a downside to staying in debug for the less experienced. It can be too easy to make changes to the defaults and so on.
    In fact for a protective extra I'd suggest this has a timeout Chris. So if inactive for a period, or logged out, it defaults to standard mode. (Which itself could be overridden by a more experienced admin)
     
  10. oman

    oman Well-Known Member

    Nice suggestion!
     
    Morgain likes this.
  11. borbole

    borbole Well-Known Member

    This should be built in xenforo imho. Well done again Chris :)
     
  12. Adam Howard

    Adam Howard Well-Known Member

    Resources

    Debug mode uses resource (both memory and database queries) ..... If I recall correctly.

    *cpu as well (by it varies on what you're doing and what you may have installed)
     
  13. Chris D

    Chris D XenForo Developer Staff Member

    The resources are relevant when it's enabled for every single person browsing the site.
    If its effectively enabled for only one user then it's not too much of a problem.

    Also I think some people think "meh it only takes a second to edit the config file" but as ever you'd be surprised at how many people would be unable to do this.

    This is designed for them, and also power users. I mean I needed to enable debug mode the other day and I didn't have FTP access.

    So I just installed this using my add on installer :-D
     
    Shelley and Adam Howard like this.
  14. Chris D

    Chris D XenForo Developer Staff Member

    Chris Deeming updated Enable Debug Mode From AdminCP with a new update entry:

    Now displays query count and disables debug mode upon uninstall.

    Read the rest of this update entry...
     
    vVv and Adam Howard like this.
  15. Luxus

    Luxus Well-Known Member

    It amazes me how much value such a simple addon can bring to xenforo. Thanks Chris (y)
     
    Chris D likes this.
  16. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    As far as I know, its not possible (at least directly) because the Visitor object is available a lot later, at which point enabling debug mode is more or less useless...
     
  17. Adam Howard

    Adam Howard Well-Known Member

    So I noticed this was making my site slower. Even when disabled.

    so I was going to un-install this....


    PHP:
    Missing argument 2 for XenForo_Application::setSimpleCacheData(), called in /home/***/public_html/forums/library/EnableDebugFromAdminHome/Install.php on line 7 and defined
     
        XenForo_Application
    ::handlePhpError() in XenForo/Application.php at line 746
        XenForo_Application
    ::setSimpleCacheData() in EnableDebugFromAdminHome/Install.php at line 7
        EnableDebugFromAdminHome_Install
    ::uninstaller()
        
    call_user_func() in XenForo/DataWriter/AddOn.php at line 193
        XenForo_DataWriter_AddOn
    ->_postDelete() in XenForo/DataWriter.php at line 1738
        XenForo_DataWriter
    ->delete() in XenForo/ControllerAdmin/AddOn.php at line 116
        XenForo_ControllerAdmin_AddOn
    ->actionDelete() in XenForo/FrontController.php at line 310
        XenForo_FrontController
    ->dispatch() in XenForo/FrontController.php at line 132
        XenForo_FrontController
    ->run() in /home/***/public_html/forums/admin.php at line 13
    It doesn't like me. :(
     
  18. Adam Howard

    Adam Howard Well-Known Member

    This is the full error log from "tools"


    PHP:
    ErrorExceptionMissing argument 2 for XenForo_Application::setSimpleCacheData(), called in /home/***/public_html/forums/library/EnableDebugFromAdminHome/Install.php on line 7 and defined library/XenForo/Application.php:746
    Generated By
    Adam32 minutes ago
    Stack Trace

    PHP:
    #0 /home/***/public_html/forums/library/XenForo/Application.php(746): XenForo_Application::handlePhpError(2, 'Missing argumen...', '/home/sociall1/...', 746, Array)
    #1 /home/sociall1/public_html/forums/library/EnableDebugFromAdminHome/Install.php(7): XenForo_Application::setSimpleCacheData(false)
    #2 [internal function]: EnableDebugFromAdminHome_Install::uninstaller(Array)
    #3 /home/sociall1/public_html/forums/library/XenForo/DataWriter/AddOn.php(193): call_user_func(Array, Array)
    #4 /home/sociall1/public_html/forums/library/XenForo/DataWriter.php(1738): XenForo_DataWriter_AddOn->_postDelete()
    #5 /home/sociall1/public_html/forums/library/XenForo/ControllerAdmin/AddOn.php(116): XenForo_DataWriter->delete()
    #6 /home/sociall1/public_html/forums/library/XenForo/FrontController.php(310): XenForo_ControllerAdmin_AddOn->actionDelete()
    #7 /home/sociall1/public_html/forums/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #8 /home/***/public_html/forums/admin.php(13): XenForo_FrontController->run()
    #9 {main}
    Request State

    PHP:
    array(3) {
      [
    "url"] => string(89"http://www.sociallyuncensored.eu/forums/admin.php?add-ons/EnableDebugFromAdminHome/delete"
      
    ["_GET"] => array(1) {
        [
    "add-ons/EnableDebugFromAdminHome/delete"] => string(0""
      
    }
      [
    "_POST"] => array(2) {
        [
    "_xfConfirm"] => string(1"1"
        
    ["_xfToken"] => string(53"1,1357755239,8a8a55911da6cf1d18482e1024b53eef3a6026ab"
      
    }
    }
     
  19. Chris D

    Chris D XenForo Developer Staff Member

    That simply isn't possible.

    As for the uninstall error, there's a bug in the installer. I will release a fix right now.

    EDIT: With Debug mode disabled? Or with the add-on disabled? The latter 100% isn't possible... the former shouldn't be possible.
     
  20. Chris D

    Chris D XenForo Developer Staff Member

Share This Page