Commit a9acf4fa authored by amateescu's avatar amateescu Committed by tim.plunkett
Browse files

Issue #1754442 by amateescu | dawehner: Fixed Wizard for comment appears even...

Issue #1754442 by amateescu | dawehner: Fixed Wizard for comment appears even if comment module is disabled.
parent 1de6ee68
......@@ -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'));
......
......@@ -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")
* )
......
......@@ -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")
* )
......
......@@ -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")
* )
......
......@@ -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")
* )
......
......@@ -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")
* )
......
......@@ -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")
* )
......
......@@ -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');
......
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