WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11484 closed defect (bug) (worksforme)

Comments are incorrectly imported

Reported by: dleshem Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Import Keywords: wxr comments import
Focuses: Cc:

Description

I'm trying to export an existing WordPress blog (v2.2.1) and import it to a new WordPress blog (v2.8.6).

The XML file WordPress created looks fine, and indeed the import process appears to work (specifying the single exported post was correctly imported with the right number of comments).

However, when viewing the imported post in the new blog, it shows with zero comments. In the management console, I see the imported comments under the "comments" section, but they are not "connected" to any post.

Attached is the WordPress WXR file. The issue was verified with a new installation of WordPress 2.6.8 (both English and Hebrew editions).

Attachments (1)

wordpress.2009-12-18.xml (35.9 KB) - added by dleshem 4 years ago.
WXR file reproducing the issue

Download all attachments as: .zip

Change History (14)

dleshem4 years ago

WXR file reproducing the issue

comment:1 dleshem4 years ago

Correction: the last line should of course read "The issue was verified with a new installation of WordPress 2.8.6 (both English and Hebrew editions)."

comment:2 ryan4 years ago

  • Milestone changed from 2.9 to 3.0

2.9 fixes some issues with comment import, although I'm not sure unconnected comments was one of them.

Setting milestone to 3.0 since 2.9 is about to release.

comment:3 dleshem4 years ago

Addition:
May or may not be related to this help request on the WordPress forums.

comment:4 nacin4 years ago

With WP_DEBUG on, importing that XML file results in these notices:

Notice: Undefined index: attachments in C:\xampp\htdocs\2.9\wp-admin\import\wordpress.php on line 845

Notice: Undefined offset: 1 in C:\xampp\htdocs\2.9\wp-admin\import\wordpress.php on line 63

This is $return = preg_replace('|<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1]);

Notice: Undefined index: comment_agent in C:\xampp\htdocs\2.9\wp-includes\comment.php on line 1134

comment:5 follow-up: dleshem4 years ago

Addition: May also be related to this other help request on the WordPress forums. This issue seems to be quite widespread.

comment:6 dleshem4 years ago

  • Milestone changed from 3.0 to 2.9.1
  • Version changed from 2.8.6 to 2.9

Same issue happens in WordPress 2.9

comment:7 follow-up: westi4 years ago

I have just tested this with an import on current 3.0-alpha which has the same import code as 2.9 and I get a single post imported with 22 comments attached too it.

I selected the create a user option and ended up with a new user which was not correctly setup - exports contain the display name which is this case does not sanitise down to a valid user_login - see #10319.

comment:8 westi4 years ago

(In [12469]) Fix some notices in the importer when importing files from old WordPress versions or not fetching attachments. See #11484.
Ensure that we check that a user is created for the username we specify and otherwise fallback to the current user
See #10319.

comment:9 in reply to: ↑ 5 westi4 years ago

  • Milestone changed from 2.9.1 to 3.0
  • Priority changed from high to normal
  • Severity changed from blocker to normal
  • Version changed from 2.9 to 2.8

Replying to dleshem:

Addition:
May or may not be related to this help request on the WordPress forums.

This relates to the Blogger importer not the WordPress importer

Replying to dleshem:

Addition: May also be related to this other help request on the WordPress forums. This issue seems to be quite widespread.

This is from Dec 2006 and I think is quite out of date now.

The above change will fix the notices (for 3.0). I can't reproduce your failure to import in my testing locally and have run this test a number of times.

Moving to 3.0 milestone and waiting for more feedback on how to reproduce this issue in 2.9

comment:10 in reply to: ↑ 7 ; follow-up: dleshem4 years ago

Replying to westi:

I have just tested this with an import on current 3.0-alpha which has the same import code as 2.9 and I get a single post imported with 22 comments attached too it.

The importer indeed REPORTS that a single post was imported with 22 comments. But then, when I actually browse to the post page no comments are displayed, and when I check the comments section in the management console the comments are no displayed either (v2.9) or displayed but not connected to the post (v2.8.6).

Does the import work for you "all the way", or did you stop checking after the import report message?

comment:11 in reply to: ↑ 10 westi4 years ago

Replying to dleshem:

Does the import work for you "all the way", or did you stop checking after the import report message?

"all the way"

The post appeared as a published post on the blog.
The comments appeared associated with that published post.

comment:12 dleshem4 years ago

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

Tested with wordpress.com and it indeed seems to work fine.
This might be an compatibility issue with the Quercus PHP engine, reported the bug there.
Thanks for the prompt feedback everyone.

comment:13 nacin4 years ago

  • Milestone 3.0 deleted
Note: See TracTickets for help on using tickets.