Commit 484d3a3e authored by yched's avatar yched

#887742 - fix notices in _content_get_formatter() - happens in Views when a...

#887742 - fix notices in _content_get_formatter() - happens in Views when a field is not present in the node type of the rendered row.
parent 7ebf5acf
......@@ -172,6 +172,13 @@ class content_handler_field extends views_handler_field_node {
// We're down to a single node here, so we can retrieve the actual field
// definition for the node type being considered.
$field = content_fields($this->content_field['field_name'], $values->{$this->aliases['type']});
// If the field does not appear in the node type, then we have no value
// to display, and can just return.
if (empty($field)) {
return '';
}
$options = $this->options;
$db_info = content_database_info($field);
......@@ -207,4 +214,4 @@ class content_handler_field extends views_handler_field_node {
return '';
}
}
\ No newline at end of file
}
......@@ -211,6 +211,13 @@ class content_handler_field_multiple extends content_handler_field {
// We're down to a single node here, so we can retrieve the actual field
// definition for the node type being considered.
$field = content_fields($this->content_field['field_name'], $values->{$this->aliases['type']});
// If the field does not appear in the node type, then we have no value
// to display, and can just return.
if (empty($field)) {
return '';
}
$options = $this->options;
$vid = $values->{$this->field_alias};
......@@ -299,4 +306,4 @@ class content_handler_field_multiple extends content_handler_field {
}
}
}
\ No newline at end of file
}
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