From fa4e59ce7dfdb132e817ce5d2b4482db84b348f5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 12 Aug 2016 16:47:03 +0200 Subject: Fix minor issues in exams install hook, taskmanager callback logic --- inc/taskmanagercallback.inc.php | 6 +++++- inc/util.inc.php | 1 + modules-available/exams/install.inc.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/inc/taskmanagercallback.inc.php b/inc/taskmanagercallback.inc.php index c2a05609..bc959f03 100644 --- a/inc/taskmanagercallback.inc.php +++ b/inc/taskmanagercallback.inc.php @@ -38,7 +38,11 @@ class TaskmanagerCallback . " VALUES (:task, UNIX_TIMESTAMP(), :callback, :args)", $data, true) !== false) { return; } - Database::exec("INSERT INTO callback (taskid, dateline, cbfunction) VALUES (:task, UNIX_TIMESTAMP(), :callback)", $data); + // Most likely the args column is missing - try to add it on-the-fly so the update routine can properly + // use it (confmod updates - otherwise the status of modules is not updated properly) + Database::exec("ALTER TABLE `callback` ADD `args` TEXT NOT NULL DEFAULT ''", array(), true); + Database::exec("INSERT INTO callback (taskid, dateline, cbfunction, args)" + . " VALUES (:task, UNIX_TIMESTAMP(), :callback, :args)", $data); } /** diff --git a/inc/util.inc.php b/inc/util.inc.php index 14621a5a..8ad3928a 100644 --- a/inc/util.inc.php +++ b/inc/util.inc.php @@ -14,6 +14,7 @@ class Util { if (defined('API') && API) { error_log('API ERROR: ' . $message); + error_log(print_r(debug_backtrace(), true)); } Header('HTTP/1.1 500 Internal Server Error'); Header('Content-Type: text/html; charset=utf-8'); diff --git a/modules-available/exams/install.inc.php b/modules-available/exams/install.inc.php index 18be0be6..b1032118 100644 --- a/modules-available/exams/install.inc.php +++ b/modules-available/exams/install.inc.php @@ -4,7 +4,7 @@ $res = array(); $res[] = tableCreate('exams', ' `examid` int(11) NOT NULL AUTO_INCREMENT, - `lectureid` char(36) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL + `lectureid` char(36) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL, `starttime` int(11) NOT NULL, `endtime` int(11) NOT NULL, `description` varchar(500) DEFAULT NULL, -- cgit v1.2.3-55-g7522