Removed a crappy solution to an issue with attributes being overwritten that was fixed a long time ago correctly on data entry

pull/727/head
iglocska 2015-11-16 19:51:38 +01:00
parent cd3096a38f
commit 053c27ae9a
3 changed files with 2 additions and 7 deletions

View File

@ -1 +1 @@
{"major":2, "minor":3, "hotfix":159}
{"major":2, "minor":3, "hotfix":160}

View File

@ -64,7 +64,7 @@ class XMLConverterTool {
unset($event['Event']['Attribute'][$key]['value1']);
unset($event['Event']['Attribute'][$key]['value2']);
unset($event['Event']['Attribute'][$key]['category_order']);
if (isset($event['Event']['RelatedAttribute'][$value['id']])) $event['Event']['Attribute'][$key]['RelatedAttribute'] = $event['Event']['RelatedAttribute'][$value['id']];
if (isset($event['Event']['RelatedAttribute']) && isset($event['Event']['RelatedAttribute'][$value['id']])) $event['Event']['Attribute'][$key]['RelatedAttribute'] = $event['Event']['RelatedAttribute'][$value['id']];
if (isset($event['Event']['Attribute'][$key]['ShadowAttribute'])) {
foreach($event['Event']['Attribute'][$key]['ShadowAttribute'] as $skey => $svalue) {
$event['Event']['Attribute'][$key]['ShadowAttribute'][$skey]['value'] = preg_replace ('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $event['Event']['Attribute'][$key]['ShadowAttribute'][$skey]['value']);

View File

@ -587,11 +587,6 @@ class Event extends AppModel {
$encodedFile = $this->Attribute->base64EncodeAttachment($attribute);
$attribute['data'] = $encodedFile;
}
// Passing the attribute ID together with the attribute could cause the deletion of attributes after a publish/push
// Basically, if the attribute count differed between two instances, and the instance with the lower attribute
// count pushed, the old attributes with the same ID got overwritten. Unsetting the ID before pushing it
// solves the issue and a new attribute is always created.
unset($attribute['id']);
}
} else return 403;