diff --git a/calendar/inc/class.calendar_owner_etemplate_widget.inc.php b/calendar/inc/class.calendar_owner_etemplate_widget.inc.php index b93c308be2..a9f9684f6b 100644 --- a/calendar/inc/class.calendar_owner_etemplate_widget.inc.php +++ b/calendar/inc/class.calendar_owner_etemplate_widget.inc.php @@ -299,7 +299,7 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist $type = $data['type']; $value = array( - 'value' => substr($id, 0, -1) == $type ? $id : $type . $id, + 'value' => substr($id, 0, 1) == $type ? $id : $type . $id, 'label' => $title, 'app' => lang($data['app']) ); diff --git a/calendar/js/CalendarOwner.ts b/calendar/js/CalendarOwner.ts index 3f23a603fb..09775c2eed 100644 --- a/calendar/js/CalendarOwner.ts +++ b/calendar/js/CalendarOwner.ts @@ -79,13 +79,14 @@ export class CalendarOwner extends Et2Select } // Put it in the list of options let index = this.select_options.findIndex(o => o.value == owner); - if(index !== -1) + let remote_index = this._selected_remote.findIndex(o => o.value == owner); + if(remote_index !== -1) { - this.select_options[index] = data[owner]; + this._selected_remote[remote_index] = data[owner]; } - else + else if(index == -1) { - this.select_options.push(data[owner]); + this._selected_remote.push(data[owner]); } } this.requestUpdate("select_options");