tbar0970 / jethro-pmm

Jethro Pastoral Ministry Manager
GNU General Public License v3.0
35 stars 25 forks source link

Roster 'people assigned' analysis breaks if no Roster Roles are present #1048

Closed jefft closed 3 weeks ago

jefft commented 3 months ago

Under Rosters -> Display Roster Assignments, Jethro now displays some stats about assignees (unless ROSTERS_HIDE_ANALYSIS is is defined):

image

This section breaks if a Roster View contains only Service Fields, and no Roster Roles:

image

The logged error is

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')
                                ) x
                                GROUP BY personid, first_name, last_name
                                HAVING date_count ...' at line 9
Line 171 of /home/jethro/code/2.35.1/app/include/jethrodb.php

To replicate, go to Rosters -> Define Roster Views, and define a minimal view containing only Service Fields:

image

Then view your new roster.