1

I have a default view made using the views hook hook_views_default_views().

It was working right and when I updated to Views 7.x-3.8 it stopped working.

It is not shown in structure -> views, the routes don't work too (site_url/calendar)

Seems the hook is not launching, or if it is, it does not load the view.

Updated drupal to 7.31 version, and CTools to 7.x-1.4.

Erased all the caches, drupal, views, memcached.

And it is not working.

The code looks like this:

// code included in my_module.views_default.inc
function my_module_views_default_views() 
{
  export = array();
  $view = new view();
  $view->name = 'planning_calendar';
  $view->description = 'Calendar with planning dates';
  $view->tag = 'Calendar';
  $view->base_table = 'node_revision';
  $view->human_name = 'Planning Calendar';
  $view->core = 7;
  $view->api_version = '3.8';
  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

  // view code ......

  $export[$view->name] = $view;
  return $export;
}

There is also this hook on the module:

// code included in my_module.module
function my_module_views_api() {
  return array("api" => "3.8");
}
5

See the API documentation: The correct way to declare the version is by the major number only (i.e. an integer) not the entire version as a string.

// code included in my_module.module
function my_module_views_api() {
  return array('api' => 3);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.