fix: Added event_uuid to attribute view

pull/2402/head
iglocska 2017-08-14 08:52:29 +02:00
parent 04ef84a0cf
commit a2d401ab50
2 changed files with 5 additions and 1 deletions

View File

@ -883,6 +883,7 @@ class AttributesController extends AppController {
if ($this->_isRest()) {
$conditions = array('conditions' => array('Attribute.id' => $id), 'withAttachments' => true);
$conditions['includeAllTags'] = false;
$conditions['includeAttributeUuid'] = true;
$attribute = $this->Attribute->fetchAttributes($this->Auth->user(), $conditions);
if (empty($attribute)) throw new MethodNotAllowedException('Invalid attribute');
$attribute = $attribute[0];

View File

@ -2237,7 +2237,7 @@ class Attribute extends AppModel {
'recursive' => -1,
'contain' => array(
'Event' => array(
'fields' => array('id', 'info', 'org_id', 'orgc_id'),
'fields' => array('id', 'info', 'org_id', 'orgc_id', 'uuid'),
),
),
);
@ -2294,6 +2294,9 @@ class Attribute extends AppModel {
unset($results[$key]);
continue;
}
if (!empty($options['includeAttributeUuid'])) {
$results[$key]['Attribute']['event_uuid'] = $results[$key]['Event']['uuid'];
}
if ($proposals_block_attributes) {
if (!empty($attribute['ShadowAttribute'])) {
unset($results[$key]);