Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
migration system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Mar 2014 at 00:31 UTC
Updated:
29 Jul 2014 at 23:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
eliza411 commentedComment #2
benjy commentedForgot to post it?
D8 stores the recipients as an array. Please try the attached patch.
Comment #3
eliza411 commentedOops.
Manifest:
# contact
- d6_contact_category
- d6_contact_settings
The recipients are being copied, the errors are gone, but the default category isn't being set.
Comment #4
benjy commentedYes I see the problem, the category is
selectedin thecontacttable but in Drupal 8 we need to set the default_category key in the contact.settings.yml config.Proposed Solution
Create a new source for the
d6_contact_settingsmigration which extends variable, gets the existing variables and then queries the contact table for the "default" category. The default can then be mapped in the migration to default_category.Comment #5
ultimikeBenjy,
Tell me if I'm on the right track...
I'd like to take this one on - this seems like something relatively straight-forward that I can get my feet wet on. Can you point me in the direction of a similar source migration that extends variable and does something similar? I went through all the existing D6 source migrations and didn't find any...
Thanks,
-mike
Comment #6
chx commentedTo elaborate
Drupal\migrate_drupal\Plugin\migrate\source\d6\ContactSettingsclass/plugin extendingVariable.Variablemovearray_map('unserialize', $this->prepareQuery()->execute()->fetchAllKeyed()into a new method, I recommend calling itvaluesComment #7
ultimikeBenjy, chx - thanks for the info above (and thanks, chx, for your time on IRC).
Attached is a patch that adds a new D6 ContactSettings class that takes care of migrating the default category to D8. I've added a new assertion to the MigrateContactConfigsTest as well, and it passed on my local machine.
-mike
Comment #8
ultimikeUpdated previous patch with proper dependency and migration process plugin. Tests still pass!
-mike
Comment #9
chx commentedComment #10
ultimikeComment #11
ultimikeRe-rolled patch.
Third time's a charm!
-mike
Comment #12
benjy commentedThis is looking good, just some super minor formatting errors.
Missing new line.
Trailing space.
Lets add a new line here as well.
Missing new line.
Comment #13
ultimikeBenjy,
Thanks for the review. I just updated the patch with your changes as well as strengthened the MigrateContactCategoryTest with some additional dump data and assertions.
I locally ran the following tests, with everything passing:
Thanks,
-mike
Comment #15
ultimikeHmm - all tests pass on my local via CLI. Is this a testbot glitch? Should I resubmit the patch for re-testing?
-mike
Comment #16
chx commented13: 2214313-13.patch queued for re-testing.
Comment #22
ultimikeBeing a bit paranoid, I just:
I'm also hiding the previous patches (hoping that the testbot doesn't test patches that don't have their "Display" option selected).
I'm re-submitting the patch for testing...
-mike
Comment #23
ultimike13: 2214313-13.patch queued for re-testing.
Comment #25
benjy commented@ultimike, what version of PHP are you using? The testbot is using PHP 5.4 so if you're using a version less, that would probably be your issue.
Comment #26
chx commentedRecipients is an array and yes this is possibly passing on PHP 5.3 but def not on PHP 5.4
Comment #27
benjy commentedSome docs here would be good.
Comment #28
chx commentedWhat for? https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/variab... has the same query and has no query-related comments.
Comment #29
chx commentedOh I see you wanted doxygen!
Comment #31
benjy commented29: 2214313_29.patch queued for re-testing.
Comment #33
ultimikeBenjy, chx,
I'm running PHP 5.4.4 locally and I run all tests via the CLI:
Good catch on the recipients array stuff.
I just pulled 8.x, applied 2214313_29.patch, and all tests pass on my local.
The latest testbot fail (#32) appears to be due to it running out of free disk space (
file_put_contents(): Only 0 of 74 bytes written, possibly out of free disk)...-mike
Comment #34
benjy commented29: 2214313_29.patch queued for re-testing.
Comment #35
chx commentedComment #36
benjy commentedLooks good to me.
Comment #37
webchickCommitted and pushed to 8.x. Thanks!