WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6075 closed defect (bug) (fixed)

New install: Post shouldn't autosave every second

Reported by: JeremyVisser Owned by: mdawaffe
Milestone: 2.5 Priority: normal
Severity: major Version: 2.5
Component: Administration Keywords: has-patch 2nd-opinion
Focuses: Cc:

Description

Running trunk r7135.

When in the Edit Post screen, when editing an existing post, I see a "Saved at 10:15:12pm" message, even though I haven't saved the post.

Even worse, this number is incrementing every second:

Saved at 10:15:12pm

...then...

Saved at 10:15:13pm

...then...

Saved at 10:15:14pm

...then...

Saved at 10:15:15pm

...etc.

I'm not sure if it's actually doing AJAX saves every second or not, but it sure is freaky.

Attachments (1)

6075.diff (5.4 KB) - added by mdawaffe 7 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 @lloydbudd7 years ago

  • Keywords mdawaffe added
  • Milestone changed from 2.6 to 2.5

comment:2 @nbachiyski7 years ago

It really autosaves every second (which is good IMHO). Probably we should change the message to "Autosaved at...", so that non-familiar users (and developers like Jemery :-) ) don't freak out.

comment:3 @mdawaffe7 years ago

  • Owner changed from anonymous to mdawaffe
  • Status changed from new to assigned

It's supposed to save once a minute. What browser are you using, JeremyVisser?

comment:4 @nbachiyski7 years ago

Oh, I meant minute. Didn't actually see it was really one second.

comment:5 @ryan7 years ago

Maybe the autosave_interval didn't get set correctly. Maybe we should use 60 if that option is empty.

comment:6 @mdawaffe7 years ago

I've been told this may be a IE7 issue, but I can't reproduce.

To those experiencing this problem:

  1. What browser are you using?
  2. If you go to /wp-admin/options.php is there an entry for "autosave_interval"? It should be "60".

comment:7 @DD327 years ago

I have reproduced in IE7, However, I cant reproduce it now. (No svn up has been done between tho)

It didnt happen in Opera 9 however (At the same time).

comment:8 @futurix7 years ago

It happens for me with Firefox 2.0.0.12 - rate of requests is insane, Firefox uses 100% of CPU.

Excerpt from my test server log:

test 127.0.0.1 - - [04/Mar/2008:00:17:57 +0000] "POST /live/wp-admin/admin-ajax.php HTTP/1.1" 200 182 "http://test/live/wp-admin/post-new.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"
test 127.0.0.1 - - [04/Mar/2008:00:17:57 +0000] "POST /live/wp-admin/admin-ajax.php HTTP/1.1" 200 182 "http://test/live/wp-admin/post-new.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"
test 127.0.0.1 - - [04/Mar/2008:00:17:57 +0000] "POST /live/wp-admin/admin-ajax.php HTTP/1.1" 200 182 "http://test/live/wp-admin/post-new.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"
test 127.0.0.1 - - [04/Mar/2008:00:17:57 +0000] "POST /live/wp-admin/admin-ajax.php HTTP/1.1" 200 182 "http://test/live/wp-admin/post-new.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"
test 127.0.0.1 - - [04/Mar/2008:00:17:57 +0000] "POST /live/wp-admin/admin-ajax.php HTTP/1.1" 200 182 "http://test/live/wp-admin/post-new.php" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"

The problem is definitely caused by autosave, as after removal of autosave.js the problem goes away immediately.

comment:9 @DD327 years ago

It happens for me with Firefox 2.0.0.12

Check in view sourse, is the autosave interval set right?

<script type='text/javascript'>
/* <![CDATA[ */
	autosaveL10n = {
		autosaveInterval: "60",

I'm trying to reproduce it right now..

comment:10 @futurix7 years ago

Obviously it is wrong:

	autosaveL10n = {
		autosaveInterval: "",
		previewPageText: "View this Page",
		previewPostText: "View this Post",
		requestFile: "http://test/wp/wp-admin/admin-ajax.php",
		savingText: "Saving Draft&#8230;"
	}

comment:11 @futurix7 years ago

P.S. I'm running revision 7147.

comment:12 @ryan7 years ago

(In [7148]) Set autosave_interval for fresh installs. DEfault to 60 if autosave_interval is not set. see #6075

comment:13 @ryan7 years ago

Is this with a fresh 2.5 install or an upgrade to 2.5? autosave_interval wasn't being set for fresh installs.

comment:14 @DD327 years ago

Is this with a fresh 2.5 install or an upgrade to 2.5? autosave_interval wasn't being set for fresh installs.

Ahah! Thats how i reproduced it the other day.. on the fresh svn install, not the svn upgrade one.

comment:15 @futurix7 years ago

Indeed, that was fresh SVN install.

comment:16 @JeremyVisser7 years ago

Running Fx 3.0b3 on Ubuntu 8.04. Indeed it is a fresh trunk install, just checked out two days ago. Like futurix, my autosaveInterval is stuffed:

autosaveL10n = {
	autosaveInterval: "",
	previewPageText: "View this Page",
	previewPostText: "View this Post",
	requestFile: "http://localhost/jeremy.visser.name/wordpress/wp-admin/admin-ajax.php",
	savingText: "Saving&#8230;"
}

[7148] fixes it for me. Mark this ticket as fixed?

comment:17 @Nazgul7 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:18 @mdawaffe7 years ago

  • Keywords has-patch 2nd-opinion added; mdawaffe removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Let's use a constant instead of having to draw from the DB.

http://comox.textdrive.com/pipermail/wp-testers/2008-March/006340.html

6075.diff

AUTOSAVE_INTERVAL defined in wp-admin/includes/admin.php. Is there a better place? It needs to be accessible to XMLRPC (so wp-admin/admin.php is out). We could just put it in wp-settings.php.

@mdawaffe7 years ago

comment:19 @ryan7 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [7165]) Use constant instead of DB option for setting autosave_interval. Props mdawaffe. fixes #6075

comment:20 @lloydbudd7 years ago

  • Summary changed from Post saved notification ticking away like crazy to New install: Post shouldn't autosave every second
Note: See TracTickets for help on using tickets.