Fatal Error when editing month view
orbface9 - November 24, 2008 - 16:59
| Project: | Calendar |
| Version: | 6.x-2.0-rc5 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
When editing the month view, i tried to click the "Change settings for this style" button and i got a javascript popup.
Fatal error: Unsupported operand types in /var/www/vhosts/calendarofohio.com/httpdocs/sites/all/modules/calendar/includes/calendar_view_plugin_style.inc on line 119
I looked at the file and came up with a fix.
I changed line 119 from:
<?php
'#options' => $field_options + $date_field_options,
?>to this:
<?php
'#options' => is_array($field_options) && is_array($date_field_options)?$field_options + $date_field_options:is_array($field_options)?$field_options:is_array($date_field_options)?$date_field_options:'',
?>Basically, i am just checking to see which if any of the two variables are arrays, and adding those values accordingly.
It is up and running now for me.
Also, just a side note. I recently upgraded from rc4 to rc5, so that may have contributed to my problem.

#1
Created a patch, it's attached.
#2
Created a patch, it's attached.
#3
This is a good catch. I am able to reproduce the problem as well. I rerolled the patch to break the long line into a function that helps make it more self-explanatory.
I changed the priority to critical because the functionality is broken without this patch.
#4
Even easier yet, just initialize $date_field_options = array(), which should have been in there. Which is what I have just committed.
I forgot to credit you guys in the commit, but thanks for the detective work!
#5
Automatically closed -- issue fixed for two weeks with no activity.