salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.52k stars 2.09k forks source link

Custom documentation module not upload file on quickcreate #8079

Open Alvaro237 opened 5 years ago

Alvaro237 commented 5 years ago

Issue

Custom documentation module not upload attached file when is in quickcreate view

Expected Behavior

Upload the file

Actual Behavior

When I save the record the fields data are recorded correctly but the file is not uploaded (neither in the database record nor upload folder)

Steps to Reproduce

  1. Create a custom document module
  2. Create "Create button" on popupdefs.php
    
    <?php
    if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
    }

$module_name = 'INSA_Documentacion'; $object_name = 'INSA_Documentacion'; $_module_name = 'insa_documentacion'; $popupMeta = array( 'moduleMain' => $module_name, 'varName' => $object_name, 'orderBy' => $_module_name . '.name', 'whereClauses' => array( 'name' => $_module_name . '.name', ), 'searchInputs' => array($_module_name . '_number', 'name', 'priority', 'status'), /'create' => array ( 'formBase' => 'INSA_DocumentacionFormBase.php', 'formBaseClass' => 'INSA_DocumentacionFormBase', 'getFormBodyParams' => array( 0 => '', 1 => '', 2 => 'INSA_DocumentacionSave', ), 'createButton' => $mod_strings['LNK_NEW_RECORD'], ),/ );


3. Create a FormBase (my module is called INSA_Documentacion

<?php

require_once('include/SugarObjects/forms/FormBase.php');`

class INSA_DocumentacionFormBase extends FormBase {

var $moduleName = 'INSA_Documentacion'; var $objectName = 'INSA_Documentacion';

function handleSave($prefix, $redirect=true, $useRequired=false){
    require_once('include/formbase.php');
    $focus = new INSA_Documentacion();
    $focus = populateFromPost($prefix, $focus);
    $focus->save();
}

}



4. Create in another module a related field with this module
5. Do a quick repair
6. Try to create new record https://suitecrm.com/suitecrm/media/kunena/attachments/221936/capture1.PNG
7.  You will see a empty field "File" https://suitecrm.com/suitecrm/media/kunena/attachments/221936/capture4.PNG

#### Context
We can not create quick records of this
Medium priority maybe

#### Your Environment
SuiteCRM version 7.11.8
PHP 7.2
Centos 7

![capture1](https://user-images.githubusercontent.com/5812504/67007416-a18d1480-f0e7-11e9-904e-4d027ba80bc0.PNG)
![capture2](https://user-images.githubusercontent.com/5812504/67007417-a18d1480-f0e7-11e9-9234-b433b6093e65.PNG)
![capture3](https://user-images.githubusercontent.com/5812504/67007418-a18d1480-f0e7-11e9-9314-2d8956d895e5.PNG)
![capture4](https://user-images.githubusercontent.com/5812504/67007415-a0f47e00-f0e7-11e9-9a8d-451087b004cb.PNG)
Mac-Rae commented 5 years ago

Hi @Alvaro237,

Your missing part of the template relating to SuiteCRM version, could you confirm this for me?

Alvaro237 commented 5 years ago

Hi @Alvaro237,

Your missing part of the template relating to SuiteCRM version, could you confirm this for me?

Hi @Mac-Rae

I edited the first post including the version of SuiteCRM which it is 7.11.8

Regards