Project

General

Profile

Actions

Patch #26622

closed

Copy version attachments (i.e. Files) along with the versions on project copy

Added by Holger Just over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Projects
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

When copying a project and opting to also copy versions, the attached files (i.e. the content of the "Files" tab of the source project) is not copied along.

The attached patch fixes this and also copies the version attachments.


Files


Related issues

Related to Redmine - Feature #10282: Copy wiki attachments on project copyClosedGo MAEDA

Actions
Actions #1

Updated by Holger Just over 7 years ago

Turns out, there was a slight bug in the tests. Attached is the working patch. The first version can be deleted / disregarded.

Actions #2

Updated by Holger Just over 7 years ago

Similarly to the version attachments, it is also possible to upload files directly to a project in the Files tab. We should always copy those attachments along. This is implemented by the attached patch.

Since we are deduplicating attachments in disk already, copying these attachments is basically free anyways.

Actions #3

Updated by Jan from Planio www.plan.io over 7 years ago

  • File deleted (0001-Copy-version-attachments-i.e.-Files-along-with-the-v.patch)
Actions #4

Updated by Jan from Planio www.plan.io over 7 years ago

  • Target version set to Candidate for next minor release
Actions #5

Updated by Go MAEDA over 7 years ago

I think it would be better to have a checkbox like as follows on ProjectsController#copy page. Maybe users sometimes exclude Files module when they copy a project.

Actions #6

Updated by Holger Just over 7 years ago

This could easily work for file directly attached to the project.

For files attached to versions, we can only copy them if the versions are also copied to have a valid reference. Besides this not fitting well into the existing code, we would then have to find a way to handle people opting to copy files but not versions.

The simplest solution could be do not copy version-attached files in that case (which would probably be surprising for people not being accustomed to the details of Redmine's data model). Alternatively, we could also try to enforce the selection on the UI with javascript (but would still have to handle this somehow on the server anyway). In any case, I'm afraid this gets out of hand pretty quickly implementation-wise...

Maybe, we can just improve the wording so show

[ ] Versions (2) and Files

instead of only

[ ] Versions (2)

today.

What do you think?

Actions #7

Updated by Go MAEDA over 7 years ago

I think it is confusing to always copy files along with versions for ordinary users because many users don't know the data structure of Redmine.

Besides, it is very problematic when there are dozens of files in the Files module and the user don't want to copy those files. The user have to click the trash icon dozens of times to delete all files after copying a project.

In my opinion, we should implement a feature to delete multiple files at once in Files module when this patch is merged.

Actions #8

Updated by Holger Just over 7 years ago

Go MAEDA wrote:

In my opinion, we should implement a feature to delete multiple files at once in Files module when this patch is merged.

Absolutely, that in itself is a good idea, regardless of whether this patch is merged or not.

Still, right now there is no way to copy the files along with a project. To maintain consistency with all the other objects being copied, we should make sure to also copy attachments in all cases along with their parent objects.

Given that the most common use-case for copying projects is to create a new copy of a template project (rather than random copies of existing heavily-used projects), I think it's not that suprising that files are also copied along. Yes, the data structure is non-obvious to most users (along with the general distinction between "Files" and "Documents"), hence my proposal to change the wording to make it at least obvious what is happening when the checkbox is enabled.

Actions #9

Updated by Go MAEDA over 7 years ago

  • Target version changed from Candidate for next minor release to 4.1.0

Holger, thank you for your explanation. I have agreed with your opinion that the common use case of this feature is to copy a template project after reading #26622#note-8.

hence my proposal to change the wording to make it at least obvious what is happening when the checkbox is enabled.

It makes sense. I am setting target version to 4.1.0. Could you attach a patch to change the wording?

Actions #10

Updated by Holger Just over 7 years ago

Thank you Maeda-san. I have attached a patch to change the wording for English and German. The copy project screen now looks like this (with the patch from #26621 applied):

Actions #11

Updated by Go MAEDA almost 7 years ago

  • Related to Feature #10282: Copy wiki attachments on project copy added
Actions #12

Updated by Go MAEDA over 6 years ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from 4.1.0 to 4.0.0

Committed the patch series. Thank you for improving Redmine.

Actions

Also available in: Atom PDF