diff --git a/views.install b/views.install index dd6c8bf9e4531751945decd8b3c7517532a335bb..826d98d3ec08421b7c7977134b2674f734d6f5b1 100644 --- a/views.install +++ b/views.install @@ -35,6 +35,9 @@ function views_schema() { ), 'object' => 'Drupal\views\View', // the callback to load the displays + 'load all callback' => 'views_get_all_views', + 'load callback' => 'views_storage_load', + 'save callback' => 'views_storage_save', 'subrecords callback' => 'views_load_display_records', // the variable that holds enabled/disabled status 'status' => 'views_defaults', diff --git a/views.module b/views.module index 930b100309bd1a3834d1fc3f1e95ac2f3ac32e10..5d13a6317894b6fe12fe828a4007b2aaf26c893e 100644 --- a/views.module +++ b/views.module @@ -1572,8 +1572,28 @@ function views_get_applicable_views($type) { */ function views_get_all_views($reset = FALSE) { // @todo replace with http://drupal.org/node/1741154. - ctools_include('export'); - return ctools_export_crud_load_all('views_view', $reset); + $controller = entity_get_controller('view'); + return $controller->load(); +} + +/** + * Loads a view with the storage controller. + * + * @param string $id + * The view name to load. + * + * @return Drupal\views\View + * The view which is loaded. + */ +function views_storage_load($id) { + $controller = entity_get_controller('view'); + $result = $controller->load(array($id)); + return reset($result); +} + +function views_storage_save(View $view) { + $controller = entity_get_controller('view'); + return $controller->save($view); } /**