[Kolab-devel] Calendar plugin syntax error with PHP 5.4
Enrico Tagliavini
enrico.tagliavini at gmail.com
Mon Apr 12 18:28:53 CEST 2021
Dear all,
I tried to register on your gitlab to report this issue, but nothing I
tried worked. Google and github authenticators are not authorized for
registration, so I'm writing here instead.
With the update of today the package
roundcubemail-plugin-calendar-3.5.6-2.1.el7.kolab_16.noarch was pushed
(previous version was 3.5.5-3). After the update roundcube web
interface stops working returning error 500. The roundcube error log
shows
[12-Apr-2021 15:49:58 UTC] PHP Fatal error: Can't use function return
value in write context in
/usr/share/roundcubemail/plugins/calendar/calendar.php on line 862
It looks like the way the empty() function is used is valid only for
PHP 5.5 and up and not for PHP 5.4 which is what is used by default
for Kolab on CentOS 7 systems.
The fix is quite straightforward (also attached)
--- /usr/share/roundcubemail/plugins/calendar/calendar.php.orig
2021-04-12 17:54:29.890162437 +0200
+++ /usr/share/roundcubemail/plugins/calendar/calendar.php
2021-04-12 17:56:35.911593383 +0200
@@ -844,6 +844,7 @@
$birthdays_alarm_offset =
rcube_utils::get_input_value('_birthdays_alarm_offset',
rcube_utils::INPUT_POST);
$birthdays_alarm_value =
rcube_utils::get_input_value('_birthdays_alarm_value',
rcube_utils::INPUT_POST);
$birthdays_alarm_value = $birthdays_alarm_offset[0] .
intval($birthdays_alarm_value) . $birthdays_alarm_offset[1];
+ $calendar_contact_birthdays_value =
rcube_utils::get_input_value('_contact_birthdays',
rcube_utils::INPUT_POST);
$p['prefs'] = [
'calendar_default_view' =>
rcube_utils::get_input_value('_default_view',
rcube_utils::INPUT_POST),
@@ -859,7 +860,8 @@
'calendar_default_calendar' =>
rcube_utils::get_input_value('_default_calendar',
rcube_utils::INPUT_POST),
'calendar_date_format' => null, // clear
previously saved values
'calendar_time_format' => null,
- 'calendar_contact_birthdays' =>
!empty(rcube_utils::get_input_value('_contact_birthdays',
rcube_utils::INPUT_POST)),
+# 'calendar_contact_birthdays' =>
!empty(rcube_utils::get_input_value('_contact_birthdays',
rcube_utils::INPUT_POST)),
+ 'calendar_contact_birthdays' =>
!empty($calendar_contact_birthdays_value),
'calendar_birthday_adressbooks' => (array)
rcube_utils::get_input_value('_birthday_adressbooks',
rcube_utils::INPUT_POST),
'calendar_birthdays_alarm_type' =>
rcube_utils::get_input_value('_birthdays_alarm_type',
rcube_utils::INPUT_POST),
'calendar_birthdays_alarm_offset' =>
$birthdays_alarm_value ?: null,
Kind regards.
Enrico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_kolab_calendar.patch
Type: text/x-patch
Size: 1898 bytes
Desc: not available
URL: <http://lists.kolab.org/pipermail/devel/attachments/20210412/4cc0fac5/attachment.bin>
More information about the devel
mailing list