salesagility / SuiteCRM

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

Report Query Failed - mysql error 1111 Invalid Group Function #5698

Open bunk3m opened 6 years ago

bunk3m commented 6 years ago

A gui created report is failing with the mysql error 1111 invalid group function

Issue

The report query is failing is to identify the number of meetings completed in the past week for each user. A similar task report has the same error.

Both queries were created in the gui and have a mysql error 1111 for invalid group function.

Expected Behavior

Reports created and run from the GUI should run without error.

Actual Behavior

Report gives an error in the log. Error is as follows: Query Failed: SELECT COUNT(meetings.name) AS 'Number_of_meetings' FROM meetings WHERE ( COUNT(meetings.name) IS NOT NULL AND (meetings.date_start BETWEEN "2018-04-02 00:00:00" AND "2018-04-09 00:00:00" ANDmeetings.status = 'Held' ) AND meetings.deleted = 0 ): MySQL error 1111: Invalid use of group function

Possible Fix

unknown

Steps to Reproduce

Report "Meetings since last week"

  1. Create new report
  2. Select report module:Meetings
  3. Enter info as per attached 2 screenshots screen shot 2018-04-10 at 11 41 01 screen shot 2018-04-10 at 11 41 23
  4. Put the report into a Dashboard tab.
  5. When you click the tab with the report the report will run.
  6. Check the suitecrm log and find an error as above.

Context

Error appears each time you select the dashboard tab and the report is run.

Your Environment

connorshea commented 5 years ago

I think the problem is that the field set in the "Main group" dropdown doesn't have the 'Group' checkbox checked? It probably shouldn't be possible to create a query like that, I ran into the same thing when creating a report earlier.