Maybe I found the reason behing this.
get_record has a design flaw I think : When assoc=true and the given id doesn't exist (which can happend, believe me :) ) then : db_fetch_assoc is false, leading to empty record, and the following line : return $assoc && $record ? $record : $this->result;
returns $this->result which has not been updated. It takes the result of the last search !
I think there is a algorithm error behind this.
can you confirm ?
End everything behind this is that contact modification can't handle addressbook change in the middle of the process anymore, which was possible before the introduction of roundcube framework.
sebastien
Le 07/12/2013 17:49, Sébastien BLAISOT a écrit :
Hi everybody,
since RC 0.9b, there is a bug in my automatic_addressbook plugin when editing a contact with th move_to config option set to 1 This means that when editing a contact in the collected_abook, it is saved in the default abook and removed from its original collected_abook (calling $CONTACTS->insert and setting abort to true and result to the new cid)
the log is showing : [07-Dec-2013 14:18:16 Europe/Paris] PHP Fatal error: Cannot use object of type rcube_result_set as array in /var/www/vhosts/ssl_common/webmail/test/rc09b/program/steps/addressbook/save.inc on line 134
this seams to come from the following lines of code in program/steps/addressbook/save : $record = $CONTACTS->get_record($newcid ? $newcid : $cid, true); $record['email'] = reset($CONTACTS->get_col_values('email', $record, true));
it seems to me that get_record return in general a record, but can return in some circonstances a rcube_result_set object and the next line of code can't handle this (array assignation on a rcube_result_set object).
Can somebody confirme this ? What are the condition for get_record to return an rcube_result_set with only 1 object in it ?
I don't already understand very well what happens but I can make additionnal tests to help debug this.
If you can confirme this seems to be a bug, I'll file a bug report.
regards,
sebastien