some small fixes to set the primary link/contact via a 1-dimension object some simple clients only allow to send

This commit is contained in:
ralf 2025-02-25 10:07:34 +01:00
parent b38fb45a23
commit cf698f9127
4 changed files with 5 additions and 4 deletions

View File

@ -357,7 +357,7 @@ class JsBase
{ {
throw new \InvalidArgumentException("Trying to patch not existing attribute with path $path!"); throw new \InvalidArgumentException("Trying to patch not existing attribute with path $path!");
} }
$parent = $target; $parent = &$target;
$target = &$target[$part]; $target = &$target[$part];
} }
if (isset($value)) if (isset($value))

View File

@ -1260,7 +1260,7 @@ class JsCalendar extends JsBase
{ {
throw new \InvalidArgumentException("Missing or invalid @Type!"); throw new \InvalidArgumentException("Missing or invalid @Type!");
} }
switch($relation['relation'] ?? (strpos($uid, ':') === false ? 'parent' : 'egroupware.org-primary')) switch($relation['relation'] ?? $relation ?? (strpos($uid, ':') === false ? 'parent' : 'egroupware.org-primary'))
{ {
case 'parent': case 'parent':
if (!($parent = self::getInfolog()->read(['info_uid' => $uid]))) if (!($parent = self::getInfolog()->read(['info_uid' => $uid])))

View File

@ -765,7 +765,7 @@ class Storage
$rows = $backend->search($criteria, $only_keys, $order_by, $extra_cols, $rows = $backend->search($criteria, $only_keys, $order_by, $extra_cols,
$wildcard, $empty, $op, $start, $filter, $join, false, $ignore_acl); $wildcard, $empty, $op, $start, $filter, $join, false, $ignore_acl);
$this->total = $backend->total; $this->total = (int)$backend->total;
if ($rows) if ($rows)
{ {

View File

@ -41,7 +41,8 @@ Following RFCs / drafts used/planned for JSON encoding of InfoLog entries
* `egroupware.org-primary` with the following attribute-names * `egroupware.org-primary` with the following attribute-names
* `"<app>:<id>"` or * `"<app>:<id>"` or
* `"addressbook:<value>:<field>"` with addressbook field like `id` or `email` (no `contact_` prefix), or `egroupware.org:customfields/<name>` * `"addressbook:<value>:<field>"` with addressbook field like `id` or `email` (no `contact_` prefix), or `egroupware.org:customfields/<name>`
* you can use `null` instead of a Relation-object to delete the existing value * if you client only allows to send a 1-dimensional object you can use `"relatedTo/addressbook:<value>:#<name>":"egroupware.org-primary"`, to specify the contact to link to via a (unique!) custom-field value
* you can use `null` instead of a Relation-object to delete the existing value (not sending the attribute will NOT delete it!)
* you can use the [`links` sub-collection](Links-and-attachments.md) of each entry to add relations/links to other application-entries * you can use the [`links` sub-collection](Links-and-attachments.md) of each entry to add relations/links to other application-entries
* InfoLogs primary link can also be created via the [`links` sub-collection](Links-and-attachments.md) with a`rel` of `egroupware.org-primary` * InfoLogs primary link can also be created via the [`links` sub-collection](Links-and-attachments.md) with a`rel` of `egroupware.org-primary`