fix: [API] using "download" as a returnformat via the URL breaks the restSearch API

- we have to keep it as a legacy option and map it to json
pull/3626/head
iglocska 2018-09-05 14:27:34 +02:00
parent bcfc1f3a1a
commit 7e5be5f37b
2 changed files with 6 additions and 0 deletions

View File

@ -2112,6 +2112,9 @@ class AttributesController extends AppController
if (isset($filters['returnFormat'])) {
$returnFormat = $filters['returnFormat'];
}
if ($returnFormat === 'download') {
$returnFormat = 'json';
}
$conditions = $this->Attribute->buildFilterConditions($this->Auth->user(), $filters);
$params = array(
'conditions' => $conditions,

View File

@ -3036,6 +3036,9 @@ class EventsController extends AppController
if (isset($filters['returnFormat'])) {
$returnFormat = $filters['returnFormat'];
}
if ($returnFormat === 'download') {
$returnFormat = 'json';
}
$eventid = $this->Event->filterEventIds($user, $filters);
if (!isset($validFormats[$returnFormat])) {
// this is where the new code path for the export modules will go