Skip to content

Commit

Permalink
Issue #3024586: The d7_webform_submission plugin must define the sour…
Browse files Browse the repository at this point in the history
…ce_module property
  • Loading branch information
Heshan Wanigasooriya committed Jan 10, 2019
1 parent 54fb761 commit aa73cdc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/Plugin/migrate/source/d6/D6Webform.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
* Drupal 6 webform source from database.
*
* @MigrateSource(
* id = "d6_webform"
* id = "d6_webform",
* core = {6},
* source_module = "webform",
* destination_module = "webform"
* )
*/
class D6Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackAwareInterface {
Expand Down
5 changes: 4 additions & 1 deletion src/Plugin/migrate/source/d6/D6WebformSubmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
* Drupal 6 webform submission source from database.
*
* @MigrateSource(
* id = "d6_webform_submission"
* id = "d6_webform_submission",
* core = {6},
* source_module = "webform",
* destination_module = "webform"
* )
*/
class D6WebformSubmission extends DrupalSqlBase {
Expand Down
11 changes: 8 additions & 3 deletions src/Plugin/migrate/source/d7/D7WebformSubmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
* Drupal 7 webform submission source from database.
*
* @MigrateSource(
* id = "d7_webform_submission"
* id = "d7_webform_submission",
* core = {7},
* source_module = "webform",
* destination_module = "webform"
* )
*/
class D7WebformSubmission extends DrupalSqlBase {
Expand Down Expand Up @@ -92,13 +95,15 @@ private function buildSubmittedData($sid) {
$submitted_data = [];
foreach ($wf_submissions as $wf_submission) {
$extra = unserialize($wf_submission['extra']);
if (!empty($extra['multiple'])) {
if (!empty($extra['multiple']) && !empty($wf_submission['data'])) {
$item[$wf_submission['no']] = $wf_submission['data'];
}
else {
$item = $wf_submission['data'];
}
$submitted_data[$wf_submission['form_key']] = $item;
if (!empty($item)) {
$submitted_data[$wf_submission['form_key']] = $item;
}
}
return $submitted_data;
}
Expand Down

0 comments on commit aa73cdc

Please sign in to comment.