Problem/Motivation

If the Drupal 7 site has conditions of type "contains", these are incorrectly migrated and end up on errors when editing webform fields.

Steps to reproduce

Migrate a webform that uses the condition "contains" on a field. Then try to edit such field.

Proposed resolution

Webform in Drupal 8 has a pattern condition but such condition expects a regular expression. I am using the equals condition which serves my case but there may be cases where the condition value should be converted into a regular expression.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

juampynr created an issue. See original summary.

juampynr’s picture

Status: Active » Needs review
StatusFileSize
new960 bytes

Here is a patch that solves the issue.

huzooka’s picture

Improved the 'contains' condition migration.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/src/Plugin/migrate/source/d7/D7Webform.php
@@ -610,9 +610,24 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
-        $depedent_extra['items'] = explode("\n", $depedent_extra['items']);

I was gonna say $depedent should be $dependent, but it is pre-existing so … 🤷‍♂️

  • andr1yun committed b1d382f on 8.x-1.x authored by huzooka
    Issue #3170195 by huzooka, juampynr: Migrate conditions of type "...
andriyun’s picture

Status: Reviewed & tested by the community » Fixed

Commited
Thx @juampynr, @huzooka, @Wim Leers

Status: Fixed » Closed (fixed)

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