The rename upload file using tokens works fine in submitting the form data.
However, when edit the submission and upload file from this edit, the uploaded file is not renamed.

Regards,
Waluyo

Comments

was.uthm created an issue. See original summary.

danchadwick’s picture

Category: Bug report » Feature request
Issue tags: -rename upload

I don't think it should unless the file is re-uploaded. Can you explain your use case?

waluyo.umam’s picture

This feature is important to maintain the consistency of the filename.

- A user submitted a paper file then file renamed according to the rename rule, defined by the tokens.
- The user made a revision to the file and sent it to the coordinator (who has access to view results) to replace the old file with the new version.
- The coordinator opened the submission. In this edit submission, the coordinator removed the previous uploaded file and uploaded the new version. This new uploaded file will not be renamed according to the rename rule, but in original name. It is expected the rename rule also applicable in editing mode, not only in new submission.

Tsjippy’s picture

I have the same issue.

If I upload a file to an already submitted form, the file does not get renamed

waluyo.umam’s picture

Hello,
Is there any patch that can do this feature.

Jose Casal’s picture

Same problem here. File is not renamed after editing a submission.

brt’s picture

Another use case for this problem:
- A form submission is made without a file attachment
- Afterwards a file is attached to the existing submission
- The uploaded file is not renamed

brt’s picture

I had a look at the code.
On line 1289 in webform.module this behaviour is explicitly defined. It seem to be a feature and not a bug.
Could someone please explain why we need this?

    // Only rename files if this is the first time the submission is being saved as finished.
    if ($submission->is_draft || (isset($old_submission) && !$old_submission->is_draft)) {
      $renameable = array();
    }
waluyo.umam’s picture

Hello,
any solution for the renaming in edit mode?

liam morland’s picture

Version: 7.x-4.12 » 7.x-4.x-dev
Status: Active » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.