From 80d381f644f5efb573433c9c70ecf0e44ae5f697 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Wed, 8 Feb 2017 18:05:45 +0000 Subject: [PATCH] Make VacationHandler compatible with MySQL strict mode again The MySQL database layout includes a 'cache' column for historical reasons, the PostgreSQL database never did. r1883 removed the 'cache' column from VacationHandler to unbreak PostgreSQL, and at the same time broke MySQL in strict mode. This patch re-adds the 'cache' column only for MySQL to fix this regression. git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1890 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/VacationHandler.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/model/VacationHandler.php b/model/VacationHandler.php index 27081d82..ae39424a 100644 --- a/model/VacationHandler.php +++ b/model/VacationHandler.php @@ -26,6 +26,11 @@ class VacationHandler extends PFAHandler { 'modified' => pacol( 0, 0, 1, 'ts', 'last_modified' , '' ), # TODO: add virtual 'notified' column and allow to display who received a vacation response? ); + + if ( ! db_pgsql() ) { + $this->struct['cache'] = pacol( 0, 0, 0, 'text', '' , '' , '' ); # leftover from 2.2 + } + } protected function initMsg() { @@ -181,6 +186,10 @@ class VacationHandler extends PFAHandler { 'activeuntil' => $activeUntil, ); + if ( ! db_pgsql() ) { + $vacation_data['cache'] = ''; # leftover from 2.2 + } + // is there an entry in the vacaton table for the user, or do we need to insert? $table_vacation = table_by_key('vacation'); $result = db_query("SELECT * FROM $table_vacation WHERE email = '$E_username'");