Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-gao committed Jul 24, 2024
1 parent 97e6ed7 commit 61db8b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extra": {
"patches": {
"drupal/webform": {
"Exporting webform submission as batch does not allowed for extended field due to static method - https://www.drupal.org/project/webform/issues/3348336#comment-14969352": "https://www.drupal.org/files/issues/2023-03-16/exporting-webform-submission-static-batch-process-3348336-3.patch"
"Exporting webform submission as batch does not allowed for extended field due to static method - https://www.drupal.org/project/webform/issues/3348336#comment-15686345": "https://www.drupal.org/files/issues/2024-07-24/exporting-webform-submission-static-batch-process-3348336-8.patch"
}
}
},
Expand Down
17 changes: 8 additions & 9 deletions src/TideWebformSubmissionExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,14 @@ public function generate() {
parent::generate();
$export_options = $this->getExportOptions();
$entity_ids = $this->getQuery()->execute();
if ($export_options['process_submissions']) {
$webform_submissions = WebformSubmission::loadMultiple($entity_ids);
foreach ($webform_submissions as $webform_submission) {
$processed_value = $webform_submission->processed->getValue()[0]['value'];
if ($processed_value == "0") {
$webform_submission->processed->setValue("1");
$webform_submission->save();
}
}
if (isset($export_options['process_submissions']) && $export_options['process_submissions'] == 1 && !empty($entity_ids)) {
\Drupal::database()->update('webform_submission')
->fields(['processed' => 1])
->condition('sid', $entity_ids, 'IN')
->execute();
\Drupal::entityTypeManager()
->getStorage('webform_submission')
->resetCache($entity_ids);
}

$this->logExport($entity_ids, $export_options);
Expand Down

0 comments on commit 61db8b5

Please sign in to comment.