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

test #109

Draft
wants to merge 1 commit into
base: reference
Choose a base branch
from
Draft

test #109

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading