ical imports are an exciting addition to this module and make a big difference for CiviCRM integration. However, I noticed a small bug. function theme_calendar_display() adds imported events using the array union operator:
$nodes += calendar_add_items($view, 'calendar');

However, when a calendar view contains no non-feed items, the first item in the node array is a placeholder like this:

[0] => stdClass Object ( [nid] => 0 [calendar_start] => 1187266620 [start_offset] => -14400 [calendar_end] => 1187266620 [end_offset] => -14400 )

Since the array of imported feed items is also indexed 0,1,2,... and not with pseudo nids such as 4:0:event_event_start, both arrays have an element with index 0, and thus the first imported feed item is lost. Instead, the arrays should be merged:
$nodes = array_merge($nodes, calendar_add_items($view, 'calendar'));

Trivial patch attached.

CommentFileSizeAuthor
calendar.module_array_merge_bug.diff903 bytesmvc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarenS’s picture

Status: Needs review » Fixed

Oops, already reported in another issue and fixed there. You may have reported it first, but I didn't give you credit.

Anyway, thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)