diff --git a/includes/admin.inc b/includes/admin.inc index 1cbc9c0f121577ac7e0dd8d2ddaf3c321a5a3960..1e97f12a361cd1e92f974727f1bde661cb199cd8 100644 --- a/includes/admin.inc +++ b/includes/admin.inc @@ -361,7 +361,8 @@ function views_ui_add_form($form, &$form_state) { '#options' => $options, ); $show_form = &$form['displays']['show']; - $show_form['wizard_key']['#default_value'] = views_ui_get_selected($form_state, array('show', 'wizard_key'), 'node', $show_form['wizard_key']); + $default_value = module_exists('node') ? 'node' : 'users'; + $show_form['wizard_key']['#default_value'] = views_ui_get_selected($form_state, array('show', 'wizard_key'), $default_value, $show_form['wizard_key']); // Changing this dropdown updates the entire content of $form['displays'] via // AJAX. views_ui_add_ajax_trigger($show_form, 'wizard_key', array('displays')); diff --git a/lib/Drupal/views/Plugin/views/wizard/Comment.php b/lib/Drupal/views/Plugin/views/wizard/Comment.php index 20893eac9b9e292f6c72543254000f392773a45e..20b45e2b8f9ff7737c81ba16f520a42932131768 100644 --- a/lib/Drupal/views/Plugin/views/wizard/Comment.php +++ b/lib/Drupal/views/Plugin/views/wizard/Comment.php @@ -2,12 +2,12 @@ /** * @file - * Definition of Drupal\views\Plugin\views\wizard\Comment. + * Definition of Views\node\Plugin\views\wizard\Comment. */ -namespace Drupal\views\Plugin\views\wizard; +namespace Views\comment\Plugin\views\wizard; -use Drupal\views\Plugin\wizard; +use Drupal\views\Plugin\views\wizard\WizardPluginBase; use Drupal\Core\Annotation\Plugin; use Drupal\Core\Annotation\Translation; @@ -20,6 +20,7 @@ * * @Plugin( * id = "comment", + * module = "comment", * base_table = "comment", * title = @Translation("Comments") * ) diff --git a/lib/Drupal/views/Plugin/views/wizard/File.php b/lib/Drupal/views/Plugin/views/wizard/File.php index d97460db08a7246c634871e0030ad63006b9aba3..71db6f8d92e942587307d10cf7f800133c100dc8 100644 --- a/lib/Drupal/views/Plugin/views/wizard/File.php +++ b/lib/Drupal/views/Plugin/views/wizard/File.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\views\Plugin\views\wizard\File. + * Definition of Views\file\Plugin\views\wizard\File. */ -namespace Drupal\views\Plugin\views\wizard; +namespace Views\file\Plugin\views\wizard; use Drupal\views\Plugin\views\wizard\WizardPluginBase; use Drupal\Core\Annotation\Plugin; @@ -16,6 +16,7 @@ * * @Plugin( * id = "file_managed", + * module = "file", * base_table = "file_managed", * title = @Translation("Files") * ) diff --git a/lib/Drupal/views/Plugin/views/wizard/Node.php b/lib/Drupal/views/Plugin/views/wizard/Node.php index 4b1b5c1e7365166803c064b3e32a591c74ca02d5..27a6fd256e6cbd4e5dda8f37a51c7c78a18f4b9b 100644 --- a/lib/Drupal/views/Plugin/views/wizard/Node.php +++ b/lib/Drupal/views/Plugin/views/wizard/Node.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\views\Plugin\views\wizard\Node. + * Definition of Views\node\Plugin\views\wizard\Node. */ -namespace Drupal\views\Plugin\views\wizard; +namespace Views\node\Plugin\views\wizard; use Drupal\views\Plugin\views\wizard\WizardPluginBase; use Drupal\Core\Annotation\Plugin; @@ -20,6 +20,7 @@ * * @Plugin( * id = "node", + * module = "node", * base_table = "node", * title = @Translation("Content") * ) diff --git a/lib/Drupal/views/Plugin/views/wizard/NodeRevision.php b/lib/Drupal/views/Plugin/views/wizard/NodeRevision.php index 8981260c75c47b1fa75d911aa54df6a5479a6c3d..b563032918351953edfbb6a887f3e489bca1bd88 100644 --- a/lib/Drupal/views/Plugin/views/wizard/NodeRevision.php +++ b/lib/Drupal/views/Plugin/views/wizard/NodeRevision.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\views\Plugin\views\wizard\NodeRevision. + * Definition of Views\node\Plugin\views\wizard\NodeRevision. */ -namespace Drupal\views\Plugin\views\wizard; +namespace Views\node\Plugin\views\wizard; use Drupal\views\Plugin\views\wizard\WizardPluginBase; use Drupal\Core\Annotation\Plugin; @@ -20,6 +20,7 @@ * * @Plugin( * id = "node_revision", + * module = "node", * base_table = "node_revision", * title = @Translation("Content revisions") * ) diff --git a/lib/Drupal/views/Plugin/views/wizard/TaxonomyTerm.php b/lib/Drupal/views/Plugin/views/wizard/TaxonomyTerm.php index 3ead80275c344ec443e887e57e6d87de02094f2f..632957f18eedb3aec67c4e58757996e7f3a7f386 100644 --- a/lib/Drupal/views/Plugin/views/wizard/TaxonomyTerm.php +++ b/lib/Drupal/views/Plugin/views/wizard/TaxonomyTerm.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\views\Plugin\views\wizard\TaxonomyTerm. + * Definition of Views\taxonomy\Plugin\views\wizard\TaxonomyTerm. */ -namespace Drupal\views\Plugin\views\wizard; +namespace Views\taxonomy\Plugin\views\wizard; use Drupal\views\Plugin\views\wizard\WizardPluginBase; use Drupal\Core\Annotation\Plugin; @@ -16,6 +16,7 @@ * * @Plugin( * id = "taxonomy_term", + * module = "taxonomy", * base_table = "taxonomy_term_data", * title = @Translation("Taxonomy terms") * ) diff --git a/lib/Drupal/views/Plugin/views/wizard/Users.php b/lib/Drupal/views/Plugin/views/wizard/Users.php index 3d42f20d02652da2df58c2f886d8c8033d6cffc8..808479caf6f7580873dad64e4e2f5664ac490ae8 100644 --- a/lib/Drupal/views/Plugin/views/wizard/Users.php +++ b/lib/Drupal/views/Plugin/views/wizard/Users.php @@ -2,10 +2,10 @@ /** * @file - * Definition of Drupal\views\Plugin\views\wizard\Users. + * Definition of Views\user\Plugin\views\wizard\Users. */ -namespace Drupal\views\Plugin\views\wizard; +namespace Views\user\Plugin\views\wizard; use Drupal\views\Plugin\views\wizard\WizardPluginBase; use Drupal\Core\Annotation\Plugin; @@ -20,6 +20,7 @@ * * @Plugin( * id = "users", + * module = "user", * base_table = "users", * title = @Translation("Users") * ) diff --git a/views.module b/views.module index 9dbb1f0b978df226aaec9761b5434ca64b015dba..5c04aa8e5a9d721bbdb1f333d19c80b6f20232d5 100644 --- a/views.module +++ b/views.module @@ -53,7 +53,9 @@ function views_core_modules() { function views_init() { $path = drupal_get_path('module', 'views'); $loader = drupal_classloader(); - foreach (views_core_modules() as $module) { + // Just register enabled modules. + $modules = array_intersect(views_core_modules(), module_list('module_enabled')); + foreach ($modules as $module) { $function = $module . '_views_api'; if (function_exists($function)) { $loader->registerNamespace('Views\\' . $module, DRUPAL_ROOT . '/' . $path . '/lib');