Commit 1f220a46 authored by drumm's avatar drumm
Browse files

Issue #3135642: Remove API compatibility filter from project index View

parent b6fa40b4
......@@ -1670,46 +1670,6 @@ function project_release_get_version_extra_weight_map() {
return variable_get('project_release_version_extra_weights', $default_map);
}
/**
* Implements hook_views_default_views_alter().
*
* This injects project_release-specific features into views provided by the
* project.module.
*/
function project_release_views_default_views_alter(&$views) {
$api_vocabulary = taxonomy_vocabulary_load(variable_get('project_release_api_vocabulary', 0));
if (!empty($api_vocabulary) && isset($views['project_index'])) {
// Add release API compatibility filter to project index view.
$views['project_index']->set_display('default');
$views['project_index']->display_handler->set_option('relationships', array(
'reverse_field_release_project_node' => array(
'id' => 'reverse_field_release_project_node',
'table' => 'node',
'field' => 'reverse_field_release_project_node',
'label' => 'Releases',
),
));
$filters = $views['project_index']->display_handler->get_option('filters');
$filters['project_release_api_vocabulary'] = array(
'id' => 'project_release_api_vocabulary',
'table' => 'field_data_taxonomy_vocabulary_6',
'field' => 'taxonomy_vocabulary_6_tid',
'relationship' => 'reverse_field_release_project_node',
'exposed' => TRUE,
'expose' => array(
'operator_id' => 'project_release_api_vocabulary_op',
'label' => 'API compatibility',
'operator' => 'project_release_api_vocabulary_op',
'identifier' => 'release-api',
),
'type' => 'select',
'vocabulary' => $api_vocabulary->machine_name,
);
$views['project_index']->display_handler->set_option('filters', $filters);
$views['project_index']->destroy();
}
}
/**
* Implements hook_ctools_plugin_directory().
*/
......
Supports Markdown
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