Is it possible to migrate into this field using the Migrate module?

Comments

jstoller’s picture

I have not personally used Migrate, or attempted to migrate data into Publication Date. Based on what I know of the process, I would say it's certainly possible to do this, but Publication Date does not provide any special Migrate integration.

I would be interested in adding Migrate integration to this module, but I currently do not have the expertise to do so and am a little short on free time. If you end up building the necessary handler classes to do this and would like to contribute back to Publication Date, I'd be happy to accept a patch.

bjalford’s picture

Status: Active » Needs review
StatusFileSize
new1.59 KB

Patch attached

jstoller’s picture

Version: 7.x-2.2-rc1 » 7.x-2.x-dev
StatusFileSize
new1.42 KB

@bjalford, Sorry this took me so long, but I made some change to your patch which, I think, improve things. I don't have a way to test this though, so if you could check it out and report back I'd appreciate it. If it works, I'm happy to commit this for the next release.

The big changes I made are:

  • Moved publication_date.migrate.inc into the /includes directory, just to keep things clean, and updated publication_date.info to reflect that.
  • Changed the prepare function to provide a default value for any node that isn't set, or has an empty value (this value is required as of #2532576: Fix sorting on publication date so unpublished content appears newer)
  • Moved publication_date_migrate_api() from the .module file to publication_date.migrate.inc. I read that this was the correct place for it, but not sure if it still works when publication_date.migrate.inc isn't in the root directory.
mably’s picture

Status: Needs review » Closed (outdated)

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.