Postponed on #3202462: [PP-1] Provide option for contrib modules to map their D6 / D7 field formatter and widget plugin IDs to the equivalent D9 plugin ID
which is postponed on #3204212: Convert remaining widget and formatter type migrations to MigrateField plugins

See Change Record DRAFT: https://www.drupal.org/node/3208917

Problem/Motivation

Inline Entity Form can be used for multiple field types. The widget settings are not correctly migrated for all of them. Ensure that they are migrated correctly for the following field types:

  • entityreference
  • commerce_line_item_reference
  • commerce_product_reference

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

omkar.podey created an issue. See original summary.

omkar.podey’s picture

StatusFileSize
new1.58 KB

initial patch, additional check in MigrationHelper, adding hook_field_migration_field_widget_info().

immaculatexavier’s picture

Status: Active » Needs review
StatusFileSize
new1.5 KB
new1.09 KB

Attached patch against #2

geek-merlin’s picture

Status: Needs review » Postponed (maintainer needs more info)

Sorry folks. There is already too many similar issues and patches out there.
Please never open issues without researching what's there already.
There's no issue summary either.

Adding this issue contributes to chaos, unnecessary work for others, adds bad karma, and negative contribution points.
Please do the clean up work.

wim leers’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Needs review

Done.

geek-merlin’s picture

Status: Needs review » Postponed (maintainer needs more info)
Parent issue: » #3272784: 3272784-migration-meta-issue-combined

Thanks Wim for chiming in and clarifying... partially.

> There is already too many similar issues and patches out there.
> Please never open issues without researching what's there already.

See parent issue.

anybody’s picture

Please note that the patch posted in #3 overlaps with the patches posted here: #3213595: MigrationHelper::alterPlugins assumes settings isn't already an array

But #3 in this issue additionally contains:

+/**
+ * Implements hook_field_migration_field_widget_info().
+ */
+function inline_entity_form_field_migration_field_widget_info(Row $row) {
+  if ($row->getDestinationProperty('field_type') === 'entity_reference') {
+     $addition = [
+       'inline_entity_form_single' => 'inline_entity_form_simple',
+       'inline_entity_form' => 'inline_entity_form_complex'
+     ];
+    return [
+      'entityreference' => $addition,
+      'commerce_line_item_reference' => $addition,
+      'commerce_product_reference' => $addition
+    ];
+  }
+  return [];
+}

which seems to be the key point here.

Did anyone review or test this already? Any suggestions in which of the issues to proceed?

anybody’s picture

Title: Update MigrationHelper and add hook_field_migration_field_widget_info() to add widget mappings. » [PP-2] Update MigrationHelper and add hook_field_migration_field_widget_info() to add widget mappings.
Issue summary: View changes
Status: Postponed (maintainer needs more info) » Postponed

!! Important information !!
(would have been nice if the patch authored had mentioned this .......)

All patches here in #2 and #3 are based on #3202462: [PP-1] Provide option for contrib modules to map their D6 / D7 field formatter and widget plugin IDs to the equivalent D9 plugin ID (CR DRAFT: https://www.drupal.org/node/3208917) which has not been committed yet. It's also postponed on #3204212: Convert remaining widget and formatter type migrations to MigrateField plugins !

This is why nothing will happen without also applying the core patches. So we should postpone this on these issues.

Furthermore, this will need work once the parent issue with the other changes is committed, for example this line is wrong:

           $settings[] = $migration['process']['settings'];
+          $settings = $migration['process']['settings'];

the above line has to be removed, but as this is also part of the parent / sibling issue, the future patch should ONLY contain the relevant changes here, which means the new hook implementation!

anybody’s picture

Issue summary: View changes
geek-merlin’s picture

Thanks for the great cleanup work!