fix: [sync] Warning when sync object without attributes

pull/7162/head
Jakub Onderka 2021-03-05 10:13:16 +01:00
parent 062390ed83
commit cc9b50fb8e
1 changed files with 7 additions and 5 deletions

View File

@ -3533,11 +3533,13 @@ class Event extends AppModel
continue;
}
}
foreach ($o['Attribute'] as $k2 => $a) {
if (isset($a['distribution']) && $a['distribution'] == 4) {
$data['Event']['Object'][$k]['Attribute'][$k2] = $this->captureSGForElement($a, $user, $server);
if ($data['Event']['Object'][$k]['Attribute'][$k2] === false) {
unset($data['Event']['Object'][$k]['Attribute'][$k2]);
if (!empty($o['Attribute'])) {
foreach ($o['Attribute'] as $k2 => $a) {
if (isset($a['distribution']) && $a['distribution'] == 4) {
$data['Event']['Object'][$k]['Attribute'][$k2] = $this->captureSGForElement($a, $user, $server);
if ($data['Event']['Object'][$k]['Attribute'][$k2] === false) {
unset($data['Event']['Object'][$k]['Attribute'][$k2]);
}
}
}
}