diff --git a/src/app/resource/controllers/ResController.php b/src/app/resource/controllers/ResController.php index ebac3c927c034d685b1201dafd6d4549fa6ef004..366c10ed437b1f3b7ffc3b84e8820675f71055df 100755 --- a/src/app/resource/controllers/ResController.php +++ b/src/app/resource/controllers/ResController.php @@ -765,11 +765,16 @@ class ResController $select = explode(',', $data['select']); $sve_start_date = false; - if ($keySve = array_search('sve_start_date', array_map('trim', $select))) { + $keySve = array_search('sve_start_date', array_map('trim', $select)); + if ($keySve !== false) { unset($select[$keySve]); $sve_start_date = true; } + if ($sve_start_date && empty($select)) { + $select[] = 'res_id'; + } + if (!PreparedClauseController::isRequestValid(['select' => $select, 'clause' => $data['clause'], 'orderBy' => $data['orderBy'], 'limit' => $data['limit'], 'userId' => $GLOBALS['userId']])) { return $response->withStatus(400)->withJson(['errors' => _INVALID_REQUEST]); }