Opened 11 years ago
Closed 11 years ago
#24756 closed defect (bug) (fixed)
Don't limit local autosave only to Posts
Reported by: | azaozz | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Autosave | Keywords: | has-patch |
Focuses: | Cc: |
Description
There is some left-over code limiting the local autosave (in sessionStorage) only to Posts. This limitation should be removed making it run on all Add New* and Edit* screens where autosave.js is loaded or alternatively it should also run on Add New Page and Edit Page.
Attachments (11)
Change History (33)
#1
@
11 years ago
All screens plz. :-)
Let's make sure everything works okay with a post type doesn't support title, content, or excerpt; and doesn't support any of those.
#2
@
11 years ago
- Owner set to azaozz
- Status changed from new to assigned
azaozz is looking into this and trying to make sure it is fully resilient.
#3
@
11 years ago
In 24756-3.patch: add a check whether the post type supports either editor or excerpt.
#5
@
11 years ago
Patch looks good at a glance.
Was passing the CPT 'supports' array to JS to detect when there is no support for editor and excerpt, but 24756-3.patch does the same in a much simpler way.
#8
@
11 years ago
- Owner changed from azaozz to nacin
Leaving this open for azaozz who is removing the editor.js dependency from autosave.js. editor.js is tied to the admin, while autosave.js can actually be used on the frontend.
#10
@
11 years ago
In 24756-4.patch:
- Remove autosave.js dependency on editor.js.
- Move the check whether the loaded post content is different than local autosave post content to run on DOM ready.
#11
@
11 years ago
24756-5.patch also includes @carldanley's patch for using hasConnectionError() when enabling buttons.
#12
@
11 years ago
I don't entirely follow all of the moves in 24756-5.patch but it seems to work and seems to look good.
#13
@
11 years ago
24756-5.patch seems to work for me. I'm not sure if there are any specific edge cases I should be testing though.
#16
@
11 years ago
24756-6.patch is same as 24756-5.patch plus: always tracks changes in the excerpt and removes one unused var.
#17
@
11 years ago
24756-7.patch includes 5.patch and 6.patch plus:
- Output the local_storage_notice HTML on all Add/Edit screens.
- Introduce wp.autosave.getLastSavedCompareString().
- Minor cleanup of autosave(), removed
doAutoSave
as we don't connect when it's false.
#18
@
11 years ago
24756-8.patch is same as 7.patch except it moves _local_storage_notice() to wp-admin/includes/template.php
#20
@
11 years ago
24756.2.diff is 24756-8.patch minus [24762]. I've reviewed it and it looks good. Because there are so many moving bits here, we just need to make sure everything gets tested well.
I think getLastSavedCompareString() is a great abstraction. I'm finding that its name implies it is getting the last saved string, not a string that will then be compared against whatever is saved. I think maybe just wp.autosave.getCompareString() is fine.
Enable on all screens where autosave.js is loaded