"Form autosaved" never disappears
| Project: | Autosave |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Hey,
So, I've been waiting for this module to get to D6, and now it finally did! Thanks! Good to see it. I haven't tested it in D5, but I know that here I can't get rid of the "Form was autosaved on" status.
The way I see it, there are two situations when you want to discard the autosaved form:
- When the user clicks "Ignore"
- When the user saves the form by pressing the "Save" button.
Now I have a node where I cannot get rid of this notification and it's bothersome :-)
Steps to reproduce:
1. Create a post. Save it.
2. Edit it. Let autosave take action, and navigate away from the page.
3. Come back to edit, autosave will mention there is a previous save available (good). Now click ignore.
4. Repeat step 3. The notice is always there no matter what you click...
I wish I knew javascript enough to help, but I looked at the code and I can't figure out exactly how to fix this... If you give me some pointers I can try fix it myself...
Thanks!

#1
#2
From this bug report it looks like if ignore is clicked then we should remove the currently saved piece for the node. However the issue here is that you hit ignore the form will start autosaving again.
So basically in this condition the following should be implemented:
1. The form is loaded and if there was anything saved in the database we display to the user.
2. User clicks Ignore, the ajax is called and we remove the form portion from the database.
Now at this point currently autosave will still occur hence what we need to do is add a check (boolean) that decides whether we have stopped it or not. So the question is do we want the Ignore button to remove the content from the database and then stop autosaving, or do we want it to remove the content from the database and still autosave as it currently does.
Instead of ignore we might wish to add a further button like Delete or Destroy. This would stop all processing remove the form and stop the autosave functionality on the page.
Thoughts????
#3
Okay, so, i thought this through a little bit, and hopefully this makes more sense. It feels like there may be room for improvement, but anyway... Suggestions:
1. Change "Ignore" to "Scrap" or "Discard" (+ "autosaved form"?)
Language should be clearer on what that button does...
2. Add a checkbox, CHECKED by default, saying "Resume autosave" next to the button.
(on 1st thought I had two buttons: Scrap + resume, Scrap only. Which do you think shows higher usability?)
This 3rd is more of a feature request:
3. Add another button saying "Disable autosave for this form (or page) (permanently)".
Then, you can set up a list of them somewhere in the settings, under a "Disabled forms" tab, where each is identified by the path? That's a separate feature, but related anyways. You could add or remove forms from that list easily...
It's easier if each form is identified by the path, more intuitive for the user. Anyhow, most forms are on only one path, but this could cause bugs or confusion... If you do add this based on path, make sure you don't use the alias, use the Drupal system path. This needs more thought...
If I can help with PHP, let me know! Wish I knew JS!
Hope this helps!
#4
1. Yes agree with the idea of having the link state something else.
2. Instead of a check box maybe a link with resume autosave instead. Not sure if the check box would look good however i am still open to that.
3. Yes would be a good idea to decide if you wanted to have autosave any more. I guess that could be a setting in drupal, var set with a serialized array of the forms that we have decided to disable autosave on.
Will think on how to get this done. I have other patches going in for the module, will try to get them incorporated in that.
#5
Ok cool, glad some of it helps. Looking forward to test the new one out ;)