View Issue Details

IDProjectCategoryView StatusLast Update
0014718mantisbtattachmentspublic2014-09-23 18:05
ReporterErikRoelofs Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
OSWindows7OS VersionProfessional SP1 
Product Version1.2.9 
Target Version1.2.12Fixed in Version1.2.12 
Summary0014718: Clone cannot find attachments
Description

When you view a bug or download an issue, Mantis uses file_normalize_attachment_path() to locate attachments.
However, when you want to copy an issue, instead Mantis relies entirely on the folder field from the bug_file_table to locate the file.

In situations where the file isn't located where the folder field says it is, the file is visible in the original bug but cannot be copied because the system cannot find it.

(These situations can occur when changing the upload dir for a project or application and moving all files, but it also appears that every file in the database has an absolute path and those have all been invalidated when we moved where Mantis was installed)

I'd expect the clone tool to locate the file in the same way as the rest of the application, and to place the new file in the same location.

Steps To Reproduce

1) Report a new bug, add an attachment
2) Change the upload directory in the configuration
3) [All attachments are now missing, but you can still Clone]
4) Move all the attachments to the new upload directory
5) [All attachments can be seen again, but now you cannot Clone any issues anymore]

Additional Information

I'm not sure what the best solution for this problem is, really. But it is very troublesome that we cannot clone issues anymore because we moved our uploads directory.

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
related to 0014796 closedatrol "Attachment missing" while re-copying an issue. 

Activities

dregad

dregad

2012-09-19 10:35

developer   ~0032880

The reported error is reproducible in current 1.2.x trunk.

When step 4 is executed, the following error message is displayed

SYSTEM WARNING
'copy(/tmp/upload/1/d87b44e740fdf6fce59465844eb75802): failed to open stream: No such file or directory' in '/path/to/mantisbt/core/file_api.php' line 878

(where /tmp/upload/1/ is the old upload path, before it was changed in step 2)

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036205

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x 7f3b0e7c

2012-09-19 05:13

dregad


Details Diff
Cloning issues with attachments fails after upload folder changed

With attachments stored on disk, if the project's upload directory
changes and the files are moved to the new location, it is no longer
possible to clone issues.

The file_copy_attachments() function was modified to use the same logic
as elsewhere in MantisBT, i.e. rely on file_normalize_attachment_path()
to determine the attachment's path.

Fixes 0014718
Affected Issues
0014718
mod - core/file_api.php Diff File

MantisBT: master 27aa2b80

2012-09-19 05:13

dregad


Details Diff
Cloning issues with attachments fails after upload folder changed

With attachments stored on disk, if the project's upload directory
changes and the files are moved to the new location, it is no longer
possible to clone issues.

The file_copy_attachments() function was modified to use the same logic
as elsewhere in MantisBT, i.e. rely on file_normalize_attachment_path()
to determine the attachment's path.

Fixes 0014718
Affected Issues
0014718
mod - core/file_api.php Diff File