Hi Klaus,
Thanks for the information. I tested with the change, but unfortunately it did
not fix the problem. Here’s what’s happening as best as I can tell. My
apologies, as this isn’t very easy to communicate over email. . .
***** icalsrv.bocalupdate_vevents.import_vevent() *****
import_vevent() imports a VEVENT into an egw event and calls
calendar.bocalupdate.update():
if ($eidOk = $this->rsc->update($event, TRUE)){ // Line 907
***** calendar.bocalupdate *****
Note that $event[‘etag’] is not set at this point. Then update() calls
calendar.bocalupdate.save():
if (!($cal_id = $this->save($event))) // Line 274
$event[‘etag’] is still not set. In save(), $check_etag gets set:
$check_etag = ($event[‘etag’] ? $event[‘etag’]:1); // Line 706
Because $event[‘etag’] isn’t set, $check_etag = 1 always when coming from
icalsrv. Then, save() calls calendar.socal.save():
if (($cal_id = $this->so->save($event,$set_recurrences,NULL,$check_etag)) &&
$set_recurrences && $event[‘recur_type’] != MCAL_RECUR_NONE) // Line 724
***** calendar.socal.save() *****
The result here is that in calendar.socal.save(), $check_modified always gets
the value 1. Then, in calendar.socal.save(), we have:
$check_etag = ($check_modified ? $check_modified :
$event[‘cal_etag’]); // Line 490
$check_etag will always get set to 1, since $check_modified is always 1, then:
if ($cal_id && $check_etag && $check_modified) // Line 491
This will always be true as long as $cal_id is set, which it is for existing
events. Then:
$where = array(‘cal_id’ => $cal_id,’(cal_etag is NULL or cal_etag=’.
$check_etag.’)’); // Line 496
We always get ‘(cal_etag is NULL or cal_etag=1)’. The following update does
nothing for events that have an etag greater than 1, then we check affected
rows:
if ($check_etag && $this->db->affected_rows() < 1) // Line 506
Because affected_rows() returns 0, we return 0.
***** calendar.bocalupdate.save() *****
returns 0
***** calendar.bocalupdate.update() *****
returns 0
***** icalsrv.bocalupdate_vevents.import_vevent() *****
Returns an error because the update failed. Because the event wasn’t correctly
imported, it looks like it was removed by the client, and it gets deleted in
icalsrv_resourcehandler.
Hopefully this helps. I also hang out in #egroupware on FreeNode from 13:00 to
22:00 UTC if that would be easier
Thanks!
Hi Peter,
I did commit a fix for that behavior, in class.socal.inc.php
if ($cal_id && $check_etag && $check_modified)
in line 491
Somehow, someone took that out
if ($cal_id && $check_etag /&& $check_modified/)
the check_modified is a new optional parameter by the save function, if
this parameter is set, it is a save action caused by the ui, if not, … If
the parameter is set the saving of an event is done, regardless of the
etag.
Please test, and if it resolves the problem, please tell, and I will
recommit.
Best regards
Klaus
–
Peter Goerzen
I.S. Development
Hustler Turf Equipment/Excel Industries, Inc.
Check out the new SourceForge.net Marketplace.
It’s the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers