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.

CommentFileSizeAuthor
#2 3245987-2.patch641 bytesjrockowitz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

shenzhuxi created an issue. See original summary.

jrockowitz’s picture

Version: 6.x-dev » 8.x-5.x-dev
Status: Active » Needs review
FileSize
641 bytes
jrockowitz’s picture

Status: Needs review » Reviewed & tested by the community
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

  • jrockowitz authored 8233333 on 8.x-5.x
    Issue #3245987 by jrockowitz: WebformSignature.php delete the files...

  • jrockowitz authored 8233333 on 6.x
    Issue #3245987 by jrockowitz: WebformSignature.php delete the files...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.