SiT! Bugs - SiT!
View Issue Details
0001347SiT!inbound emailpublic2010-06-17 12:252010-07-21 21:29
nicdev 
ivan 
normalminoralways
closedfixed 
3.61 LTS 
3.62 LTS3.62 LTS 
0001347: attachments that moved by move_update.php are not moved
When we assign an email from the holding queue, the attachments are not moved from "/updates" to "/{incidentid}". This is because we never changes this code when incident_add.php was modified.

second issue is that if the file is not found there is no else statement and no debug info..
In move_update.php on line 184:
***Code***
while ($row = mysql_fetch_object($result))
            {
                $filename = $row->linkcolref . "-" . $row->filename;
                $old_file = $old_path . $filename;
                if (file_exists($old_file))
                {
                    $rename = rename($old_file, $new_path . $filename);
                    if (!$rename)
                    {
                        trigger_error("Couldn't move file: {$file}", E_USER_WARNING);
                        $moved_attachments = FALSE;
                    }
                }
            }
***Code***

This statement on line 187:
($old_file = $old_path . $filename;) <--- This is incorrect, as it should be:
$old_file = $old_path . $row->linkcolref;) <--- This is as it is in incident_add.php


For the second issue, we say:
if (file_exists($old_file))

but there is no else if the file does not exist, thus it continues without error. I suggest we do the following:
**Code**
if (file_exists($old_file))
{
    $rename = rename($old_file, $new_path . $filename);
    if (!$rename)
    {
        trigger_error("Couldn't move file: {$filename}", E_USER_WARNING);
        $moved_attachments = FALSE;
    }
}
else
{
    debug_log("Could not find the file: {$old_file}");
    trigger_error("Couldn't FIND file: {$filename}", E_USER_WARNING);
    $moved_attachments = FALSE;
{

There are descrepancies in this code if compared to "incident_add.php" for example
No tags attached.
related to 0001005closed paulh Creating an incident from the holding queue does not move the attachment 
Issue History
2010-06-17 12:25nicdevNew Issue
2010-06-17 12:42ivanRelationship addedrelated to 0001005
2010-07-04 12:29ivanStatusnew => assigned
2010-07-04 12:29ivanAssigned To => ivan
2010-07-04 12:29ivanTarget Version => 3.62 LTS
2010-07-04 15:04ivanNote Added: 0003291
2010-07-04 15:04ivanStatusassigned => resolved
2010-07-04 15:04ivanFixed in Version => Current SVN
2010-07-04 15:04ivanResolutionopen => fixed
2010-07-18 15:05ivanNote Added: 0003321
2010-07-18 15:05ivanStatusresolved => closed
2010-07-21 21:29ivanFixed in VersionCurrent SVN => 3.62 LTS

Notes
(0003291)
ivan   
2010-07-04 15:04   
Fixed in svn r6547 and Git 14fddb7
(0003321)
ivan   
2010-07-18 15:05   
Released in v3.62