[Tickets #14018] Re: Kronolith syncml duplicate event detection broken

noreply at bugs.horde.org noreply at bugs.horde.org
Mon Jun 22 14:59:01 UTC 2015


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: https://bugs.horde.org/ticket/14018
------------------------------------------------------------------------------
  Ticket             | 14018
  Updated By         | horde at albasoft.com
  Summary            | Kronolith syncml duplicate event detection broken
  Queue              | Synchronization
  Version            | Git master
  Type               | Bug
  State              | Feedback
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             | Michael Rubinsky
------------------------------------------------------------------------------


horde at albasoft.com (2015-06-22 14:59) wrote:

> Please provide a test case where this does not work. I can verify  
> the following tests work:
>
> <code>
> $d1 = new Horde_Date('2015-06-20');
> $d2 = new Horde_Date('2015-06-20');
> var_dump($d1 == $d2);
> </code>
>
> Results
> bool(true)
>
> =========
>
> <code>
> $d1 = new Horde_Date('2015-06-20');
> $d2 = new Horde_Date('2014-06-20');
> var_dump($d1 == $d2);
> </code>
>
> Results
> bool(false)
>
>

You are right. Thanks.

But my event test keeps failing, because of a timezone problem, as  
more debug has shown.

I have this setting in my php.ini:
   date.timezone = "Europe/Madrid"
which is a supported setting (  
http://php.net/manual/en/timezones.europe.php ).

But funambol for thunderbird (Windows desktop) is sending the events  
with another timezone, and if I debug that date comparison in  
kronolith/lib/Api.php  for both date objects, it shows this:

2015-06-22T16:38:50+02:00 WARN: HORDE Caught output:
Horde_Date Object
(
     [_year:protected] => 2015
     [_month:protected] => 6
     [_mday:protected] => 22
     [_hour:protected] => 15
     [_min:protected] => 0
     [_sec:protected] => 0
     [_timezone:protected] => Europe/Paris
     [_defaultFormat:protected] => Y-m-d H:i:s
     [_formatCache:protected] => Array
         (
             [Y-m-d H:i:s] => 2015-06-22 15:00:00
         )

)
Horde_Date Object
(
     [_year:protected] => 2015
     [_month:protected] => 6
     [_mday:protected] => 22
     [_hour:protected] => 15
     [_min:protected] => 0
     [_sec:protected] => 0
     [_timezone:protected] => Europe/Madrid
     [_defaultFormat:protected] => Y-m-d H:i:s
     [_formatCache:protected] => Array
         (
             [Y-m-d H:i:s] => 2015-06-22 15:00:00
         )
)

Timezone are different, but date are equal, as both timezones are  
GMT+1 (+2 right now in summer).
Once the event has been inserted in DB, the second format is used. The  
former is the new event being inserted by funambol.

Thus, comparing them with "==" return false, while using  
compareDateTime function returns true.

Thanks for your time.





More information about the bugs mailing list