Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 3 weeks ago

#6075 closed defect (bug) (fixed)

New install: Post shouldn't autosave every second

Reported by: jeremyvisser's profile JeremyVisser Owned by: mdawaffe's profile 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 16 years ago.

Download all attachments as: .zip

Change History (21)

#1 @lloydbudd
16 years ago

  • Keywords mdawaffe added
  • Milestone changed from 2.6 to 2.5

#2 @nbachiyski
16 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.

#3 @mdawaffe
16 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?

#4 @nbachiyski
16 years ago

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

#5 @ryan
16 years ago

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

#6 @mdawaffe
16 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".

#7 @DD32
16 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).

#8 @futurix
16 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.

#9 @DD32
16 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..

#10 @futurix
16 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;"
	}

#11 @futurix
16 years ago

P.S. I'm running revision 7147.

#12 @ryan
16 years ago

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

#13 @ryan
16 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.

#14 @DD32
16 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.

#15 @futurix
16 years ago

Indeed, that was fresh SVN install.

#16 @JeremyVisser
16 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?

#17 @Nazgul
16 years ago

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

#18 @mdawaffe
16 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.

@mdawaffe
16 years ago

#19 @ryan
16 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

#20 @lloydbudd
16 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.