From 27fc9a48d220bc953c99e28c26754a7aba00e45f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 20 Feb 2016 15:17:12 +0000 Subject: [PATCH] async_data is NOT NULL, therefore we should not attempt to write a NULL, even if most MySQL servers dont complain --- phpgwapi/inc/class.asyncservice.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.asyncservice.inc.php b/phpgwapi/inc/class.asyncservice.inc.php index d4565c9288..414d1e84c9 100644 --- a/phpgwapi/inc/class.asyncservice.inc.php +++ b/phpgwapi/inc/class.asyncservice.inc.php @@ -511,7 +511,8 @@ class asyncservice } else { - $row['async_data'] = json_php_unserialize($row['async_data'], true); // allow non-serialized data + $row['async_data'] = !empty($row['async_data']) ? + json_php_unserialize($row['async_data'], true) : null; // allow non-serialized data } $jobs[$row['async_id']] = egw_db::strip_array_keys($row,'async_'); } @@ -539,7 +540,7 @@ class asyncservice 'async_next' => $job['next'], 'async_times' => json_encode($job['times']), 'async_method' => $job['method'], - 'async_data' => $job['data'] ? json_encode($job['data']) : null, + 'async_data' => $job['data'] ? json_encode($job['data']) : '', 'async_account_id'=> $job['account_id'], ); $where['async_id'] = $job['id'];