[wp-trac] [WordPress Trac] #15130: Lock is not set to correct user until there is a save

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 10 19:30:51 UTC 2010


#15130: Lock is not set to correct user until there is a save
--------------------------+-------------------------------------------------
 Reporter:  lancehudson   |       Owner:             
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  3.1        
Component:  Editor        |     Version:  3.0        
 Severity:  normal        |    Keywords:  needs-patch
--------------------------+-------------------------------------------------

Comment(by mdawaffe):

 Replying to [comment:17 duck_]:
 > `15130.add-id-to-lock.diff` does this. Note not completely ready since
 you will get a warning the first time you visit a post with the old style
 lock or a post without a lock. Just a quick proof-of-concept type patch.

 +1 to storing the user_id and the lock time in the same key.

 If you store "$time:$user_id" (instead of the other way around as 15130
 .add-id-to-lock.2.diff does), it's easier to handle the old style lock
 case, just pull _edit_last if there's no $user_id after the list().

 With that patch, I don't get a warning when visiting a post without a lock
 (which is good).  Why do you say I will?

 Tangentially, I'd also like to see the wp_set_post_lock() call moved to
 below the edit-form-advanced.php include in wp-admin/post.php.  That way,
 the only DB write for that page is after all of the DB read queries, which
 is a performance optimization for sites running HyperDB and/or some
 caching plugins.  (That's lower priority than getting the lock to stop
 lying: probably worth a new ticket.)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15130#comment:18>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list