WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#16479 closed defect (bug) (fixed)

Export xml file errors

Reported by: elfin Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Export Keywords: has-patch needs-testing
Focuses: Cc:

Description

Recieving an error such as this with the generated xml file:

<wp:author><br />
<b>Notice</b>:  Trying to get property of non-object in <b>E:\htdocs\wpbeta\wp-admin\includes\export.php</b> on line <b>246</b><br />
<wp:author_id></wp:author_id><br />
<b>Notice</b>:  Trying to get property of non-object in <b>E:\htdocs\wpbeta\wp-admin\includes\export.php</b> on line <b>247</b><br />
<wp:author_login></wp:author_login><br />
<b>Notice</b>:  Trying to get property of non-object in <b>E:\htdocs\wpbeta\wp-admin\includes\export.php</b> on line <b>248</b><br />
<wp:author_email></wp:author_email><br />
<b>Notice</b>:  Trying to get property of non-object in <b>E:\htdocs\wpbeta\wp-admin\includes\export.php</b> on line <b>249</b><br />
<wp:author_display_name><![CDATA[]]></wp:author_display_name><br />
<b>Notice</b>:  Trying to get property of non-object in <b>E:\htdocs\wpbeta\wp-admin\includes\export.php</b> on line <b>250</b><br />
<wp:author_first_name><![CDATA[]]></wp:author_first_name><br />
<b>Notice</b>:  Trying to get property of non-object in <b>E:\htdocs\wpbeta\wp-admin\includes\export.php</b> on line <b>251</b><br />
<wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>

I thought this may have been caused by users created via a plugin - but after having deleted those, this error is still appearing.

Attachments (1)

16479.diff (487 bytes) - added by nacin 3 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 nacin3 years ago

  • Milestone changed from Awaiting Review to 3.1

This can happen when get_userdata() returns false, such as when a post's author no longer exists. It's not supposed to happen, but it's definitely possible. We should run an array_filter() on $authors before entering the foreach loop.

nacin3 years ago

comment:2 nacin3 years ago

  • Keywords has-patch needs-testing added

See how that works.

comment:3 elfin3 years ago

Works for me.

comment:4 markjaquith3 years ago

Can reproduce this in 3.1 (trunk), but not in the 3.0 branch, so this is a new bug. Fix looks good. Tested it. Resolves the problem.

comment:5 markjaquith3 years ago

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

(In [17415]) Skip authors that no longer exist when doing an export. props nacin. fixes #16479

comment:6 automattor3 years ago

(In [17416]) Skip authors that no longer exist when doing an export. props nacin. fixes #16479 for 3.1

Note: See TracTickets for help on using tickets.