fix: flatten the events for the restSearch API's lookup functions

- otherwise valid events that only contain objects get blocked
pull/2509/head
iglocska 2017-09-25 14:00:17 +02:00
parent a61b5007cf
commit 9e71fbb5f7
2 changed files with 4 additions and 2 deletions

View File

@ -1816,7 +1816,8 @@ class AttributesController extends AppController {
'fields' => array('Attribute.*', 'Event.org_id', 'Event.distribution'),
'withAttachments' => $withAttachments,
'enforceWarninglist' => $enforceWarninglist,
'includeAllTags' => true
'includeAllTags' => true,
'flatten' => 1
);
if ($deleted) {
$params['deleted'] = 1;

View File

@ -2684,7 +2684,8 @@ class EventsController extends AppController {
'contain' => array(),
'recursive' => -1,
'list' => true,
'event_ids' => true
'event_ids' => true,
'flatten' => 1
);
$attributes = $this->Event->Attribute->fetchAttributes($this->Auth->user(), $params);
$eventIds = array();