Report fails if custom field is first column #4174

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

Originally created by @ghost on GitHub (Dec 23, 2019).

Issue

If a report contains a custom field of a related module as it's first column it fails to run, displays no results and outputs error to log file:

MySQL error 1103: Incorrect table name ''

The query that is sent is:

SELECT
    `cases:accounts_cstm`.district_council_c AS 'District',
    `cases:accounts`.name AS 'Business_Name1',
    `cases`.case_number AS 'Case_Number2',
    `cases`.date_entered AS 'Date_Created3',
    `cases`.id AS 'cases_id',
    `cases:accounts`.id AS 'cases:accounts_id'
FROM
    `cases`
    LEFT JOIN accounts `cases:accounts` ON
        `cases`.account_id=`cases:accounts`.id
        AND
        `cases:accounts`.deleted=0
    LEFT JOIN ``cases:accounts`_cstm` `cases:accounts_cstm` ON
        `cases:accounts`.id = `cases:accounts_cstm`.id_c
WHERE
    cases.deleted = 0
LIMIT 0, 50

Expected Behavior

Report is generated based on given conditions.

Actual Behavior

No results are displayed and SQL (including error) are written to log.

Steps to Reproduce

  1. Create a report based on the 'Cases' module
  2. Set the first column to a custom field from a related module
  3. Run the report - Fails

Context

Should be high priority as some systems we manage have well over 100 reports which are no longer working but did in previous versions.

Your Environment

  • SuiteCRM Version used: 7.11.10
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.3.13, MariaDB 10.3.18
  • Operating System and version (e.g Ubuntu 16.04): Debian 10
Originally created by @ghost on GitHub (Dec 23, 2019). #### Issue If a report contains a custom field of a related module as it's first column it fails to run, displays no results and outputs error to log file: `MySQL error 1103: Incorrect table name ''` The query that is sent is: ``` SELECT `cases:accounts_cstm`.district_council_c AS 'District', `cases:accounts`.name AS 'Business_Name1', `cases`.case_number AS 'Case_Number2', `cases`.date_entered AS 'Date_Created3', `cases`.id AS 'cases_id', `cases:accounts`.id AS 'cases:accounts_id' FROM `cases` LEFT JOIN accounts `cases:accounts` ON `cases`.account_id=`cases:accounts`.id AND `cases:accounts`.deleted=0 LEFT JOIN ``cases:accounts`_cstm` `cases:accounts_cstm` ON `cases:accounts`.id = `cases:accounts_cstm`.id_c WHERE cases.deleted = 0 LIMIT 0, 50 ``` #### Expected Behavior Report is generated based on given conditions. #### Actual Behavior No results are displayed and SQL (including error) are written to log. #### Steps to Reproduce 1. Create a report based on the 'Cases' module 2. Set the first column to a custom field from a related module 3. Run the report - Fails #### Context Should be high priority as some systems we manage have well over 100 reports which are no longer working but did in previous versions. #### Your Environment * SuiteCRM Version used: 7.11.10 * Environment name and version (e.g. MySQL, PHP 7): PHP 7.3.13, MariaDB 10.3.18 * Operating System and version (e.g Ubuntu 16.04): Debian 10
Author
Owner

@gunnicom commented on GitHub (Dec 23, 2019):

Maybe related: https://github.com/salesagility/SuiteCRM/issues/1635

@gunnicom commented on GitHub (Dec 23, 2019): Maybe related: https://github.com/salesagility/SuiteCRM/issues/1635
Author
Owner

@jbrveen commented on GitHub (Jan 3, 2020):

Maybe related: #1635

This seems to be the case indeed.

@jbrveen commented on GitHub (Jan 3, 2020): > Maybe related: #1635 This seems to be the case indeed.
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#4174
No description provided.