fix: [validation] Fixed an issue with the unique attribute validation rule blocking legitimate use-cases

- adding an attribute with a matching pair or category/type/value in an existing object-contained attribute would be incorrectly flagged as violating the attribute uniqueness rule
pull/1994/merge
iglocska 2018-05-10 12:40:53 +02:00
parent 86a54ffe77
commit 0324379ebd
1 changed files with 2 additions and 1 deletions

View File

@ -777,7 +777,8 @@ class Attribute extends AppModel {
'Attribute.event_id' => $eventId,
'Attribute.type' => $type,
'Attribute.category' => $category,
'Attribute.deleted' => 0
'Attribute.deleted' => 0,
'Attribute.object_id' => 0
);
$conditions = array_merge ($conditions, $value);
if (isset($this->data['Attribute']['id'])) {