chg: [internal] Simplified putting attributes to objects

pull/6265/head
Jakub Onderka 2020-09-01 13:33:21 +02:00
parent e11f6d0087
commit 1b9f0c08f1
1 changed files with 4 additions and 4 deletions

View File

@ -2288,8 +2288,8 @@ class Event extends AppModel
}
}
}
if (!$flatten && $event['Attribute'][$key]['object_id'] != 0) {
$tempObjectAttributeContainer[$event['Attribute'][$key]['object_id']][] = $event['Attribute'][$key];
if (!$flatten && $attribute['object_id'] != 0) {
$tempObjectAttributeContainer[$attribute['object_id']][] = $attribute;
unset($event['Attribute'][$key]);
}
}
@ -2298,11 +2298,11 @@ class Event extends AppModel
if (!empty($event['Object'])) {
$event['Object'] = $this->__attachSharingGroups(!$options['sgReferenceOnly'], $event['Object'], $sharingGroupData);
foreach ($event['Object'] as $objectKey => $objectValue) {
if (!empty($tempObjectAttributeContainer[$objectValue['id']])) {
if (isset($tempObjectAttributeContainer[$objectValue['id']])) {
$event['Object'][$objectKey]['Attribute'] = $tempObjectAttributeContainer[$objectValue['id']];
unset($tempObjectAttributeContainer[$objectValue['id']]);
}
}
unset($tempObjectAttributeContainer);
}
if (!empty($event['ShadowAttribute'])) {
if ($isSiteAdmin && isset($options['includeFeedCorrelations']) && $options['includeFeedCorrelations']) {