AnsweredAssumed Answered

Use of '$temp' parameter in SugarFieldFile.php

Question asked by Bhagyashree Bhagyashree on Apr 1, 2015
Previously I was working with Sugar 7.2 and now with Sugar 7.6. I found out that there is a extra code included in <sugar7.6>/include/SugarFields/Fields/File/SugarFieldFile.php that is,

 if ($move) {
            $temp = !empty($params['temp']);
            // Added checking of final move to capture errors that might occur
            if ($upload_file->final_move($bean->id, $temp)) {
                if (!$temp) {
                    // This fixes an undefined index warning being thrown
                    $docType = isset($vardef['docType']) && isset($params[$prefix . $vardef['docType']]) ? $params[$prefix . $vardef['docType']] : null;
                    $upload_file->upload_doc($bean, $bean->id, $docType, $bean->$field, $upload_file->mime_type);
                }
            }
which is not in Sugar 7.2. I was not able to understand this piece of code. Can  anyone tell me the use of $temp here?

Outcomes