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

Nicely handle contact deletion on contact edit #5522

Closed
sblaisot opened this issue Nov 16, 2016 · 6 comments
Closed

Nicely handle contact deletion on contact edit #5522

sblaisot opened this issue Nov 16, 2016 · 6 comments

Comments

@sblaisot
Copy link

sblaisot commented Nov 16, 2016

Hi,

Some user of automatic_addressbook plugin report the following message in his error log:

PHP Warning: array_intersect_key(): Argument #1 is not an array in /usr/share/roundcube/program/steps/addressbook/save.inc on line 178

sblaisot/automatic_addressbook#11

I suspect a bug in save.inc but maybe there is also a bug in automatic_addressbook.

any hint ?

@sblaisot
Copy link
Author

I think I found why.
automatically collected addressbook work in a different way. Each edited entry is moved to the default addressbook resulting in the deletion of that entry in the automatically collected addressbook.

I think this case is handled properly by save.inc only in the case of an LDAP DN change (with result being a string). This case is also a change in contact id, but with id being an int.

@alecpl
Copy link
Member

alecpl commented Nov 17, 2016

All we can do here is to throw an error if get_record() does not return an array.

@sblaisot
Copy link
Author

If get_record() doesn't return an array, can't you just stop refreshing the view ?
I mean, if(is_array($CONTACT_RECORD)) lines 170-187 ?

just to handle the case where a plugin removed the contact from that addressbook on update.

@alecpl
Copy link
Member

alecpl commented Nov 17, 2016

I suppose we could force a list refresh in such cases, so it would also bring the watermark page to the contact frame.

@alecpl alecpl changed the title PHP Warning: array_intersect_key(): Argument #1 is not an array in program/steps/addressbook/save.inc Nicely handle contact deletion on contact edit Nov 20, 2016
@alecpl alecpl added this to the later milestone Nov 20, 2016
@alecpl alecpl modified the milestones: 1.3-beta, later Dec 24, 2016
@alecpl
Copy link
Member

alecpl commented Dec 24, 2016

Done.

@alecpl alecpl closed this as completed Dec 24, 2016
@sblaisot
Copy link
Author

Thanks

ZiBiS added a commit to ZiBiS/roundcubemail that referenced this issue Jan 9, 2017
* 'master' of https://github.com/roundcube/roundcubemail: (48 commits)
  Fix bug where external content in src attribute of input/video tags was not secured (roundcube#5583)
  Avoid closure compiler suspicious code warning (roundcube#5584)
  Add class attribute for preferences sections list
  Remove redundant code
  Fix bug where image data URIs in css style were treated as evil/remote in mail preview (roundcube#5580)
  Fix pdf object visibility
  Hide QR-Code button if PHP-GD is not installed
  Add 1.3-beta milestone + update copyright year
  Small code improvements in PDF capability checker
  Remove old jsdeps.sh script
  Add --delete argument to install-jsdeps.sh
  Fix function name
  Fix required OpenPGP version
  Make it working with wget when curl is not installed, mark --force argument as boolean
  Add --force option + update install insructions (roundcube#5535)
  Install script to fetch javascript dependencies defined in jsdeps.json (roundcube#5535)
  Fix so group/addressbook selection is retained on page refresh
  Fix some advanced search issues with multiple addressbooks (roundcube#5572)
  Fix unsetting template objects
  Nicely handle contact deletion on contact edit (roundcube#5522)
  ...
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

2 participants