summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-12-05 12:46:23 +0100
committerAleksander Machniak <alec@alec.pl>2013-12-05 12:46:23 +0100
commit2c16ab5682fe60cc2da6d0ca57089208810a642d (patch)
tree6668e730506cc3978ba0cbc1d8961001e6069023 /program
parent18b40c1a3214518764e99f69b581bd7c90426091 (diff)
Check rcube_addressbook::get_error() after failing delete (#1489463)
Diffstat (limited to 'program')
-rw-r--r--program/steps/addressbook/delete.inc12
1 files changed, 11 insertions, 1 deletions
diff --git a/program/steps/addressbook/delete.inc b/program/steps/addressbook/delete.inc
index 3bb2ef500..b69d519ac 100644
--- a/program/steps/addressbook/delete.inc
+++ b/program/steps/addressbook/delete.inc
@@ -51,7 +51,17 @@ foreach ($cids as $source => $cid)
$deleted = !$plugin['abort'] ? $CONTACTS->delete($cid, $undo_time < 1) : $plugin['result'];
if (!$deleted) {
- $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'contactdelerror', 'error');
+ if ($plugin['message']) {
+ $error = $plugin['message'];
+ }
+ else if (($error = $CONTACTS->get_error()) && $error['message']) {
+ $error = $error['message'];
+ }
+ else {
+ $error = 'contactdelerror';
+ }
+
+ $OUTPUT->show_message($error, 'error');
$OUTPUT->command('list_contacts');
$OUTPUT->send();
}