summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Stevenson2012-02-15 12:42:48 (GMT)
committer Karen Stevenson2012-02-15 12:42:48 (GMT)
commit6109e2e2534f46e2e88a6d736104eea6cdc0a5a8 (patch)
tree32befc7b77f591fcafa66627c5028d7a141a69f6
parent1e83b44597eb1fb4e69c0d68f4e874ea2326a67c (diff)
Add DEPRECATED language to default views and make sure calendar plugins only get added to base tables that have entities.
-rw-r--r--includes/calendar.views.inc5
-rw-r--r--includes/calendar.views_default.inc4
-rw-r--r--includes/calendar.views_template.inc1
-rw-r--r--includes/calendar_plugin_row.inc1
4 files changed, 9 insertions, 2 deletions
diff --git a/includes/calendar.views.inc b/includes/calendar.views.inc
index eded8b8..dbfe6e2 100644
--- a/includes/calendar.views.inc
+++ b/includes/calendar.views.inc
@@ -14,6 +14,9 @@ function calendar_views_plugins() {
$theme_path = $module_path;
module_load_include('inc', 'calendar', 'theme/theme');
+ // Limit these plugins to base tables that represent entities.
+ $base = array_keys(date_views_base_tables());
+
$data = array(
'module' => 'calendar', // This just tells our themes are elsewhere.
@@ -41,6 +44,7 @@ function calendar_views_plugins() {
'uses options' => TRUE,
'type' => 'normal',
'even empty' => TRUE,
+ 'base' => $base,
),
),
'row' => array(
@@ -59,6 +63,7 @@ function calendar_views_plugins() {
'help' => t('Displays each selected entity as a Calendar item.'),
'handler' => 'calendar_plugin_row',
'path' => "$module_path/includes",
+ 'base' => $base,
'uses options' => TRUE,
'uses fields' => TRUE,
'type' => 'normal',
diff --git a/includes/calendar.views_default.inc b/includes/calendar.views_default.inc
index f702c53..fdaf37c 100644
--- a/includes/calendar.views_default.inc
+++ b/includes/calendar.views_default.inc
@@ -134,10 +134,10 @@ foreach ($date_fields as $field_name) {
$view = new view;
$view->name = $name;
-$view->description = $description;
+$view->description = t("DEPRECATED: Create new calendars using 'add view from template'.") . ' ' . $description;
$view->tag = 'Calendar';
$view->base_table = 'node';
-$view->human_name = ucfirst($name);
+$view->human_name = ucfirst($name) . ' ' . t("(DEPRECATED)");
$view->core = 7;
$view->api_version = '3.0-alpha1';
$view->disabled = $name == 'calendar' ? TRUE : FALSE; /* Edit this to true to make a default view disabled initially */
diff --git a/includes/calendar.views_template.inc b/includes/calendar.views_template.inc
index 885ec6a..d9ca952 100644
--- a/includes/calendar.views_template.inc
+++ b/includes/calendar.views_template.inc
@@ -154,6 +154,7 @@ $handler->display->display_options['row_plugin'] = 'calendar_entity';
switch ($base_table) {
case 'node':
+ case 'node_revision':
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = $base_table;
$handler->display->display_options['fields']['title']['field'] = 'title';
diff --git a/includes/calendar_plugin_row.inc b/includes/calendar_plugin_row.inc
index 48f103f..3413b3d 100644
--- a/includes/calendar_plugin_row.inc
+++ b/includes/calendar_plugin_row.inc
@@ -254,6 +254,7 @@ class calendar_plugin_row extends views_plugin_row {
$ids[$id] = $id;
}
}
+
$base_tables = date_views_base_tables();
$this->entity_type = $base_tables[$this->view->base_table];
if (!empty($ids)) {