mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
* REST API: fix PATCHing of custom-fields
This commit is contained in:
parent
f5476ef133
commit
158f683e69
@ -200,7 +200,7 @@ class JsBase
|
||||
|
||||
foreach($definitions as $name => $definition)
|
||||
{
|
||||
$data = $cfs[$name];
|
||||
$data = $cfs[$name] ?? null;
|
||||
if (isset($data))
|
||||
{
|
||||
if (is_scalar($data) || is_array($data) && !isset($data['value']))
|
||||
@ -357,9 +357,17 @@ class JsBase
|
||||
$target = &$target[$part];
|
||||
}
|
||||
if (isset($value))
|
||||
{
|
||||
// objects need to be merged, to not unset all not given attributes
|
||||
if (is_array($value) && !array_key_exists(0, $value))
|
||||
{
|
||||
$target = array_merge($target, $value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$target = $value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($parent[$part]);
|
||||
|
@ -179,7 +179,7 @@ class JsCalendar extends JsBase
|
||||
break;
|
||||
|
||||
case 'egroupware.org:customfields':
|
||||
$event += self::parseCustomfields($value, $strict);
|
||||
$event = array_merge($event, self::parseCustomfields($value, $strict));
|
||||
break;
|
||||
|
||||
case 'prodId':
|
||||
|
@ -188,7 +188,7 @@ class JsContact extends Api\CalDAV\JsBase
|
||||
break;
|
||||
|
||||
case 'egroupware.org:customfields':
|
||||
$contact += self::parseCustomfields($value);
|
||||
$contact = array_merge($contact, self::parseCustomfields($value));
|
||||
break;
|
||||
|
||||
case 'egroupware.org:assistant':
|
||||
|
@ -154,7 +154,7 @@ class JsTimesheet extends Api\CalDAV\JsBase
|
||||
break;
|
||||
|
||||
case 'egroupware.org:customfields':
|
||||
$timesheet += self::parseCustomfields($value);
|
||||
$timesheet = array_merge($timesheet, self::parseCustomfields($value));
|
||||
break;
|
||||
|
||||
case 'prodId':
|
||||
@ -163,6 +163,7 @@ class JsTimesheet extends Api\CalDAV\JsBase
|
||||
case 'modifier':
|
||||
case self::AT_TYPE:
|
||||
case 'id':
|
||||
case 'etag':
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user