fix: Critical fix to an issue with event add fixed

- a reuse of a pointer causes an invalid duplication of an attribute on entry, leading to the last attribute being dropped
pull/1860/head
Andras Iklody 2017-01-22 12:02:33 +01:00 committed by GitHub
parent a22abaa106
commit 48b57b0879
1 changed files with 1 additions and 1 deletions

View File

@ -1863,7 +1863,7 @@ class Event extends AppModel {
unset($data['Event']['SharingGroup']);
}
if (isset($data['Event']['Attribute'])) {
foreach ($data['Event']['Attribute'] as $k => &$a) {
foreach ($data['Event']['Attribute'] as $k => $a) {
unset($data['Event']['Attribute']['id']);
if (isset($a['distribution']) && $a['distribution'] == 4) {
$data['Event']['Attribute'][$k]['sharing_group_id'] = $this->SharingGroup->captureSG($data['Event']['Attribute'][$k]['SharingGroup'], $user);