After restoring an autosaved form, the 'autosave_form_path' form element has the incorrect value, causing subsequent autosaves to be written to the db with the wrong path. If you leave the form again and go back, Autosave restores the original entry instead of the newer changes. Basically, once you leave the form the first time, you cannot restore any subsequent changes.

This issue was cause by a call to url() in autosave_restore(). During autosave_restore(), the form's '#action' is reset to the correct path using the url() function, which in this case basically just prefixes the form's path as stored in the autosave_forms table with '/'. However, that value was then being assigned to the 'autosave_form_path' form element. This caused a restored form to use a different path than the original autosave_forms entry.

I've attached a patch to fix it by using the original value for 'autosave_form_path' instead of setting it to the value of the form's '#action'.

CommentFileSizeAuthor
autosave-restore-uses-incorrect-path.patch610 bytesChaulky

Comments

quicksketch’s picture

Status: Needs review » Fixed

Thanks, you're quite right. Committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.