Skip to content

Commit

Permalink
refs thinkingreed-inc#1054 ドキュメント添付の際、ドキュメントレコードは作成されるがファイルアップロードが出来な…
Browse files Browse the repository at this point in the history
…い問題の対応
  • Loading branch information
s_a_hasegawa committed Jul 25, 2024
1 parent 7a15760 commit 9c1ce8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data/CRMEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function uploadAndSaveFile($id, $module, $file_details, $attachmentType='Attachm
}

// Check 1
$save_file = 'true';
$save_file = true;
//only images are allowed for Image Attachmenttype
$mimeType = vtlib_mime_content_type($file_details['tmp_name']);
$mimeTypeContents = explode('/', $mimeType);
Expand All @@ -192,12 +192,12 @@ function uploadAndSaveFile($id, $module, $file_details, $attachmentType='Attachm
$save_file = validateImageFile($file_details);
}
$log->debug("File Validation status in Check1 save_file => $save_file");
if ($save_file == 'false') {
if ($save_file == false) {
return false;
}

// Check 2
$save_file = 'true';
$save_file = true;
//only images are allowed for these modules
if ($module == 'Contacts' || $module == 'Products') {
$save_file = validateImageFile($file_details);
Expand All @@ -219,7 +219,7 @@ function uploadAndSaveFile($id, $module, $file_details, $attachmentType='Attachm
$upload_status = copy($filetmp_name, $upload_file_path . $current_id . "_" . $encryptFileName);
// temporary file will be deleted at the end of request
$log->debug("Upload status of file => $upload_status");
if ($save_file == 'true' && $upload_status == 'true') {
if ($save_file == true && $upload_status == true) {
if($attachmentType != 'Image' && $this->mode == 'edit') {
//Only one Attachment per entity delete previous attachments
$res = $adb->pquery('SELECT vtiger_seattachmentsrel.attachmentsid FROM vtiger_seattachmentsrel
Expand Down

0 comments on commit 9c1ce8d

Please sign in to comment.