Details
Description
On 5.4.0, to reproduce:
1. Create a Support Department without any custom fields.
2. Edit the department and change anything, but do not create any custom fields, and save.
The data appears to be saved, but an error is logged and a white screen occurs. If the department has any custom fields, there is no error.
[2022-05-11T17:28:45.114085+00:00] general.ERROR: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND `support_department_fields`.`department_id`='1'' at line 1 in /home/blestau/public_html/530b1/vendors/minphp/db/src/PdoConnection.php:196 Stack trace: #0 /home/blestau/public_html/530b1/vendors/minphp/db/src/PdoConnection.php(196): PDOStatement->execute(Array) #1 /home/blestau/public_html/530b1/vendors/minphp/record/src/Record.php(345): Minphp\Db\PdoConnection->query('DELETE `support...', Array) #2 /home/blestau/public_html/530b1/plugins/support_manager/models/support_manager_departments.php(263): Minphp\Record\Record->delete(Array) #3 /home/blestau/public_html/530b1/plugins/support_manager/models/support_manager_departments.php(196): SupportManagerDepartments->editFields(1, Array) #4 /home/blestau/public_html/530b1/plugins/support_manager/controllers/admin_departments.php(260): SupportManagerDepartments->edit('1', Array) #5 /home/blestau/public_html/530b1/vendors/minphp/bridge/src/Lib/Dispatcher.php(142): AdminDepartments->edit() #6 /home/blestau/public_html/530b1/index.php(21): Dispatcher::dispatch('/530b1/admin/pl...') #7
{main}