[wp-trac] [WordPress Trac] #29044: TypeError: Cannot read property 'avatar' of undefined

WordPress Trac noreply at wordpress.org
Fri Aug 1 19:56:54 UTC 2014


#29044: TypeError: Cannot read property 'avatar' of undefined
--------------------------+------------------------------
 Reporter:  michalzuber   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Revisions     |     Version:  trunk
 Severity:  minor         |  Resolution:
 Keywords:                |     Focuses:  javascript
--------------------------+------------------------------

Comment (by adamsilverstein):

 I brought this up with Nacin at WordCamp NYC contributor day and he
 pointed out that you could also get the same situation after using the
 WordPress importer which would create posts lacking revisions. Opening one
 of these posts and letting the autosave fire would likely reproduce the
 bug.

 Therefore, I'm going to look at two possible solutions:
  * creating the initial revision on the fly in PHP in the same way that we
 upgrade revisions previous to 3.6 when upgrading to 3.6;
 * creating the missing data on the fly in JS - lacking an initial
 revision, use the current editor content instead.

 Replying to [comment:1 adamsilverstein]:
 > This appears to be a data issue with the sample data provided by
 WordPress. The post you edited has no initial revision, so the 'first'
 comparison doesn't work correctly.
 >
 > Here are the rows in my database (screenshot below) - you can see the
 bundled data Sample post (red) has just two rows, the original content and
 the autosave. The actual Test post I created (blue) has an initial
 revision that matches the post content when saved as well as the autosave,
 and the issue is not reproducible.
 >
 > This is either won't-fix, or we need to adjust the bundled data to
 include the initial revision.
 >
 >
 [[Image(http://f.cl.ly/items/0Z0f392T1w3K2K1G3b3v/(MySQL%205.5.29)%20wpdev.localhost/wpdev/wp_posts%202014-08-01%2015-40-29%202014-08-01%2015-41-11.jpg)]]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29044#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list