Commit d403db52 authored by Robert Rollins's avatar Robert Rollins

Fixed a bug which caused the View renderer to crash on bad fields.

If the user specified a date field in the Show settings which didn't exist in one or more of the entities which passed through the View, the rendering process would crash. This should no longer be the case.
parent 681c5d60
......@@ -121,6 +121,11 @@ class date_ical_plugin_row_ical_feed extends views_plugin_row {
}
// Identify the field value that matched our query.
if (!isset($entity->$field_name)) {
// This entity doesn't have the date property that the user configured
// our view to use. We can't do anything with it
return;
}
$item = $entity->$field_name;
$entity->date_id = array();
......@@ -129,6 +134,11 @@ class date_ical_plugin_row_ical_feed extends views_plugin_row {
if ($is_field) {
$delta = isset($row->$delta_field) ? $row->$delta_field : 0;
$items = field_get_items($this->entity_type, $entity, $field_name);
if (!$items) {
// This entity doesn't have data in the date field that the user
// configured our view to use. We can't do anything with it.
return;
}
$item = $items[$delta];
$domain = check_plain($_SERVER['SERVER_NAME']);
$entity->date_id[] = "calendar.$id.$field_name.$delta.$domain";
......
......@@ -51,7 +51,10 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style_rss {
$rows = array();
foreach ($this->view->result as $row_index => $row) {
$this->view->row_index = $row_index;
$rows[] = $this->row_plugin->render($row);
$rendered_row = $this->row_plugin->render($row);
if ($rendered_row) {
$rows[] = $rendered_row;
}
}
$output = theme($this->theme_functions(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment