I am reporting https://www.drupal.org/node/1819738 to moderators because:

The document is not complete or in error. I have documented the steps I took to create a class extending the migrate_d2d class DrupalNode6Migration from this document in this issue: https://www.drupal.org/node/2471863

Either this class needs to be declared in hook_api as some sort of extending class, or there must be some way to pass the arguments from the parent class (DrupalNode6Migration) to the extending class. Note that empty constructors are now deprecated.

In any event, NONE of this is documented here. If the user assumes he can simply include the example code, that doesn't work. If the user assumes he has to declare the code as a migration class, that doesn't work either.

Whatever the author did in order to get this to work (i.e., have migrate_d2d recognize the class, pass the appropriate arguments, and add the query extensions) should be documented.

The document currently states:

Another common use case for overriding migration classes is modifying the base query. Each of the migrate_d2d classes has a query() method, returning the query object used to pull source data. By doing this rather than hard-coding the query into the constructor, you have the opportunity to customize the query for your application

But, as written, there is no indication of what else needs to be done in order to "modify the base query". Or, something has changed in Migrate d2d that makes this not possible as described here. It does not appear to work in Migrate d2d 7.x-2.1 as described.

Thanks for your attention to this matter.

Comments

merauluka’s picture

Assigned: Unassigned » merauluka
Issue tags: +neworleans2016, +drupalcon, +MentoredSprint

I'm taking a look into this issue as part of DrupalCon mentored sprint at New Orleans 2016.

merauluka’s picture

Status: Active » Fixed
Issue tags: +nola2016

I added a link to the Migrate documentation that details how to create and register custom classes which is really what is missing there. The rest of that documentation appears to be complete.

Marking this is fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.