Le 08/12/2013 09:31, A.L.E.C a écrit :
On 12/07/2013 11:30 PM, Sébastien BLAISOT wrote:
the root cause of all my problems is that rcube_contacts->insert returns the insert_id as an integer in RC 0.8 series and as a string in rc 0.9 series. so this code in step/addressbook/save :
if ($result) { // LDAP DN change if (*is_string($result)*&& strlen($result)>1) { $newcid = $result; // change cid in POST for 'show' action $_POST['_cid'] = $newcid; }
This code is executed after update not insert. It might happen that update modified contact ID. That's the case for e.g. LDAP addressbooks. When the update() do not change ID it should return boolean value.
I see rcube_contacts actually returns integer, this I will fix, but it's not an issue here.
It is in fact an issue when a plugin like automatic_addressbook transform an update to an insert and return abort => true; result => New ID inserted (return of rcube_contact->insert). in this case, as insert, called by the plugin, return a string, then the code is called. It was not the case in RC 0.8x which IMHO was the wroing behaviour. So you corrected a bug and that broke my plugin which was relying on this bug (bad design).
Another case that is not handled is when updating a contact results in the move of the contact in another addressbook as the one the contact was before updating. step/addressbook/save.php address cid change winthin the same addressbook only.
regards,
Sebastien