In a file-based custom module, view file information in the subpanel and list view #5270

Open
opened 2026-02-20 16:32:14 -05:00 by deekerman · 0 comments
Owner

Originally created by @SinergiaCRM on GitHub (Nov 15, 2024).

Issue

In a custom module based on the file type template, when adding the field that refers to the file (upload) in the list view, the link to the file name that allows its download is not displayed, only the eye icon that allows opening the file directly in the browser is displayed, unlike what happens in the Documents module, where both options appear. The same thing happens in the subpanel view.

As we have seen, there are important differences at the Vardef level between the Documents module and a custom module that inherits from the File template:

Document Vardef:

    'filename' => 
    array (
      'name' => 'filename',
      'vname' => 'LBL_FILENAME',
      'type' => 'file',
      'source' => 'non-db',
      'comment' => 'The filename of the document attachment',
      'required' => true,
      'noChange' => true,
      'allowEapm' => true,
      'fileId' => 'document_revision_id',
      'docType' => 'doc_type',
      'docUrl' => 'doc_url',
      'docId' => 'doc_id',
    ),

Custom File module Vardef:

    'filename' => 
    array (
      'name' => 'filename',
      'vname' => 'LBL_FILENAME',
      'type' => 'varchar',
      'required' => true,
      'importable' => 'required',
      'len' => '255',
      'studio' => 'false',
    ),

    'uploadfile' => 
    array (
      'name' => 'uploadfile',
      'vname' => 'LBL_FILE_UPLOAD',
      'type' => 'file',
      'source' => 'non-db',
    ),

Possible Fix

Update the structure and views of the File template so that when you create a custom module based on that template, it behaves like the Documents module

Steps to Reproduce the Issue

1. Create a File type module and a relationship with Contacts of type N to 1, that is, a contact can be related to N records of this module.
2. Publish the module and upload it to the CRM.
3. Create a record and indicate a file and a person.
4. Access the list view of the custom module and check that the link to the file name that allows its download is not displayed.
5. Access the detail view of the contact, open the subpanel of the custom module and check that by default, there is no information related to the display or download of the file.
6. Check the differences in the filevar and in the views of both modules.

Context

No response

Version

7.14.4

What browser are you currently using?

Firefox

Browser Version

131.0.3 (64-bit)

Environment Information

MySQL, PHP Version 8.2

Operating System and Version

Ubuntu 22.04.4 LTS

Originally created by @SinergiaCRM on GitHub (Nov 15, 2024). ### Issue In a custom module based on the file type template, when adding the field that refers to the file (upload) in the list view, the link to the file name that allows its download is not displayed, only the eye icon that allows opening the file directly in the browser is displayed, unlike what happens in the Documents module, where both options appear. The same thing happens in the subpanel view. As we have seen, there are important differences at the Vardef level between the Documents module and a custom module that inherits from the File template: Document Vardef: ``` 'filename' => array ( 'name' => 'filename', 'vname' => 'LBL_FILENAME', 'type' => 'file', 'source' => 'non-db', 'comment' => 'The filename of the document attachment', 'required' => true, 'noChange' => true, 'allowEapm' => true, 'fileId' => 'document_revision_id', 'docType' => 'doc_type', 'docUrl' => 'doc_url', 'docId' => 'doc_id', ), ``` Custom File module Vardef: ``` 'filename' => array ( 'name' => 'filename', 'vname' => 'LBL_FILENAME', 'type' => 'varchar', 'required' => true, 'importable' => 'required', 'len' => '255', 'studio' => 'false', ), 'uploadfile' => array ( 'name' => 'uploadfile', 'vname' => 'LBL_FILE_UPLOAD', 'type' => 'file', 'source' => 'non-db', ), ``` ### Possible Fix Update the structure and views of the File template so that when you create a custom module based on that template, it behaves like the Documents module ### Steps to Reproduce the Issue ```bash 1. Create a File type module and a relationship with Contacts of type N to 1, that is, a contact can be related to N records of this module. 2. Publish the module and upload it to the CRM. 3. Create a record and indicate a file and a person. 4. Access the list view of the custom module and check that the link to the file name that allows its download is not displayed. 5. Access the detail view of the contact, open the subpanel of the custom module and check that by default, there is no information related to the display or download of the file. 6. Check the differences in the filevar and in the views of both modules. ``` ### Context _No response_ ### Version 7.14.4 ### What browser are you currently using? Firefox ### Browser Version 131.0.3 (64-bit) ### Environment Information MySQL, PHP Version 8.2 ### Operating System and Version Ubuntu 22.04.4 LTS
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5270
No description provided.