summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2008-05-13 22:12:40 (GMT)
committer Earl Miles2008-05-13 22:12:40 (GMT)
commitf4a626199273417c68c571e9f5b3a32447ea1447 (patch)
treebef5db207f5b1b6675c70421a6f1b45198c0db28
parentf80d7a217e6efbfe8e521da6fb4c97ee8d0a0c57 (diff)
Some minor fixes, including a possible fix for #257718
-rw-r--r--includes/admin.inc2
-rw-r--r--includes/handlers.inc15
-rw-r--r--includes/plugins.inc13
-rw-r--r--modules/taxonomy.views.inc11
4 files changed, 30 insertions, 11 deletions
diff --git a/includes/admin.inc b/includes/admin.inc
index 4d1d32f..c4a262c 100644
--- a/includes/admin.inc
+++ b/includes/admin.inc
@@ -811,7 +811,7 @@ function views_ui_edit_view_form_cancel($form, &$form_state) {
}
function views_ui_edit_view_form_delete($form, &$form_state) {
- // Remove this view from cache so edits will be lost.
+ // Redirect to the delete confirm page
$form_state['redirect'] = array('admin/build/views/delete/' . $form_state['view']->name, 'cancel=admin/build/views/edit/' . $form_state['view']->name);
}
diff --git a/includes/handlers.inc b/includes/handlers.inc
index 9721a7c..268b9af 100644
--- a/includes/handlers.inc
+++ b/includes/handlers.inc
@@ -323,6 +323,19 @@ class views_handler extends views_object {
* Take input from exposed filters and assign to this handler, if necessary.
*/
function accept_exposed_input($input) { return TRUE; }
+
+ /**
+ * Get the join object that should be used for this handler.
+ *
+ * This method isn't used a great deal, but it's very handy for easily
+ * getting the join if it is necessary to make some changes to it, such
+ * as adding an 'extra'.
+ */
+ function get_join() {
+ // get the join from this table that links back to the base table.
+ return drupal_clone(views_get_table_join($this->table, $this->query->base_table));
+ }
+
}
/**
@@ -417,7 +430,7 @@ class views_many_to_one_helper {
}
function get_join() {
- return drupal_clone(views_get_table_join($this->handler->table, $this->handler->query->base_table));
+ return $this->handler->get_join();
}
/**
diff --git a/includes/plugins.inc b/includes/plugins.inc
index e370cab..6a232c2 100644
--- a/includes/plugins.inc
+++ b/includes/plugins.inc
@@ -888,13 +888,13 @@ class views_plugin_display extends views_plugin {
'#suffix' => '</div>',
'#title' => t('Type'),
'#type' => 'radios',
- '#options' => array('none' => t('Unrestricted'), 'role' => t('By role'), 'perm' => t('By perm')),
+ '#options' => array('none' => t('Unrestricted'), 'role' => t('By role'), 'perm' => t('By permission')),
'#default_value' => $access['type'],
);
$form['access']['role'] = array(
// Add an id to the surrounding div because checkboxes don't get ids
// as a whole group. =(
- '#prefix' => '<div class="views-left-25"><div id="edit-access-role">',
+ '#prefix' => '<div class="views-left-30"><div id="edit-access-role">',
'#suffix' => '</div></div>',
'#type' => 'checkboxes',
'#title' => t('If by role'),
@@ -917,7 +917,7 @@ class views_plugin_display extends views_plugin {
'#suffix' => '</div>',
'#type' => 'select',
'#options' => $perms,
- '#title' => t('If by perm'),
+ '#title' => t('If by permission'),
'#default_value' => $access['perm'],
'#description' => t('Only users with the selected permission flag will be able to access this display.'),
'#process' => array('views_process_dependency'),
@@ -1670,6 +1670,7 @@ class views_plugin_display_page extends views_plugin_display {
$bit = array_pop($bits);
// we can't do this if they tried to make the last path bit variable.
+ // @todo: We can validate this.
if ($bit != '%views_arg' && !empty($bits)) {
$default_path = implode('/', $bits);
$items[$default_path] = array(
@@ -1692,9 +1693,9 @@ class views_plugin_display_page extends views_plugin_display {
$items[$default_path]['type'] = MENU_LOCAL_TASK;
break;
}
- }
- if (isset($tab_options['weight'])) {
- $items[$default_path]['weight'] = intval($tab_options['weight']);
+ if (isset($tab_options['weight'])) {
+ $items[$default_path]['weight'] = intval($tab_options['weight']);
+ }
}
}
diff --git a/modules/taxonomy.views.inc b/modules/taxonomy.views.inc
index e18ebea..a6814bc 100644
--- a/modules/taxonomy.views.inc
+++ b/modules/taxonomy.views.inc
@@ -709,7 +709,7 @@ class views_handler_filter_term_node_tid extends views_handler_filter_many_to_on
'#type' => 'radios',
'#title' => t('Vocabulary'),
'#options' => $options,
- '#description' => t('Select which vocabulary to show terms for in the regular options'),
+ '#description' => t('Select which vocabulary to show terms for in the regular options.'),
'#default_value' => $this->options['vid'],
);
@@ -950,7 +950,12 @@ class views_plugin_argument_validate_taxonomy_term extends views_plugin_argument
return empty($test);
case 'name':
case 'convert':
- $result = db_fetch_object(db_query("SELECT td.* FROM {term_data} td LEFT JOIN {term_synonym} ts ON ts.tid = td.tid WHERE td.name = '%s' OR ts.name = '%s'", $argument, $argument));
+ $and = '';
+ if (!empty($vids)) {
+ $and = " AND td.vid IN(" . implode(', ', $vids) . ')';
+ }
+
+ $result = db_fetch_object(db_query("SELECT td.* FROM {term_data} td LEFT JOIN {term_synonym} ts ON ts.tid = td.tid WHERE (td.name = '%s' OR ts.name = '%s')$and", $argument, $argument));
if (!$result) {
return FALSE;
}
@@ -959,7 +964,7 @@ class views_plugin_argument_validate_taxonomy_term extends views_plugin_argument
$this->argument->argument = $result->tid;
}
- return empty($vids) || !empty($vids[$result->vid]);
+ return TRUE;
}
}
}