From b9555efe600fad0533af85340143e15cf6c414c1 Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Sat, 3 Apr 2021 23:08:52 +0200 Subject: [PATCH] Fixed issue #17208: avoid column name must be either a string or an array during survey taking (#1825) Dev: some response table can have broken primaryKey, avoid public DB issue --- application/models/Response.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/models/Response.php b/application/models/Response.php index 2eaa4007a4a..582dc33294c 100644 --- a/application/models/Response.php +++ b/application/models/Response.php @@ -36,6 +36,15 @@ public static function create($surveyId, $scenario = 'insert') return parent::create($surveyId, $scenario); } + /** @inheritdoc + * Must be set by DB, adding by security here + * @see https://bugs.limesurvey.org/view.php?id=17208 + **/ + public function primaryKey() + { + return 'id'; + } + /** * Get all files related to this response and (optionally) question ID. *