Elements data empty when form_key contains uppercase characters in D7 webform submissions

Created on 10 August 2023, over 1 year ago
Updated 11 April 2024, 8 months ago

Problem/Motivation

For D7 components whose form key contains uppercase characters, its data is not migrated as part of the D7 submission.

In #3207599: Use WebformYaml::encode to generate YAML string instead of trying to create our own yaml dump , code was added to make the element's form_key lowecase in the `d7_webform`source plugin. This was not done for the `d7_webform_submission` source plugin.

Steps to reproduce

In D7, create a form component whose name contains uppercase characters. Then, try to migrate the form and its submission data.

Proposed resolution

Make the element's form_key lowercase in the `d7_webform_submission` source plugin.

Remaining tasks

Create patch.
Review patch.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇮Nicaragua dinarcon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dinarcon
  • 🇳🇮Nicaragua dinarcon

    This patch makes the element's form_key lowercase in the `d7_webform_submission` source plugin. Please review.

  • 🇪🇸Spain miguelarber

    I was going to provide a patch myself for this bug, but I came across this issue where #2 patch resolves it.

    I confirm the bug is still present in the latest version of webform submission migration from D7, and it is caused because of applying the strtolower() function to the 'form_key' in the webform migration source plugin, but not in the webform submission source plugin (this difference makes the 'form_key' inconsistent).

    When executed, the migration doesn't fail per-se (you can actually check that the submission data is present in the database), however the UI is not able to properly display the submissions for those items where the 'form_key' originally contained uppercase characters. The provided patch also applies the strtolower() to the 'form_key' in the webform submission source plugin and fixes the issue. Thank you.

Production build 0.71.5 2024