Webform submissions import incomplete due to missing composite elements

Created on 29 November 2024, 19 days ago

Problem/Motivation

When using the Phone Number (field) module the integration with the Webform Submission Export/Import functionality is incomplete.
This is due to the fact that in the PhoneNumber class definition which extends the WebformCompositeBase the getCompositeElements() method returns an empty array.

See WebformAddress element.

In the WebformSubmissionExportImportImporter class, the method getDestinationColumns provides the columns based also on the composite elements.

$composite_elements = $element_plugin->getCompositeElements();

Proposed resolution

Update the PhoneNumber class to include the composite elements:

  /**
   * {@inheritdoc}
   */
  public function getCompositeElements() {
    $elements = [];
    $elements['value'] = [
      '#title' => $this->t('Value'),
      '#type' => 'textfield',
    ];
    $elements['country'] = [
      '#title' => $this->t('Country'),
      '#type' => 'textfield',
    ];
    $elements['local_number'] = [
      '#title' => $this->t('Local number'),
      '#type' => 'textfield',
    ];
    $elements['extension'] = [
      '#title' => $this->t('Extension'),
      '#type' => 'textfield',
    ];
    return $elements;
  }
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇷🇴Romania bogdan.racz

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024