[wp-trac] [WordPress Trac] #18227: Autosave JS throws and error for post types with disabled title and editor

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 27 17:41:41 UTC 2011


#18227: Autosave JS throws and error for post types with disabled title and editor
--------------------------+------------------------------
 Reporter:  karevn        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Autosave      |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by MarcusPope):

 I'm pretty sure this will never be true unless {{{ post_data["content"]
 }}} is an array or custom js object with a namespace-trumping length
 property:

 {{{
 (post_data["content"] && post_data["content"].length == 0)
 }}}

 Instead we could just check for {{{ !post_data[xxx] }}} on line 259:

 {{{
 if ( (!post_data["post_title"] && !post_data["content"]) ||
        post_data["post_title"] + post_data["content"] == autosaveLast ) {
 }}}

 Thanks,
 Marcus

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


More information about the wp-trac mailing list