View Issue Details

IDProjectCategoryView StatusLast Update
0011117mantisbtattachmentspublic2010-02-22 14:35
Reporterwatergad Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0rc2 
Fixed in Version1.2.0 
Summary0011117: Unable to get files attached to ALL_PROJECTS
Description

When trying to download files attached to ALL_PROJECTS there's a WARNING 403 first, error "...headers are already sent..." then, file binary data then and then Fatal error caused by oversizing mem allocation for the file output.

'DISK' storage method. I suppose 'FTP' method has to be affected too.

Steps To Reproduce
  1. Attach file to "All projects"
  2. Try to download it
Additional Information

This error caused by the line 203 of the file_api.php:

$t_path = project_get_field( $p_project_id, 'file_path' );

project_cache_row() will always return 'false' for the ALL_PROJECT id (see line 66 of project_api.php) what causes error trigger in project_get_field(). Warning output breaks the following file output.

Error trace:
file_download.php [line 138] -> file_api.php [line 203] -> project_api.php [line 435] -> project_api.php [line 66]

What to do:
Replace line 203 of file_api.php

// $t_path = project_get_field( $p_project_id, 'file_path' );

// with:
if( $p_project_id == ALL_PROJECTS ) {
$t_path = config_get( 'absolute_path_default_upload_folder' );
} else {
$t_path = project_get_field( $p_project_id, 'file_path' );
if( $t_path == '' ) {
$t_path = config_get( 'absolute_path_default_upload_folder' );
}
}

// That will fix the problem

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master-1.2.x 0b7510c0

2009-11-04 23:03

vboctor


Details Diff
Fixes 0011117: Unable to get files attached to ALL_PROJECTS - thanks to watergad. Affected Issues
0011117
mod - core/file_api.php Diff File

MantisBT: master e580d34c

2009-11-04 23:03

vboctor


Details Diff
Fixes 0011117: Unable to get files attached to ALL_PROJECTS - thanks to watergad. Affected Issues
0011117
mod - core/file_api.php Diff File