Skip to content
Snippets Groups Projects
Commit 93cbe5c4 authored by Tim Plunkett's avatar Tim Plunkett
Browse files

Remove legacy code for default Views and exportables.

parent f4805c6b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -92,10 +92,6 @@ public function test_views_trim_text() { ...@@ -92,10 +92,6 @@ public function test_views_trim_text() {
* Tests the dynamic includes of templates via module feature. * Tests the dynamic includes of templates via module feature.
*/ */
function testModuleTemplates() { function testModuleTemplates() {
$views_status = variable_get('views_defaults', array());
$views_status['frontpage'] = FALSE; // false is enabled
variable_set('views_defaults', $views_status);
$existing = array(); $existing = array();
$type = array(); $type = array();
$theme = array(); $theme = array();
......
...@@ -25,7 +25,6 @@ protected function setUp() { ...@@ -25,7 +25,6 @@ protected function setUp() {
// @todo Remove this hack or move it to child classes. // @todo Remove this hack or move it to child classes.
views_init(); views_init();
views_module_include('views_default', TRUE);
views_get_all_views(TRUE); views_get_all_views(TRUE);
menu_router_rebuild(); menu_router_rebuild();
} }
......
...@@ -24,15 +24,8 @@ function views_schema() { ...@@ -24,15 +24,8 @@ function views_schema() {
'identifier' => 'view', 'identifier' => 'view',
'bulk export' => TRUE, 'bulk export' => TRUE,
'primary key' => 'vid', 'primary key' => 'vid',
'default hook' => 'views_default_views',
'admin_title' => 'human_name', 'admin_title' => 'human_name',
'admin_description' => 'description', 'admin_description' => 'description',
'api' => array(
'owner' => 'views',
'api' => 'views_default',
'minimum_version' => '2',
'current_version' => '3.0',
),
'object' => 'Drupal\views\View', 'object' => 'Drupal\views\View',
'load all callback' => 'views_get_all_views', 'load all callback' => 'views_get_all_views',
'load callback' => 'views_storage_load', 'load callback' => 'views_storage_load',
......
...@@ -2374,45 +2374,6 @@ function views_clean_css_identifier($identifier, $filter = array(' ' => '-', '/' ...@@ -2374,45 +2374,6 @@ function views_clean_css_identifier($identifier, $filter = array(' ' => '-', '/'
return $identifier; return $identifier;
} }
/**
* Implement hook_views_exportables().
*/
function views_views_exportables($op = 'list', $views = NULL, $name = 'foo') {
$all_views = views_get_all_views();
if ($op == 'list') {
foreach ($all_views as $name => $view) {
// in list, $views is a list of tags.
if (empty($views) || in_array($view->tag, $views)) {
$return[$name] = array(
'name' => check_plain($name),
'desc' => check_plain($view->description),
'tag' => check_plain($view->tag)
);
}
}
return $return;
}
if ($op == 'export') {
$code = "/**\n";
$code .= " * Implement hook_views_default_views().\n";
$code .= " */\n";
$code .= "function " . $name . "_views_default_views() {\n";
foreach ($views as $view => $truth) {
$code .= " /*\n";
$code .= " * View " . var_export($all_views[$view]->name, TRUE) . "\n";
$code .= " */\n";
$code .= $all_views[$view]->export(' ');
$code .= ' $views[$view->name] = $view;' . "\n\n";
}
$code .= " return \$views;\n";
$code .= "}\n";
return $code;
}
}
/** /**
* #process callback to see if we need to check_plain() the options. * #process callback to see if we need to check_plain() the options.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment