Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Disabling draft auto-saves

MikhaelMikhael New
edited August 2010 in Vanilla 2.0 - 2.8
Is it possible to disable the Draft auto-save? I don't need or want it, and know that some users will find it confusing that a message pops up saying stuff was saved when they didn't ask for it. (Apologies if this has already been covered, but searching didn't give me an answer).
Tagged:
«1

Comments

  • I'd like to know the answer to this as well. It's not 'normal' behavior for a forum, and I think some users may find it to feel invasive. Until they hit post, they should be able to feel confident that my server hasn't taken their words from them imo.
  • Yeah, WordPress does it as well, but the first thing I do on setting up a WP site is to disable it. If nobody provides an answer soon regarding switching it off, I'll hunt through the code and find out how to disable it. I guess a simple plugin would be best, but I don't have time right now to get into that.
  • ToddTodd Chief Product Officer Vanilla Staff
    There isn't any way to disable drafts. I've actually never heard that type of concern before.
  • MikhaelMikhael New
    edited August 2010
    @Todd; I suppose it's a fairly minor concern in the great scheme of things, but users who don't frequent forums and networking sites can be alarmed by events they didn't instigate. Being alerted to background saving is definitely one of them.

    I've noticed that some people just say, "I noticed it auto-saving my text, which is neat", while others say, "Why is it doing things I didn't tell it to? Am I missing something important that I should have set?" I use various packages for different sites, and making everything plain and simple is usually the largest part of my work, as is convincing people that "it really is simple ... honest!"

    Any pointers as to where to look first to disable Draft auto-saves..?
  • ToddTodd Chief Product Officer Vanilla Staff
    I'm pretty sure you can just remove autosave.js. If you want to do this, but not change the core, make a plugin with the following methods:
    public function PostController_Render_Before($Sender) {
    $this->RemoveJsFile('autosave.js');
    }

    public function DiscussionController_Render_Before($Sender) {
    $this->RemoveJsFile('autosave.js');
    }
  • Cheers @Todd. Attempt 1) nothing. Attempt 2) Crash (well, Big Red Error). Attempt 3) Learning how to write a plugin for Vanilla. What are Bank Holiday weekends for..?! :)
  • MikhaelMikhael New
    edited August 2010
    @Todd, @Lykaon; I've got it working after a lot of messing around (being new to Vanilla 2) using the following code;

    <?php if (!defined('APPLICATION')) exit(); /* GNU GPL bit here. */ $PluginInfo['DisableAutosave'] = array( 'Name' => 'Disable Autosave', 'Description' => "Stops auto-saving of Draft posts.", 'Version' => '1.0', 'Author' => 'Mikhael' ); function PostController_Render_Before($Sender) { $this->RemoveJsFile('autosave.js'); } function DiscussionController_Render_Before($Sender) { $this->RemoveJsFile('autosave.js'); }
    It seems to work ok, but I'm concerned that it's overriding hiding core functionality. I tried setting up a class to extend Garden functions, but it turned into a bit of a nightmare. Any advice gratefully received.
  • @Mikhael: I've tried it out and it seems to work without any adverse side effects. I'll keep an eye on it and let you know if I see anything funky.
  • MikhaelMikhael New
    edited August 2010
    @Lykaon; What bothers me as an ex programmer is that the Class Reference section of the developer docs doesn't appear to exist yet, so I have no idea how to add these correctly. I've tried creating a class, but haven't fully grasped Vanilla 2's structure, and just end up with error after error. The problem here is that these function declarations may be 'hiding' the originally declared functions. (I'm not yet sure how PHP works in that respect as my pro work was all OOP/RAD in Windows). Hiding functions is a Bad Thing.

    @Todd; Any idea why the dev docs say, "An indent is 3 spaces, never a tab"? That adds 3 times the characters to every indent, which is a lot of extra junk when it's all a added up. And the Minify plugin causes some pages to display naked and nasty, so that's no help it seems...
  • LincLinc Detroit Admin
    edited August 2010
    @Mikhael Your concern about hiding core functionality is unfounded. You've done it precisely the right way.

    The developers decided on spaces instead of tabs as the coding standard. It just comes down to personal preference.
  • MikhaelMikhael New
    edited August 2010
    Thanks @Lincoln. I've uploaded it as a plugin in case anyone else finds it useful.
  • edited August 2010
    Thanks @Lincoln. I've uploaded it as a plugin in case anyone else finds it useful.
    Hi Mikhael:
    What is the plugin?
    In my case, auto saves makes that comments, in Internet explorer, can't work well. When you spend time write your comment and the auto save work, the write comment button appears disabled and can't write a comment.

    It is really annoying for users
  • MikhaelMikhael New
    edited August 2010
    @tonipg39; It's just the code Todd gave above wrapped in a plugin for easy installation, and is available in the addons section. It hasn't been reviewed yet, but is perfectly safe.
  • edited August 2010
    Hi Mikhael: Thank you very much

    Umm in my case it doesn't work. The problem with Internet explorer continue. Furthemore when I write a comment with explorer, appears an navigation error with this message:

    error in disscusion.js in line 89, character 13

    and the message isn't it published.

    Someone more had this problem?

    My Vanilla version is 2.0.
  • ToddTodd Chief Product Officer Vanilla Staff
    @tonipg39 Are you Vanilla 2.0? What version of IE are you on?
  • Hi Todd:
    Yes, version 2.0 and the IE version is 8
  • Interesting @tonipg39. I use Chrome, but just tested that again in IE8 (without 'Compatibility mode') and it works in terms of being able to post a comment. What's strange is that the draft auto-save is disabled in Chrome, but is still working on the same site in IE8, although the autosave.js file shouldn't be active. Any ideas @Todd?
  • TimTim Operations Vanilla Staff
    Could IE8 have cached the page with Autosave still included?

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • LincLinc Detroit Admin
    Ctrl + F5 to force-refresh the page with the js changes (or manually clear your cache).
  • @Mikhael: As a follow-up, I don't think this plugin is working for me afterall. I still get the 'Autosaved' message the top of the screen for really long messages. I don't know if it's really auto-saving or not, but it at least appears to be.

    On the other hand, it's not causing any adverse effects either so overall it's not a problem.
Sign In or Register to comment.