[Kolab-devel] freebusy with 32bit systems

hede <[email protected]>
Newsgroups gmane.comp.kde.devel.kolab
Organization der-he.de
Message-ID <20160812165730.3fd70f44__45439.2326101244$1471013879$gmane$org@tbb-phenom.lan>
Hi,

Freebusy, in particular the "FIND AVAILIBILITY" mask, is nonfunctional with 32 bit architectures. 

The reason is:

in /usr/share/roundcubemail/plugins/calendar/calendar.php
-> public function freebusy_times()
-> $times[$s] = intval($dt->format($strformat));
-> the results for time in the list from $start till $end gets converted to integer by intval(). 
(for me it's line 2272)

An example for such a date is: "20160824180000". With 64 bit arch this is fine, integers are big enough to hold such values. With 32 bit architectures it gets converted to 2147483647 because an integer variable cannot hold a value of 20160824180000. Thus all dates are wrong in the resulting fbdata/freebusy_data in calendar_ui.js. This results in a timetable full of "unknown" values. 

Is there a reason to convert the value via intval()? 

I simply removed it (now adding string values!?) and Freebusy is functional, now. The timetable shows free and busy values. 

Regards
hede
(KolabOnArmv7)

_______________________________________________
devel mailing list
[email protected]
https://lists.kolab.org/mailman/listinfo/devel
intval-non32.patch (text/x-patch, 428 B)
--- root/usr-share-roundcubemail-plugins-calendar-calendar.php.ori	2016-08-12 16:37:04.580508814 +0200
+++ /usr/share/roundcubemail/plugins/calendar/calendar.php	2016-08-12 16:51:02.313230209 +0200
@@ -2269,7 +2269,7 @@ class calendar extends rcube_plugin
       }
       
       $slots[$s] = $status;
-      $times[$s] = intval($dt->format($strformat));
+      $times[$s] = $dt->format($strformat);
       $t = $t_end;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.