Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

huzooka created an issue. See original summary.

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Active » Needs review
StatusFileSize
new3.38 KB
wim leers’s picture

  1. +++ b/migrations/d7_webform.yml
    @@ -18,7 +18,8 @@ process:
    +  # TODO submit label should be migrated as part of the "elements".
    +  # 'settings/form_submit_label': submit_text
    

    Is this a @todo for this issue or for a separate issue?

  2. +++ b/src/Plugin/migrate/source/d7/D7Webform.php
    @@ -288,7 +288,10 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
    +      // Description can be missing.
    

    By "can be missing", do you mean "is optional"?

huzooka’s picture

Re #3:

  1. That's for a separate (not-yet-existing) issue.
  2. Addressed.
huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.14 KB
new968 bytes
huzooka’s picture

This additional cleanup removes every invalid source plugin setting value, except page_submit_path and page_confirm_path.

The lack of the mentioned configs leads to 'undefined index' for webform config entities, so those ones get a proper default value '' (an empty string) instead.

This patch depends on #3164697: migrations/d7 directory.

wim leers’s picture

Status: Needs review » Needs work

Even with this applied, I'm still getting:

Notice: Undefined index: size in Drupal\webform_migrate\Plugin\migrate\source\d7\D7Webform->buildFormElements() (line 346 of modules/webform_migrate/src/Plugin/migrate/source/d7/D7Webform.php).
Notice: Undefined index: type in Drupal\webform_migrate\Plugin\migrate\source\d7\D7Webform->buildFormElements() (line 381 of modules/webform_migrate/src/Plugin/migrate/source/d7/D7Webform.php).
huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

wim leers’s picture

Now I'm still seeing:

Notice: Undefined index: type in Drupal\webform_migrate\Plugin\migrate\source\d7\D7Webform->buildFormElements() (line 384 of …/modules/webform_migrate/src/Plugin/migrate/source/d7/D7Webform.php)
wim leers’s picture

Status: Postponed » Needs work
matroskeen’s picture

384 line is if ($extra['type'] == 'textfield') {

@Wim Leers, can you check the value of extra column in webform_component table for the component that throws this notice?

I'm looking at webform/components/number.inc (D7 version) and it expects ['extra']['type'] always to be available (there are no additional checks).

Considering that data is corrupted for some reason, I think we can fallback to textfield type, but let's try to figure out why it's empty 🤔

andriyun’s picture

Hi mates
Thank you very much for working on this direction.
I'd be very appreciate for having some info in issue description.

It's very complicate to find out issue goal only by issue name,

As I see this issue is blocker for adding tests.
Patch #10 already allowing to run tests added in #3172139: Enable project testing, and add a kernel test and a source database and files fixture
Gonna commit it.

  • andr1yun committed 29cd11e on 8.x-1.x authored by huzooka
    Issue #3172154 by huzooka: Fix source plugin's undefined index issues,...
matroskeen’s picture

I just found one more:
Notice: Undefined offset: 1 in /var/www/docroot/modules/contrib/webform_migrate/src/Plugin/migrate/source/d7/D7Webform->buildItemsString() line 978

Can be reproduced in the following case:
D7 component type: grid
questions value: "1|Hello...\n"

Given the string ends with \n, the result of $items = explode("\n", $rawString); in getItemsArray() is:

[
'1|Hello...',
'',
];

Adding a quick fix to trim the string before exploding.

huzooka’s picture

We need an array filter probably....

matroskeen’s picture

Yep, that would be better 😊

matroskeen’s picture

liam morland’s picture

Status: Needs work » Needs review

liam morland’s picture

Created merge request with patch webform_migrate-undefined_index-3172154-18_0.patch from #18.