Commit e09da08a authored by merlinofchaos's avatar merlinofchaos

#257004: Ensure cache is loaded for exposed filters so that external stuff can...

#257004: Ensure cache is loaded for exposed filters so that external stuff can use cached forms for AJAX calls
parent 726e0a06
......@@ -1329,6 +1329,10 @@ function views_filters($view) {
}
function _views_build_filters_form($view) {
// When the form is retrieved through an AJAX callback, the cache hasn't
// been loaded yet. The cache is necesssary for _views_get_filters().
views_load_cache();
$filters = _views_get_filters();
foreach ($view->exposed_filter as $count => $expose) {
$id = $expose['id'];
......
......@@ -77,13 +77,13 @@ function _views_get_tables($full = false) {
}
else {
$table_data = module_invoke_all('views_tables');
// allow modules to alter the definitions supplied others
foreach (module_implements('views_tables_alter') as $module) {
$function = $module . '_views_tables_alter';
$function($table_data);
}
$views_tables['tables'] = $table_data;
foreach ($table_data as $name => $table) {
......@@ -99,7 +99,15 @@ function _views_get_tables($full = false) {
$data['option'] = array('#type' => 'select', '#options' => $data['option']);
}
}
if ($data['list']) {
if ($data['value'] && !is_array($data['value'])) {
if ($data['value'] == 'string' || $data['value'] == 'integer') {
$data['value'] = array('#type' => 'textfield', '#size' => 10, '#maxlength' => 255);
}
else {
$data['value'] = array('#type' => 'select', '#values' => $data['value']);
}
}
else if ($data['list']) {
$data['value'] = array('#type' => 'select', '#options' => $data['list'], '#validate' => array('views_filter_validate_array' => array($data['name'])));
if ($data['list-type'] != 'select') {
$data['value']['#multiple'] = TRUE;
......
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