It appears that extending WordPressBlogEntry, as described in https://drupal.org/node/1593370 does not work. In wordpress_migrate.migrate.inc (line ~674), WordPressBlogEntry is automatically registered as the class to handle imports of Wordpress blog entries.
$this->addMigration('BlogPost', 'WordPressBlogEntry', $arguments);
This creates a db entry in the migrate_status table.
Possible idea for solutions.
$this->addMigration('BlogPost', variable_get('wordpress_migrate_blog_entry_class', 'WordPressBlogEntry'), $arguments);
I'm happy to provide a patch, but I'd rather hear the authors desired route prior to my submission. Thanks!
Comments
Comment #1
dafederAgreed, been struggling with this and definitely doesn't seem to be working...
Comment #2
dafederI'm also getting a number of error messages on most page loads now. They look something like:
Notice: Undefined index: post_type in WordPressBlogEntry->__construct() (line 805 of [XXX]/sites/all/modules/contrib/wordpress_migrate/wordpress_item.inc).
Notice: Undefined index: text_format in WordPressItemMigration->__construct() (line 168 of [XXX]/sites/all/modules/contrib/wordpress_migrate/wordpress_item.inc).
Notice: Undefined index: path_action in WordPressItemMigration->__construct() (line 179 of [XXX]/sites/all/modules/contrib/wordpress_migrate/wordpress_item.inc).
Notice: Undefined index: tag_vocabulary in WordPressItemMigration->__construct() (line 226 of [XXX]/sites/all/modules/contrib/wordpress_migrate/wordpress_item.inc).
Notice: Undefined index: category_vocabulary in WordPressItemMigration->__construct() (line 227 of [XXX]/sites/all/modules/contrib/wordpress_migrate/wordpress_item.inc).
Notice: Undefined index: podcast_field in WordPressItemMigration->__construct() (line 242 of [XXX]/sites/all/modules/contrib/wordpress_migrate/wordpress_item.inc).
Notice: Undefined index: attachment_field in WordPressItemMigration->__construct() (line 249 of [XXX]/sites/all/modules/contrib/wordpress_migrate/wordpress_item.inc).
Debugging the __construct() function for my class, these are the arguments its receiving that throw an error, as they don't include a number of arguments needed for WordPressBlogEntry:
Comment #4
mikeryanFix committed - overriding classes will now work as documented at https://www.drupal.org/node/1593478 when using the new wizard.
Comment #6
neuquen commentedI am still getting the same exact error message as you guys even though I'm using the latest version. I followed the instructions which were linked above (https://www.drupal.org/node/1593478) almost exactly:
I extended the blog entry class in includes/CustomWordPressBlogEntry.inc and includes/CustomWordPressPage.inc:
I extended the WordPressBlog class in my .module file:
And I assigned the following variable:
But I still see the following errors:
UPDATE:
I figured out what the issue was in my case. When I defined the constructor within my classes, I did not pass in $arguments. After passing in $arguments everything worked. For example: