Commit 11eeb98b authored by alexpott's avatar alexpott

Issue #2070609 by damiankloip, tstoeckler: Remove obsolete 'module' keys from...

Issue #2070609 by damiankloip, tstoeckler: Remove obsolete 'module' keys from Views plugin annotations.
parent 7470a188
......@@ -16,7 +16,6 @@
*
* @ViewsRow(
* id = "aggregator_rss",
* module = "aggregator",
* theme = "views_view_row_rss",
* title = @Translation("Aggregator item"),
* help = @Translation("Display the aggregator item using the data from the original source."),
......
......@@ -20,7 +20,6 @@
*
* @ViewsDisplay(
* id = "block",
* module = "block",
* title = @Translation("Block"),
* help = @Translation("Display the view as a block."),
* theme = "views_view",
......
......@@ -559,5 +559,5 @@ function comment_views_data_alter(&$data) {
*/
function comment_views_plugins_row_alter(array &$plugins) {
$plugins['entity:comment']['class'] = 'Drupal\comment\Plugin\views\row\CommentRow';
$plugins['entity:comment']['module'] = 'comment';
$plugins['entity:comment']['provider'] = 'comment';
}
......@@ -16,7 +16,6 @@
*
* @ViewsRow(
* id = "comment_rss",
* module = "comment",
* title = @Translation("Comment"),
* help = @Translation("Display the comment as RSS."),
* theme = "views_view_row_rss",
......
......@@ -20,7 +20,6 @@
*
* @ViewsWizard(
* id = "comment",
* module = "comment",
* base_table = "comment",
* title = @Translation("Comments")
* )
......
......@@ -16,7 +16,6 @@
*
* @ViewsWizard(
* id = "file_managed",
* module = "file",
* base_table = "file_managed",
* title = @Translation("Files")
* )
......
......@@ -18,7 +18,6 @@
*
* @ViewsArgumentDefault(
* id = "node",
* module = "node",
* title = @Translation("Content ID from URL")
* )
*/
......
......@@ -16,7 +16,6 @@
*
* @ViewsArgumentValidator(
* id = "node",
* module = "node",
* title = @Translation("Content")
* )
*/
......
......@@ -22,8 +22,7 @@
* theme = "views_view_row_rss",
* register_theme = FALSE,
* base = {"node"},
* display_types = {"feed"},
* module = "node"
* display_types = {"feed"}
* )
*/
class Rss extends RowPluginBase {
......
......@@ -20,7 +20,6 @@
*
* @ViewsWizard(
* id = "node",
* module = "node",
* base_table = "node",
* title = @Translation("Content")
* )
......
......@@ -20,7 +20,6 @@
*
* @ViewsWizard(
* id = "node_revision",
* module = "node",
* base_table = "node_field_revision",
* title = @Translation("Content revisions")
* )
......
......@@ -660,5 +660,5 @@ function node_views_wizard() {
*/
function node_views_plugins_row_alter(array &$plugins) {
$plugins['entity:node']['class'] = 'Drupal\node\Plugin\views\row\NodeRow';
$plugins['entity:node']['module'] = 'node';
$plugins['entity:node']['provider'] = 'node';
}
......@@ -17,7 +17,6 @@
*
* @ViewsArgumentDefault(
* id = "php",
* module = "php",
* title = @Translation("PHP Code")
* )
*/
......
......@@ -17,7 +17,6 @@
*
* @ViewsArgumentValidator(
* id = "php",
* module = "php",
* title = @Translation("PHP Code")
* )
*/
......
......@@ -25,7 +25,6 @@
*
* @ViewsDisplay(
* id = "rest_export",
* module = "rest",
* title = @Translation("REST export"),
* help = @Translation("Create a REST export resource."),
* uses_route = TRUE,
......
......@@ -19,7 +19,6 @@
*
* @ViewsRow(
* id = "data_entity",
* module = "rest",
* title = @Translation("Entity"),
* help = @Translation("Use entities as row data."),
* display_types = {"data"}
......
......@@ -20,7 +20,6 @@
*
* @ViewsRow(
* id = "data_field",
* module = "rest",
* title = @Translation("Fields"),
* help = @Translation("Use fields as row data."),
* display_types = {"data"}
......
......@@ -22,7 +22,6 @@
*
* @ViewsStyle(
* id = "serializer",
* module = "rest",
* title = @Translation("Serializer"),
* help = @Translation("Serializes views row data using the Serializer component."),
* display_types = {"data"}
......
......@@ -16,7 +16,6 @@
*
* @ViewsRow(
* id = "search_view",
* module = "search",
* title = @Translation("Search"),
* help = @Translation("Provides a row plugin to display search results.")
* )
......
......@@ -18,7 +18,6 @@
*
* @ViewsArgumentDefault(
* id = "taxonomy_tid",
* module = "taxonomy",
* title = @Translation("Taxonomy term ID from URL")
* )
*/
......
......@@ -18,7 +18,6 @@
*
* @ViewsArgumentValidator(
* id = "taxonomy_term",
* module = "taxonomy",
* title = @Translation("Taxonomy term")
* )
*/
......
......@@ -16,7 +16,6 @@
*
* @ViewsWizard(
* id = "taxonomy_term",
* module = "taxonomy",
* base_table = "taxonomy_term_data",
* title = @Translation("Taxonomy terms")
* )
......
......@@ -18,7 +18,6 @@
*
* @ViewsArgumentDefault(
* id = "current_user",
* module = "user",
* title = @Translation("User ID from logged in user")
* )
*/
......
......@@ -17,7 +17,6 @@
*
* @ViewsArgumentDefault(
* id = "user",
* module = "user",
* title = @Translation("User ID from URL")
* )
*/
......
......@@ -22,7 +22,6 @@
*
* @ViewsArgumentValidator(
* id = "user",
* module = "user",
* title = @Translation("User")
* )
*/
......
......@@ -20,7 +20,6 @@
*
* @ViewsWizard(
* id = "users",
* module = "user",
* base_table = "users",
* title = @Translation("Users")
* )
......
......@@ -384,5 +384,5 @@ function user_views_data() {
*/
function user_views_plugins_row_alter(array &$plugins) {
$plugins['entity:user']['class'] = 'Drupal\user\Plugin\views\row\UserRow';
$plugins['entity:user']['module'] = 'user';
$plugins['entity:user']['provider'] = 'user';
}
......@@ -15,13 +15,6 @@
*/
abstract class ViewsPluginAnnotationBase extends Plugin implements AnnotationInterface {
/**
* The module the plugin is defined by.
*
* @var string
*/
public $module = 'views';
/**
* A class to make the plugin derivative aware.
*
......
......@@ -96,7 +96,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) {
if (isset($entity_info['base_table']) && $this->viewsData->get($entity_info['base_table']) && $this->entityManager->hasController($entity_type, 'render')) {
$this->derivatives[$entity_type] = array(
'id' => 'entity:' . $entity_type,
'module' => 'views',
'provider' => 'views',
'title' => $entity_info['label'],
'help' => t('Display the @label', array('@label' => $entity_info['label'])),
'base' => array($entity_info['base_table']),
......
......@@ -41,7 +41,6 @@ public function __construct($type, \Traversable $namespaces, CacheBackendInterfa
$this->defaults += array(
'parent' => 'parent',
'plugin_type' => $type,
'module' => 'views',
'register_theme' => TRUE,
);
......
......@@ -11,6 +11,7 @@
* Tests basic functions from the Views module.
*/
use Drupal\views\Plugin\views\filter\Standard;
use Drupal\Component\Utility\String;
class ModuleTest extends ViewUnitTestBase {
......@@ -19,7 +20,7 @@ class ModuleTest extends ViewUnitTestBase {
*
* @var array
*/
public static $testViews = array('test_view_status');
public static $testViews = array('test_view_status', 'test_view');
/**
* Stores the last triggered error, for example via debug().
......@@ -254,6 +255,26 @@ public function testViewsFetchPluginNames() {
$this->assertIdentical($plugins, array());
}
/**
* Tests the views_plugin_list() function.
*/
public function testViewsPluginList() {
$plugin_list = views_plugin_list();
// Only plugins used by 'test_view' should be in the plugin list.
foreach (array('display:default', 'pager:none') as $key) {
list($plugin_type, $plugin_id) = explode(':', $key);
$plugin_def = $this->container->get("plugin.manager.views.$plugin_type")->getDefinition($plugin_id);
$this->assertTrue(isset($plugin_list[$key]), String::format('The expected @key plugin list key was found.', array('@key' => $key)));
$plugin_details = $plugin_list[$key];
$this->assertEqual($plugin_details['type'], $plugin_type, 'The expected plugin type was found.');
$this->assertEqual($plugin_details['title'], $plugin_def['title'], 'The expected plugin title was found.');
$this->assertEqual($plugin_details['provider'], $plugin_def['provider'], 'The expected plugin provider was found.');
$this->assertTrue(in_array('test_view', $plugin_details['views']), 'The test_view View was found in the list of views using this plugin.');
}
}
/**
* Helper to return an expected views option array.
*
......
......@@ -21,7 +21,6 @@
* title = @Translation("Test row plugin"),
* help = @Translation("Provides a generic row test plugin."),
* theme = "views_view_row_test",
* module = "views_test_data",
* display_types = {"normal", "test"}
* )
*/
......
......@@ -22,7 +22,6 @@
* title = @Translation("Field mapping"),
* help = @Translation("Maps specific fields to specific purposes."),
* theme = "views_view_mapping_test",
* module = "views_test_data",
* display_types = {"normal", "test"}
* )
*/
......
......@@ -18,7 +18,6 @@
*
* @ViewsStyle(
* id = "test_template_style",
* module = "views_test_data",
* title = @Translation("Test style template plugin"),
* help = @Translation("Provides a generic style template test plugin."),
* theme = "views_view_style_template_test",
......
......@@ -234,7 +234,7 @@ function views_plugin_list() {
$plugins[$key] = array(
'type' => $type,
'title' => check_plain($info[$name]['title']),
'module' => check_plain($info[$name]['module']),
'provider' => check_plain($info[$name]['provider']),
'views' => array(),
);
}
......
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