Problem/Motivation

Contact Save module was written ages ago for Drupal 6 and Drupal 7. It would be nice to be able to have a migration path from contact save to contact storage for at least the contact form storage. Contact Save has more functionality than Contact Storage such as the reply functionality, and so it may be a good idea to merge efforts and reduce project duplication.

Proposed resolution

Add a migration plugin for the contact_save schema to the contact entity storage.

Remaining tasks

  • Review feature request
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

Priority: Normal » Major

Nice idea

sidharthap’s picture

Assigned: Unassigned » sidharthap

I am working on it.

sidharthap’s picture

Assigned: sidharthap » Unassigned
mradcliffe’s picture

Status: Active » Needs work
FileSize
3.08 KB

Here is a work-in-progress patch. I have not been able to start testing and debugging what else needs to be done because even though migration template is in config it's not being picked up by migrate-upgrade --configure-only.

mradcliffe’s picture

Status: Needs work » Needs review
FileSize
4.83 KB
3.79 KB

This patch successfully migrates data one time. It looks like it migrates in dupes if run each consecutive time.

This interdiff looks a bit weird but that's what interdiff output. :|

todo:

1. Recipients process plugin
2. Add created date to migration
3. UID migration

for discussion:

- should this also migrate and create fields for reply, replied, replier, and uid?

mradcliffe’s picture

Also, switching from SourcePluginBase to SqlBase caused a dependency on adding 'migrate' key into databases in settings.php. I'm not sure why.

mradcliffe’s picture

This should be feature complete for Drupal 6 migration of contact_save with the addition of created and recipient migration.

If another module has changed the cardinality of the recipient field to multiple values, then this migration will support that. However, if not, then it will just use one recipient.

Re-rolled patch based on git pull.

Edit: any additional features could be added by another module or for Drupal 7 contact_save.

andypost’s picture

@mradcliffe Thanx, code looks good!
If we wanna to make storage into 8.2 we need test coverage for each module's features

mradcliffe’s picture

Migrate tests are not my strength so let's see how much this patch fails.

Edit: this is just a start of a test.

Status: Needs review » Needs work

The last submitted patch, 9: contact_storage-2500651-contact_save-migration-9.patch, failed testing.

mradcliffe’s picture

Hmm.. Maybe test_dependencies?

Status: Needs review » Needs work

The last submitted patch, 11: contact_storage-2500651-contact_save-migration-11.patch, failed testing.

mradcliffe’s picture

Oh, it was removed some time in 8.1.x development but no change record exists for it? :(

The last submitted patch, 11: contact_storage-2500651-contact_save-migration-11.patch, failed testing.

mradcliffe’s picture

Status: Needs work » Needs review
FileSize
13.32 KB
3.15 KB

Found you sneaky issue #2684141: Convert migrate kernel tests to KernelTestBaseTNG.

Anyway, here's a patch that should at least run in 8.2.x.

Status: Needs review » Needs work

The last submitted patch, 15: contact_storage-2500651-contact_save-migration-15.patch, failed testing.

mradcliffe’s picture

Status: Needs work » Needs review
FileSize
13.18 KB
725 bytes

Another try.

Status: Needs review » Needs work

The last submitted patch, 17: contact_storage-2500651-contact_save-migration-17.patch, failed testing.

mradcliffe’s picture

Status: Needs work » Needs review
FileSize
13.15 KB
498 bytes

Fixed namespace

Status: Needs review » Needs work

The last submitted patch, 19: contact_storage-2500651-contact_save-migration-19.patch, failed testing.

mradcliffe’s picture

Status: Needs work » Needs review
FileSize
13.2 KB
562 bytes

Install schema before test similar to other kernel test.

Status: Needs review » Needs work

The last submitted patch, 21: contact_storage-2500651-contact_save-migration-21.patch, failed testing.

jibran’s picture

The patch looks good can we please clear out the phpcs issues and fails.