When I attempted to import the xml file from a WordpressMU instance, I got the following warnings:
* warning: Invalid argument supplied for foreach() in sites/all/modules/wordpress_import/wordpress_import.module on line 880.
* warning: Invalid argument supplied for foreach() in sites/all/modules/wordpress_import/wordpress_import.module on line 168.
* warning: Invalid argument supplied for foreach() in sites/all/modules/wordpress_import/wordpress_import.module on line 343.
* warning: in_array() [function.in-array]: Wrong datatype for second argument in sites/all/modules/wordpress_import/wordpress_import.module on line 353.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in sites/all/modules/wordpress_import/wordpress_import.module on line 385.
* warning: Invalid argument supplied for foreach() in sites/all/modules/wordpress_import/wordpress_import.module on line 494.
* warning: Invalid argument supplied for foreach() in sites/all/modules/wordpress_import/wordpress_import.module on line 343.
* warning: in_array() [function.in-array]: Wrong datatype for second argument in /sites/all/modules/wordpress_import/wordpress_import.module on line 353.
And no content gets imported.
I get this behavior regardless of whether I am importing a single user's blog or all the users' blogs. Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fix_sorting_fix_mu_import.patch | 663 bytes | elcuco |
Comments
Comment #1
humanchimp commentedI have the same problem... I have Drupal 5 and the latest snapshot of the Importer. I have downloaded the contents of a relatively small and simple Wordpress blog, try to import, and this is what I get:
error php 11/17/2008 - 20:48 in_array() [. admin
error php 11/17/2008 - 20:48 Invalid argument supplied for foreach() in ... admin
error php 11/17/2008 - 20:48 Invalid argument supplied for foreach() in ... admin
error php 11/17/2008 - 20:48 array_merge() ... admin
error php 11/17/2008 - 20:48 in_array() ... admin
error php 11/17/2008 - 20:48 Invalid argument supplied for foreach() in ... admin
error php 11/17/2008 - 20:48 Invalid argument supplied for foreach() in ... admin
error php 11/17/2008 - 20:48 Invalid argument supplied for foreach() in ... admin
error php 11/17/2008 - 20:48 Invalid argument supplied for foreach() in ... admin
error php 11/17/2008 - 20:48 Invalid argument supplied for foreach() in ... admin
Has WP updated their XML schema? Or do I have something configured wrong?
Comment #2
elcuco commentedThe attached path fixes two things:
When exporting from MU $wordpress['categories'] is not set, and then wordpress_import_import_categories() does not return anything (WTF?) which causes wordpress_import_import_blog() to fail (you try to merge an array and NULL). The fix is trivial: at the end of function wordpress_import_import_categories(), after at the end of the function add this code:
On wordpress, the comments are displayed from the latest to the newest. After import on Drupal I see the newest comments on the top, so I had to reverse the order of those comments. Inside wordpress_import_post() after the ksort() I added this line:
I did a few tests on my local setup and it seems to work, so I attach here a patch against version 6.x-1.0 of the module, people using drupal5 you can always update to drupal6 or patch manually ;-)
Comment #3
yrocq commentedI will integrate the code for the categories as soon as possible.
However, note that the change you made for ordering the comments may break the thread hierarchy. A better solution would be to choose the order that you want in the "Default display order" section of the content type form in Drupal.
Comment #4
yrocq commentedFixed in branches DRUPAL-5 and DRUPAL-6--1