Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
https://git.drupalcode.org/project/webform/-/blob/6.x/src/Plugin/Webform...
public function postDelete(array &$element, WebformSubmissionInterface $webform_submission) {
$webform = $webform_submission->getWebform();
$element_key = $element['#webform_key'];
$sid = $webform_submission->id();
// Delete signature image submission directory.
$image_base_directory = 'public://webform/' . $webform->id();
$image_directory = "$image_base_directory/$element_key/$sid";
if (file_exists($image_directory)) {
$this->fileSystem->deleteRecursive($image_directory);
$this->fileSystem->deleteRecursive($image_directory);
}
// Please node, the signature image (no results) directory is deleted when
// the Webform is deleted.
// @see \Drupal\webform\WebformEntityStorage::delete
}
I guess that "$this->fileSystem->deleteRecursive($image_directory)" only need to delete once.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3245987-2.patch | 641 bytes | jrockowitz |
|
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedComment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedComment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commented