diff --git a/handlers/views_handler_filter.inc b/handlers/views_handler_filter.inc index 6aa6476a9fd6008dc3497df3b5c71ecfd6f72505..1a1190ddddfdc6725873d36ab65610ddd258696f 100644 --- a/handlers/views_handler_filter.inc +++ b/handlers/views_handler_filter.inc @@ -218,8 +218,8 @@ class views_handler_filter extends views_handler { $form['expose_button'] = array( '#prefix' => '
', '#suffix' => '
', - // Should always come first - '#weight' => -1000, + // Should always come after the description and the relationship. + '#weight' => -200, ); // Add a checkbox for JS users, which will have behavior attached to it diff --git a/includes/admin.inc b/includes/admin.inc index 18c8f159656b3adc2ad14ff88d1ba5a1ee6b7f62..c70db76321b39273417cb56d59543a79ef6613de 100644 --- a/includes/admin.inc +++ b/includes/admin.inc @@ -4146,7 +4146,7 @@ function views_ui_config_item_form($form, &$form_state) { '#title' => t('Relationship'), '#options' => $relationship_options, '#default_value' => $rel, - '#fieldset' => 'more', + '#weight' => -500, ); } else { diff --git a/includes/handlers.inc b/includes/handlers.inc index 4348e80eb3abfe21502883154806521188f65a12..66373ebc4ce91ea757b824fae2ff5fb067e0a66d 100644 --- a/includes/handlers.inc +++ b/includes/handlers.inc @@ -99,6 +99,8 @@ function views_get_table_join($table, $base_table) { return $handler; } + + vsm_trace(); // DEBUG -- identify missing handlers vpr("Missing join: $table $base_table"); } @@ -158,6 +160,16 @@ class views_handler extends views_object { // Check to see if this handler type is defaulted. Note that // we have to do a lookup because the type is singular but the // option is stored as the plural. + + // If the 'moved to' keyword moved our handler, let's fix that now. + if (isset($this->actual_table)) { + $options['table'] = $this->actual_table; + } + + if (isset($this->actual_field)) { + $options['field'] = $this->actual_field; + } + $types = views_object_types(); $plural = $this->handler_type; if (isset($types[$this->handler_type]['plural'])) { diff --git a/includes/view.inc b/includes/view.inc index 82ca247f28a4fed2ef847789bfa706439b5665d3..80182826578da7fdf27c0b11146da5628cbf9899 100644 --- a/includes/view.inc +++ b/includes/view.inc @@ -308,7 +308,7 @@ class view extends views_db_object { if (empty($this->display[$display_id])) { $display_id = 'default'; if (empty($this->display[$display_id])) { - debug(t('set_display() called with invalid display id @display.', array('@display' => $display_id))); + vpr('set_display() called with invalid display id @display.', array('@display' => $display_id)); return FALSE; } } @@ -597,14 +597,6 @@ class view extends views_db_object { if (!empty($this->built)) { return; } - - // When views are converted automatically the base_table should be renamed - // to have a working query. - $data = views_fetch_data($this->base_table, FALSE); - if (isset($data['moved to'])) { - $this->base_table = $data['moved to']; - } - if (empty($this->current_display) || $display_id) { if (!$this->set_display($display_id)) { diff --git a/modules/comment.views.inc b/modules/comment.views.inc index 30b34916ebfcaa1a6e7058848f359f58b2ec3ca8..82fa612751b7f66264240caec23723d2aa3a9041 100644 --- a/modules/comment.views.inc +++ b/modules/comment.views.inc @@ -17,8 +17,8 @@ function comment_views_data() { $data['comments']['moved to'] = 'comment'; - $data['comments']['body']['moved to'] = array('field_data_comment_body', 'comment_body_value'); - $data['comments']['body']['field']['moved to'] = array('field_data_comment_body', 'comment_body'); + $data['comments']['comment']['moved to'] = array('field_data_comment_body', 'comment_body'); + $data['comments']['comment']['field']['moved to'] = array('field_data_comment_body', 'comment_body'); // Define the base group of this table. Fields that don't // have a group defined will go into this field by default. $data['comment']['table']['group'] = t('Comment'); diff --git a/views.module b/views.module index c7e1f31840303801b46981aeab8714f4908dcfd3..5b6120843264279b7ee9d887680a47cb105927be 100644 --- a/views.module +++ b/views.module @@ -983,11 +983,11 @@ function views_include_handlers($reset = FALSE) { function views_get_handler($table, $field, $key, $override = NULL) { static $recursion_protection = array(); - $data = views_fetch_data($table); + $data = views_fetch_data($table, FALSE); $handler = NULL; // Support old views_data entries conversion. - + // Support conversion on table level. if (isset($data['moved to'])) { $moved = array($data['moved to'], $field); @@ -1000,6 +1000,7 @@ function views_get_handler($table, $field, $key, $override = NULL) { if (isset($data[$field][$key]['moved to'])) { $moved = $data[$field][$key]['moved to']; } + if (isset($data[$field][$key]) || !empty($moved)) { if (!empty($moved)) { list($moved_table, $moved_field) = $moved; @@ -1007,6 +1008,7 @@ function views_get_handler($table, $field, $key, $override = NULL) { // recursion detected! return NULL; } + $recursion_protection[$moved_table][$moved_field] = TRUE; $handler = views_get_handler($moved_table, $moved_field, $key, $override); $recursion_protection = array(); @@ -1276,6 +1278,12 @@ function views_get_view($name, $reset = FALSE) { ctools_include('export'); $view = ctools_export_crud_load('views_view', $name); if ($view) { + // When views are converted automatically the base_table should be renamed + // to have a working query. + $data = views_fetch_data($view->base_table, FALSE); + if (isset($data['moved to'])) { + $view->base_table = $data['moved to']; + } return $view->clone_view(); } }