security updates

have to check views and entityreference for custom patches
This commit is contained in:
Bachir Soussi Chiadmi
2015-04-19 20:45:16 +02:00
parent 802ec0c6f3
commit b3221c71e2
516 changed files with 14267 additions and 7349 deletions

View File

@@ -80,6 +80,17 @@ function entityreference_field_views_data_views_data_alter(&$data, $field) {
'group' => t('Entity Reference'),
'title' => t('Referencing entity'),
'help' => t('A bridge to the @entity entity that is referencing @target_entity via !field_name', $replacements),
'join_extra' => array(
0 => array(
'field' => 'entity_type',
'value' => $entity_type,
),
1 => array(
'field' => 'deleted',
'value' => 0,
'numeric' => TRUE,
),
),
);
}
}

View File

@@ -75,9 +75,11 @@ class entityreference_plugin_display extends views_plugin_display {
// Build the condition using the selected search fields
foreach ($style_options['search_fields'] as $field_alias) {
if (!empty($field_alias)) {
// Get the table and field names for the checked field
if (empty($this->view->field[$field_alias]->field_info))
// Get the table and field names for the checked field.
if (empty($this->view->field[$field_alias]->field_info)) {
$field = $this->view->query->fields[$this->view->field[$field_alias]->field_alias];
}
else {
$this->view->query->add_field($this->view->field[$field_alias]->options['table'], $this->view->field[$field_alias]->real_field, $this->view->field[$field_alias]->options['field'], array());
$field = $this->view->query->fields[$this->view->field[$field_alias]->options['field']];

View File

@@ -45,19 +45,17 @@ class entityreference_plugin_style extends views_plugin_style {
// Group the rows according to the grouping field, if specified.
$sets = $this->render_grouping($this->view->result, $this->options['grouping']);
// Grab the alias of the 'id' field added by entityreference_plugin_display.
$id_field_alias = $this->display->handler->id_field_alias;
// @todo We don't display grouping info for now. Could be useful for select
// widget, though.
$results = array();
$this->view->row_index = 0;
foreach ($sets as $records) {
foreach ($records as $values) {
foreach ($records as $index => $values) {
$this->view->row_index = $index;
// Sanitize html, remove line breaks and extra whitespace.
$results[$values->{$id_field_alias}] = filter_xss_admin(preg_replace('/\s\s+/', ' ', str_replace("\n", '', $this->row_plugin->render($values))));
$this->view->row_index++;
}
}
unset($this->view->row_index);