1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-11-29 11:24:11 +01:00

fix bug #880, there was no $root parameter passed to the VObject/Parameter creation

This commit is contained in:
babelouest 2015-05-19 08:33:09 -04:00
parent f92f6a1deb
commit 75bbf040e4
4 changed files with 8 additions and 8 deletions

View File

@ -58,7 +58,7 @@ abstract class ImportConnector {
* @param $importEntry the entry configuration to update in SimpleXml format
* @value the value to update
*/
protected function updateProperty(&$property, $importEntry, $value) {
protected function updateProperty(&$property, $importEntry, $value, $root = null) {
if (isset($property) && isset($importEntry) && isset($value)) {
if (isset($importEntry->vcard_entry)) {
if (isset($importEntry->vcard_entry['type'])) {
@ -66,7 +66,7 @@ abstract class ImportConnector {
}
if (isset($importEntry->vcard_entry->additional_property)) {
foreach ($importEntry->vcard_entry->additional_property as $additionalProperty) {
$property->parameters[] = new \Sabre\VObject\Parameter(''.$additionalProperty['name'], ''.$additionalProperty['value']);
$property->parameters[] = new \Sabre\VObject\Parameter($root, ''.$additionalProperty['name'], ''.$additionalProperty['value']);
}
}
if (isset($importEntry->vcard_entry['prefix'])) {

View File

@ -158,12 +158,12 @@ class ImportCsvConnector extends ImportConnector {
$vcard->add($property);
} else {
$property = $this->getOrCreateVCardProperty($vcard, $importEntry->vcard_entry);
$this->updateProperty($property, $importEntry, trim($oneValue));
$this->updateProperty($property, $importEntry, trim($oneValue), $vcard);
}
}
} else {
$property = $this->getOrCreateVCardProperty($vcard, $importEntry->vcard_entry);
$this->updateProperty($property, $importEntry, trim($oneValue));
$this->updateProperty($property, $importEntry, trim($oneValue), $vcard);
}
}
} else if (isset($element[$i]) && isset($title[$i])) {

View File

@ -163,7 +163,7 @@ class ImportLdifConnector extends ImportConnector{
if (isset($importEntry['image']) && $importEntry['image'] == "true") {
$this->updateImageProperty($property, $value);
} else {
$this->updateProperty($property, $importEntry, $value);
$this->updateProperty($property, $importEntry, $value, $dest);
}
}
}
@ -172,7 +172,7 @@ class ImportLdifConnector extends ImportConnector{
if (isset($importEntry['image']) && $importEntry['image'] == "true") {
$this->updateImageProperty($property, $value);
} else {
$this->updateProperty($property, $importEntry, $value);
$this->updateProperty($property, $importEntry, $value, $dest);
}
}
}

View File

@ -133,12 +133,12 @@ class ImportVCardConnector extends ImportConnector{
$dest->add($property);
} else {
$property = $this->getOrCreateVCardProperty($dest, $importEntry->vcard_entry);
$this->updateProperty($property, $importEntry, trim($oneValue));
$this->updateProperty($property, $importEntry, trim($oneValue), $dest);
}
}
} else {
$property = $this->getOrCreateVCardProperty($dest, $importEntry->vcard_entry);
$this->updateProperty($property, $importEntry, $sourceProperty->getValue());
$this->updateProperty($property, $importEntry, $sourceProperty->getValue(), $dest);
}
}
} else {