Fixed a bug with no sighting data in an event causing a notice

pull/1092/head
iglocska 2015-12-25 00:46:24 +01:00
parent 800b29f5bc
commit 2ccdef8626
1 changed files with 1 additions and 1 deletions

View File

@ -2,6 +2,7 @@
$mayModify = (($isAclModify && $event['Event']['user_id'] == $me['id'] && $event['Orgc']['id'] == $me['org_id']) || ($isAclModifyOrg && $event['Orgc']['id'] == $me['org_id'])); $mayModify = (($isAclModify && $event['Event']['user_id'] == $me['id'] && $event['Orgc']['id'] == $me['org_id']) || ($isAclModifyOrg && $event['Orgc']['id'] == $me['org_id']));
$mayPublish = ($isAclPublish && $event['Orgc']['id'] == $me['org_id']); $mayPublish = ($isAclPublish && $event['Orgc']['id'] == $me['org_id']);
if (Configure::read('Plugin.Sightings_enable')) { if (Configure::read('Plugin.Sightings_enable')) {
$sightingPopover = '';
if (isset($event['Sighting']) && !empty($event['Sighting'])) { if (isset($event['Sighting']) && !empty($event['Sighting'])) {
$ownSightings = array(); $ownSightings = array();
$orgSightings = array(); $orgSightings = array();
@ -15,7 +16,6 @@ if (Configure::read('Plugin.Sightings_enable')) {
else $orgSightings['Other organisations'] = 1; else $orgSightings['Other organisations'] = 1;
} }
} }
$sightingPopover = '';
foreach ($orgSightings as $org => $sightingCount) $sightingPopover .= '<span class=\'bold\'>' . h($org) . '</span>: <span class=\'green\'>' . h($sightingCount) . '</span><br />'; foreach ($orgSightings as $org => $sightingCount) $sightingPopover .= '<span class=\'bold\'>' . h($org) . '</span>: <span class=\'green\'>' . h($sightingCount) . '</span><br />';
} }
} }