On a clean Drupal install, I attempted to migrate my Wordpress blog. I did it via the UI first and received some incomprehensible errors, and afterwards attempted it via Drush, and receieved some better errors:
server:/drupal# drush mi --all
achtonnetBlogEntry addFieldMapping: field_tags was previously mapped, overridden [warning]
Imported 1 in 0.1 sec (837/min) - done with 'achtonnetAuthor' [completed]
Imported 21 in 0.7 sec (1842/min) - done with 'achtonnetCategory' [completed]
Imported 3 in 0.2 sec (1479/min) - done with 'achtonnetTag' [completed]
array_diff(): Argument #1 is not an array [error]
File /drupal/modules/wordpress_migrate/wordpress_item.inc, line 767
array_diff(): Argument #1 is not an array [error]
File /drupal/modules/wordpress_migrate/wordpress_item.inc, line 767
array_diff(): Argument #1 is not an array [error]
File /drupal/modules/wordpress_migrate/wordpress_item.inc, line 767
[...]
Imported 1 in 4.5 sec (1623/min) - done with 'achtonnetBlogEntry' [completed]
Imported 9 in 2.1 sec (257/min) - done with 'achtonnetPage' [completed]
Imported 28 in 5.4 sec (313/min) - done with 'achtonnetAttachment' [completed]
No node ID provided for comment [error]
No node ID provided for comment [error]
No node ID provided for comment [error]
[...]
Imported 0 in 2.2 sec (2163/min) - done with 'achtonnetComment' [completed]
This was my fix, though I am unsure of how correct it is:
diff --git a/wordpress_item.inc b/wordpress_item.inc
index 48e095d..da6199a 100644
--- a/wordpress_item.inc
+++ b/wordpress_item.inc
@@ -764,7 +764,7 @@ abstract class WordPressItemMigration extends WordPressMigration {
}
}
}
- $diff = array_diff($row->$value_name, $done_terms);
+ $diff = array_diff((array) $row->$value_name, $done_terms);
foreach ($diff as $new_term_name) {
// Let's see if the term already exists
$matches = taxonomy_term_load_multiple(array(),
NB: This seems to only fix it when using Drush.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | vocab_language-1785980-2.patch | 3 KB | mikeryan |
Comments
Comment #1
mikeryanLooking at the code, you should only be falling through there if you hadn't already imported the tags and categories, but it looks like you have. I suspect that the assumption of LANGUAGE_NONE may be failing - what are your language settings?
Thanks.
Comment #2
mikeryanHere's a patch to handle languages intelligently, does it fix what you're seeing?
Thanks.
Comment #3
mikeryanActually, I think this patch is the right thing to do, even if it turns out not to be the fix for your problem, so I've gone ahead and committed it. If you find that it doesn't address your issue, please reopen.
Thanks.
Comment #4
mikeryanPossible problem with this fix: http://drupal.org/node/1818730#comment-6657462
Comment #5
mikeryanOK, added a test for the existence of the tag/category value.
Comment #6.0
(not verified) commentedUpdated issue summary.