Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact delete error is not implemented in a consistent way. #4413

Closed
rcubetrac opened this issue Dec 5, 2013 · 6 comments
Closed

Contact delete error is not implemented in a consistent way. #4413

rcubetrac opened this issue Dec 5, 2013 · 6 comments

Comments

@rcubetrac
Copy link

Reported by rosali on 5 Dec 2013 10:21 UTC as Trac ticket #1489463

If the backend class is raising an error the current implementation does not check for $CONTACTS->get_error(). In addition it does not return to the appropriate contact group if the error occured when deleting a contact from a selected contactgroup.

Patch:
./program/steps/addressbook/delete.inc ::: line 51 ff

    $deleted = !$plugin[? $CONTACTS->delete($cid, $undo_time < 1) : $plugin['result']('abort']);
    if (!$deleted) {
        /* Begin patch by Rosali */
        $err = $CONTACTS->get_error();
        $OUTPUT->show_message($plugin[? $plugin['message']('message']) : ($err[? $err['message']('message']) : 'contactdelerror'), 'error', null, false);
        $OUTPUT->command('list_contacts', get_input_value('_source', RCUBE_INPUT_GPC), get_input_value('_gid', RCUBE_INPUT_GPC));
        /* End patch by Rosali */
        $OUTPUT->send();
    }

Also it should not show the next contact in the list in the content frame when deletion failed.

Patch:
./program/js/app.js ::: line 4212 ff

    // load contacts remotely
    if (this.gui_objects.contactslist) {
      /* Begin patch by Rosali */
      $('#contact-frame').attr('src', this.env.blankpage);
      $('.loading').remove();
      /* End patch by Rosali */
      this.list_contacts_remote(src, group, page);
      return;
    }

Migrated-From: http://trac.roundcube.net/ticket/1489463

@rcubetrac
Copy link
Author

Comment by @alecpl on 5 Dec 2013 11:50 UTC

The error message handling fixed in 2c16ab5. I didn't do the second part of your request as here the next contact is not loaded on error and I don't see an issue.

@rcubetrac
Copy link
Author

Status changed by @alecpl on 5 Dec 2013 11:50 UTC

new => closed

@rcubetrac
Copy link
Author

Comment by rosali on 6 Dec 2013 09:47 UTC

#1- First part

You missed to implement...

 $OUTPUT->command('list_contacts', get_input_value('_source', RCUBE_INPUT_GPC), get_input_value('_gid', RCUBE_INPUT_GPC));

Note the 2nd and 3rd argument. It makes sure that the group is listed (instead of all contacts from the addressbook backend) if the delete command is triggered when a group is selected.

#2- Second part

I have installed git master. It does not happen there. Confirmed.

@rcubetrac
Copy link
Author

Status changed by rosali on 6 Dec 2013 09:47 UTC

closed => reopened

@rcubetrac
Copy link
Author

Comment by @alecpl on 8 Dec 2013 09:03 UTC

Fixed in 39c90d6.

@rcubetrac
Copy link
Author

Status changed by @alecpl on 8 Dec 2013 09:03 UTC

reopened => closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant