Problem/Motivation

I discovered that schema for drupal6-related sources is placed in migrate module: 'drupal8-core/core/modules/migrate/config/schema/migrate.source.schema.yml'. Think it should be in 'drupal8-core/core/modules/migrate_drupal/config/schema/migrate.source.schema.yml'

Proposed resolution

Provide patch for that

Remaining tasks

No.

User interface changes

No.

API changes

No.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, move_d6_source_schema.patch, failed testing.

benjy’s picture

Tagging for "Avoid commit conflicts" since this will need re-rolling for quite a lot of migrate issues.

benjy’s picture

Tagging for "Avoid commit conflicts" since this will need re-rolling for quite a lot of migrate issues.

estoyausente’s picture

Rerolled.

estoyausente’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: move_d6_source_schema-4.patch, failed testing.

estoyausente’s picture

Oh, I made a backwuard patch -.-"

estoyausente’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: move_d6_source_schema-6.patch, failed testing.

Status: Needs work » Needs review
olav’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Amsterdam2014

I have reviewd and applied the patch from #7.
I have uninstalled (using drush) & re-enabled (using the UI) the migrate_drupal module.
The patch looks good.

olav queued 7: move_d6_source_schema-6.patch for re-testing.

Rade’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
17.1 KB
8.7 KB

The patch did not remove the old file. Here is an updated patch.

olav’s picture

Status: Needs review » Reviewed & tested by the community

Oh, good point. I applied patch #13 again. Now it not just adds the file in the new location, but actually moves it across from the old to new location.

benjy’s picture

Status: Reviewed & tested by the community » Needs work

Sorry back to NW, the Empty source needs to stay in the migrate module as it's provided by migrate.

estoyausente’s picture

Status: Needs work » Needs review
FileSize
16.15 KB

