diff --git a/includes/date_ical_plugin_row_ical_fields.inc b/includes/date_ical_plugin_row_ical_fields.inc index e4a22c8..8d4a6ed 100644 --- a/includes/date_ical_plugin_row_ical_fields.inc +++ b/includes/date_ical_plugin_row_ical_fields.inc @@ -164,8 +164,10 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row { // Create the event by starting with the date array from this row. $event = $date; - $entity = $row->_field_data[$this->view->base_field]['entity']; - $entity_type = $row->_field_data[$this->view->base_field]['entity_type']; + $entity = isset($row->_field_data[$this->view->base_field]['entity']) ? + $row->_field_data[$this->view->base_field]['entity'] : FALSE; + $entity_type = isset($row->_field_data[$this->view->base_field]['entity_type']) ? + $row->_field_data[$this->view->base_field]['entity_type'] : FALSE; // Add the CREATED, LAST-MODIFIED, and URL components based on the entity. // According to the iCal standard, CREATED and LAST-MODIFIED must be UTC. // Fortunately, Drupal stores timestamps in the DB as UTC, so we just need @@ -180,9 +182,11 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row { // If changed is unset, but created is, use that for last-modified. $event['last-modified'] = new DateObject($entity->created, 'UTC'); } - $uri = entity_uri($entity_type, $entity); - $uri['options']['absolute'] = TRUE; - $event['url'] = url($uri['path'], $uri['options']); + if ($entity_type && $entity) { + $uri = entity_uri($entity_type, $entity); + $uri['options']['absolute'] = TRUE; + $event['url'] = url($uri['path'], $uri['options']); + } // Generate a unique ID for this event by emulating the way the Date module // creates a Date ID.