I found a sneaky bug, that would only show up with the right circumstances in play.

When using a wysiwyg editor like ckeditor ( standalone ) or tinymce ( via the wysiwyg module ) posts that have

have an ugly problem. This is related to the way that the node module handles teasers, I think...here's what I found:

Upon first import, everything looks good more or less. However, when you edit a post and save it, you'll either not see the teaser, or it will show twice, depending upon the state of the 'show summary in full view' checkbox.

After some investigating, I decided to run an sql query to strip the

tags, and after doing so I was able to get the nodes to save and render properly...

Further investigation uncovered that that by default, wordpress_import doesn't seem to populate the teaser field in the node_revisions table. The Node module, on the other hand, always populates teasers on every save. The 'Show summary in full view' checkbox appears to control whether the teaser is only saved to the node_revisions.teaser field, or also appended into the top of the body field as well.

I can't patch and test on this right now, as I'm under a deadline, but something like this might work...starting on or around wordpress_import.module:1019

  // existing more->break conversion
  $node['body'] = str_replace('<!--more-->', '<!--break-->', $post['content']);
  // set teaser into node.
  array($teaser, $remaining) =   explode("<!--break-->", $node['body']);

  $node['teaser'] = $teaser;

This is all based on observing how the node_revisions table is altered between the default state of an imported node, and the condition it's in after saving. I'm sure I don't understand all this fully, I'm just guessing that since normal node creation always writes a teaser field, wordpress_import might need to do so as well to maintain a consistent state for other modules to work with.

Comments

dsayswhat’s picture

I should also mention that the above code snippet doesn't handle teaser cases where there is no

tag...that would also need to be handled.

dsayswhat’s picture

Forget everything I just wrote. The bug exists, but the fix was different. Teasers may well be created by wordpress_import, possibly as a result of node_save.

Whatever that default behavior was, it results in missing or duplicate summaries.

To fix, I had to:

1. replace all

tags in the node_revisions.body field.
2. unset all the teaser fields in node_revisions.

Then things seemed to work fine. HUGE hassle, sorry for the confusion. At this point I'm just trying to get on with my job, but it's a serious issue for me, as I'm burning hours trying to figure out how to make their content maintainable after import.

Thanks for the module - it worked pretty well for me, apart from this.

Oscar Illada’s picture

i have the same problem what can i do? thanks, i use 6.x-1 version because works with huge xml files.

lavamind’s picture

I verified this with FCKeditor, and I couldn't reproduce the problem. For a post with a <!--more--> tag in its body, the module correctly changed it into a <!--break--> and was recognized by Drupal and FCKeditor.

Perhaps if you let me look at your WXR file I could figure out what's happening.