Something like this? (I just change the header comment of the file too, we had forgotten it.

Status: Needs review » Needs work

The last submitted patch, 16: move_d6_source_schema-15.patch, failed testing.

ultimike’s picture

Status: Needs work » Needs review
FileSize
16.54 KB

This is my first time working with these schema files, so I'm not sure if I'm doing it correctly, but I figured I'd give it a shot...

Updated patch attached, that _might_ fix the failing tests.

One thing I noticed that I'm wondering about is on line 5 of /core/modules/migrate/config/schema/migrate.source.schema.yml:

label: 'Drupal 6 field formatter'

This doesn't seem correct. Should it be something like:

label: 'Drupal 6 empty source'

-mike

Status: Needs review » Needs work

The last submitted patch, 18: 2312385-18.patch, failed testing.

ultimike’s picture

FileSize
16.9 KB

Good golly, this one seems like it should be easy, but I still can't get it to work...

The issues are with the d6_user_picture_field and d6_upload_field schemas - both of which are a little odd because they contain a "plugin" source variable (which I can't seem to figure out how to properly list in the schema file).

Updated patch attached.

-mike

andyceo’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 20: 2312385-20.patch, failed testing.

svendecabooter’s picture

The tests seem to fail because the "migrate.source.empty" definition is still in the migrate module schema yml.
If I move it locally to the migrate_drupal schema yml file, the DefaultConfigTest passes.

So I'm assuming that's the cause of the problem.
Now we need to find a way to solve it :)

svendecabooter’s picture

Status: Needs work » Needs review
FileSize
16.95 KB

This was probably caused by the fact that both files had the name "migrate.source.schema.yml".
I renamed the one in migrate_drupal to "migrate_drupal.source.schema.yml", and this seems to work locally.
Unless I'm missing something here, since I'm no expert on the schema files...

Attaching a new version of ultimike's patch to see if this works...

ultimike’s picture

@svendecabooter - Holy cow, I hope that's it. I would have never figured that out on my own...

I don't think I'm qualified to review this patch, but benjy indicated he'll have some time this weekend to review patches.

Thanks,
-mike

benjy’s picture

Status: Needs review » Reviewed & tested by the community

Yep, looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Stuff is changing on the copy...

For example:

 migrate.source.d6_node_type:
-  type: migrate_source_sql
+  type: migrate_source

This patch should be generated with the following in the git config file

[diff]
        renames = copies

As it makes this possible to spot. For more on a recommended git config see https://www.drupal.org/documentation/git/configure

benjy’s picture

wow, good catch. What the heck causes that to be renamed?

svendecabooter’s picture

Status: Needs work » Needs review
FileSize
17 KB

I continued from ultimike's patch, but that seemed to have been an attempt to fix the failed tests.
New patch in attachment which just moves the appropriate schema entries over, without changing them.

benjy’s picture

Status: Needs review » Reviewed & tested by the community

OK, chx showed me that `git diff -C HEAD` gives a much better view of what has changed when a file has been moved.

New patch looks much better.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/migrate/config/schema/migrate.source.schema.yml
    @@ -1,235 +1,5 @@
    -migrate.source.*:
    -  type: migrate_source
    -  label: 'Default source'
    

    Pretty certain this still belongs in the migrate module and not migrate_drupal

  2. +++ b/core/modules/migrate/config/schema/migrate.source.schema.yml
    @@ -1,235 +1,5 @@
    -migrate.source.variable:
    -  type: migrate_source_sql
    -  label: 'Variable'
    -  mapping:
    -    variables:
    -      type: sequence
    -      label: 'Variables'
    -      sequence:
    -        - type: string
    -          label: 'Variable'
    -    constants:
    -      type: mapping
    -      label: 'Constants'
    -      mapping:
    -        entity_type:
    -          type: string
    -          label: 'Entity type'
    -        id:
    -          type: string
    -          label: 'ID'
    -        label:
    -          type: label
    -          label: 'Label'
    -        description:
    -          type: text
    -          label: 'Description'
    -        path:
    -          type: string
    -          label: 'Path'
    -        plugin:
    -          type: string
    -          label: 'Plugin'
    

    Is this D6 only?

  3. +++ b/core/modules/migrate/config/schema/migrate.source.schema.yml
    @@ -1,235 +1,5 @@
    -migrate.source.variable_multirow:
    -  type: migrate_source_sql
    -  label: 'Drupal 6 box'
    -  mapping:
    -    variables:
    -      type: sequence
    -      label: 'Variables'
    -      sequence:
    -        - type: string
    -          label: 'Variable'
    

    The label looks incorrect. This does not look d6 specific.

  4. +++ b/core/modules/migrate/config/schema/migrate.source.schema.yml
    @@ -256,129 +26,3 @@ migrate.source.empty:
    -migrate_entity_constant:
    -  type: mapping
    -  mapping:
    -    entity_type:
    -      type: string
    -      label: 'Entity type'
    -    bundle:
    -      type: string
    -      label: 'Bundle'
    -    label:
    -      type: label
    -      label: 'Label'
    -    id:
    -      type: string
    -      label: 'ID'
    -    view_mode:
    -      type: string
    -      label: 'View mode'
    -    form_mode:
    -      type: string
    -      label: 'Form mode'
    -    field_name:
    -      type: string
    -      label: 'Field name'
    -    empty:
    -      type: sequence
    -      label: 'Empty'
    -      sequence:
    -        - type: string
    -          label: 'Empty'
    -    name:
    -      type: string
    -      label: 'Name'
    -    preview:
    -      type: integer
    -      label: 'Preview'
    -    create_body:
    -      type: boolean
    -      label: 'create body'
    -    required:
    -      type: boolean
    -      label: 'Required'
    -    type:
    -      type: string
    -      label: 'Type'
    -    cardinality:
    -      type: integer
    -      label: 'Cardinality'
    -    parent:
    -      type: integer
    -      label: 'Parent'
    -    langcode:
    -      type: string
    -      label: 'Type'
    -    third_party_settings:
    -      type: sequence
    -      label: 'Settings'
    -      sequence:
    -        - type: ignore
    -          label: 'Settings'
    -    settings:
    -      type: sequence
    -      label: 'Settings'
    -      sequence:
    -        - type: ignore
    -          label: 'Settings'
    -    options:
    -      type: mapping
    -      label: 'Options'
    -      mapping:
    -        label:
    -          type: string
    -          label: 'label'
    -        type:
    -          type: string
    -          label: 'Type'
    -        weight:
    -          type: integer
    -          label: 'Weight'
    -        settings:
    -          type: sequence
    -          label: 'Settings'
    -          sequence:
    -            - type: string
    -              label: 'Settings'
    

    This does not look d6 specific

benjy’s picture

Title: Move schemas for drupal 6 migration to migrate_drupal module » Move schemas for migrate_drupal sources to migrate_drupal module
Status: Needs work » Needs review
FileSize
1.52 KB
10.67 KB
  1. Fixed
  2. No it's not D6 specific. Not sure why that matters?
  3. labels fixed for both migrate.source.d6_field: and migrate.source.variable_multirow:
  4. Again not sure what this has to do with been D6 specific?

Maybe the issue title made is why you mentioned D6 specific? Updated.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Whether migrate_entity_constant is reusable for non - migrate_drupal migrations, who knows? Maybe yes, maybe no, more likely no than yes. But who care? It's just rather meaningless schema. There's nothing fancy there, no new types, tricky references, nothing. Your constants will likely be slightly different, write your own scheme.

  • alexpott committed 2c2e2ce on 8.0.x
    Issue #2312385 by estoyausente, svendecabooter, ultimike, benjy, Rade,...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs reroll, -Avoid commit conflicts

Committed 2c2e2ce and pushed to 8.0.x. Thanks!

migrate.source.empty:
  type: migrate_source_sql
  label: 'Drupal 6 field formatter'

Interesting label - can someone file a followup issue to fix.

ultimike’s picture

Followup issue filed: #2365891: Incorrect schema label.

-mike

Status: Fixed » Closed (fixed)

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