fix: Temporary fix for no relatedattributes producing an empty string instead of an empty array in the retrieved data

pull/1857/head
Iglocska 2017-01-18 11:24:17 +01:00
parent ceeef8c77a
commit 2a13bf24a3
1 changed files with 2 additions and 2 deletions

View File

@ -792,11 +792,11 @@ class EventsController extends AppController {
// workaround to get the event dates in to the attribute relations
$relatedDates = array();
if (isset($event['RelatedEvent'])) {
if (!empty($event['RelatedEvent'])) {
foreach ($event['RelatedEvent'] as $relation) {
$relatedDates[$relation['Event']['id']] = $relation['Event']['date'];
}
if (isset($event['RelatedAttribute'])) {
if (!empty($event['RelatedAttribute'])) {
foreach ($event['RelatedAttribute'] as $key => $relatedAttribute) {
foreach ($relatedAttribute as $key2 => $relation) {
$event['RelatedAttribute'][$key][$key2]['date'] = $relatedDates[$relation['id']];