View Issue Details

IDProjectCategoryView StatusLast Update
0006080mantisbtattachmentspublic2011-12-17 02:47
Reporterpolzin Assigned Torombert  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionunable to reproduce 
Product Version1.0.0rc1 
Summary0006080: Copy issue does not work with attachments and DISK storage
Description

bug_copy in file_api.php has the lines

prepare the new diskfile name and then copy the file

$t_file_path = dirname( $t_bug_file['folder'] );
$t_new_diskfile_name = $t_file_path . file_generate_unique_name( 'bug-' . $p_file_name, $t_file_path );

  1. t_bug_file['folder'] is already a folder. "dirname" strips the last directory (and does not append an /).
  2. t_bug_file['folder'] is the folder of the origin project and not of the target project
  3. p_file_name is not defined here (this not a problem in the current implementation, because current file_generate_unique_name works even without sensible parameters)

To reproduce: use DISK as storage method, go to "View Issues", select an issue with attachment, select "Copy"...

Additional Information

(by the way: Moving an issue does not move the file from one folder to another, but this is a different, minor problem)

TagsNo tags attached.

Activities

polzin

polzin

2005-09-19 10:01

reporter   ~0011394

Correction: The bug is in bug_api.php, not file_api.php

I did not mention the typical result: As the filename is scrambled, typically this resolves in an APPLICATION ERROR.

vboctor

vboctor

2008-07-13 16:50

manager   ~0018471

Is this issue still reproducible with 1.1.x releases?

grangeway

grangeway

2008-07-28 16:31

reporter   ~0018878

Thank you for taking the time to report a problem with mantis.

Since this problem report was originally made, a number of releases have occured. Additionally no recent feedback has been received on this issue.
It appears that this issue has either been fixed, or may not be a relevant report for the current release.

Unfortunately you are not using the latest version and the problem might already be fixed. Please download the latest release from http://www.mantisbt.org/download.php [^] [^]

If you are able to reproduce this bug in the current release, or have some more information on how this feature could be improved in the current release. Please either change the mantis version on this bug report
to the version you tested and change the status back to "Open", or open a new issue report with more information.

Again, thank you for your continued support and report.

polzin

polzin

2008-07-29 06:07

reporter   ~0018900

I reproduced the problem with 1.1.2.
It is easy to see that there must be some problem due to the use of undefined variables.

Easy fix:

  1. Remove the "dirname" from $t_bug_file['folder']
  2. Add comment

    We use the wrong folder (of the source project), but we don't care.

  3. Use
    file_generate_unique_name( bug_format_id( $t_new_bug_id ) . '-' . $t_bug_file[ 'filename'], $t_file_path );
duwil

duwil

2009-11-03 11:11

reporter   ~0023556

Last edited: 2009-11-03 12:25

I confirm this bug is still present on rel 1.1.6 and the solution above worked for me

rombert

rombert

2011-12-06 12:00

reporter   ~0030472

This now works for Mantis 1.2 and 1.3 , and was fixed as part of bug 0013415 .