Skip to content

Commit

Permalink
Nicely handle contact deletion on contact edit (#5522)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Dec 24, 2016
1 parent ab429db commit 2418f07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================

- Nicely handle contact deletion on contact edit (#5522)
- vcard_attachments: Add possibility to attach contact vCard to composed message (#4997)
- Preserve message internal/received date on import in mbox format (#5559)
- Zipdownload: Fix date format in mbox "From line"
Expand Down
9 changes: 8 additions & 1 deletion program/steps/addressbook/save.inc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ if (!empty($cid)) {
}

// LDAP DN change
if (is_string($result) && strlen($result)>1) {
if (is_string($result) && strlen($result) > 1) {
$newcid = $result;
// change cid in POST for 'show' action
$_POST['_cid'] = $newcid;
Expand All @@ -167,6 +167,13 @@ if (!empty($cid)) {
// refresh contact data for list update and 'show' action
$CONTACT_RECORD = $CONTACTS->get_record($newcid ?: $cid, true);

// Plugins can decide to remove the contact on edit, e.g. automatic_addressbook
// Best we can do is to refresh the list (#5522)
if (empty($CONTACT_RECORD)) {
$OUTPUT->command('parent.command', 'list');
$OUTPUT->send('iframe');
}

// Update contacts list
$a_js_cols = array();
$record = $CONTACT_RECORD;
Expand Down

0 comments on commit 2418f07

Please sign in to comment.