tbar0970 / jethro-pmm

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

roster_reminder.php breaks if ROSTER_COORDINATOR_ID is blank #1018

Closed jefft closed 5 months ago

jefft commented 5 months ago

If the roster_reminder.php script's ROSTER_COORDINATOR_ID field is blank:

; roster coordinator id
ROSTER_COORDINATOR_ID=''

Then the script dies with an ugly SQL error:

PHP Fatal error:  Uncaught PDOException: 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 '' at line 1 in /home/jethro/code/2.34.1/app/include/jethrodb.php:166
Stack trace:
#0 /home/jethro/code/2.34.1/app/include/jethrodb.php(166): PDOStatement->execute()
#1 /home/jethro/code/2.34.1/app/scripts/roster_reminder.php(130): JethroDB->queryAll()
#2 /home/jethro/code/2.34.1/app/scripts/roster_reminder_account.php(17): include('/home/jethro/co...')
#3 {main}
  thrown in /home/jethro/code/2.34.1/app/include/jethrodb.php on line 166

Fatal error: Uncaught PDOException: 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 '' at line 1 in /home/jethro/code/2.34.1/app/include/jethrodb.php on line 166

PDOException: 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 '' at line 1 in /home/jethro/code/2.34.1/app/include/jethrodb.php on line 166

Call Stack:
    0.0001     406824   1. {main}() /home/jethro/code/2.34.1/app/scripts/roster_reminder_account.php:0
    0.0010     494560   2. include('/home/jethro/code/2.34.1/app/scripts/roster_reminder.php') /home/jethro/code/2.34.1/app/scripts/roster_reminder_account.php:17
    0.1156    4651552   3. JethroDB->queryAll($sql = 'SELECT person.* FROM person WHERE person.id=', $types = ???, $fetchmode = ???, $rekey = ???, $force_array = ???, $group = ???) /home/jethro/code/2.34.1/app/scripts/roster_reminder.php:130
    0.1156    4652192   4. PDOStatement->execute() /home/jethro/code/2.34.1/app/include/jethrodb.php:166