0

I ran into an issue today where I started getting the following white screen of death error:

PHP Fatal error: Call to undefined function views_include() in /*/sites/all/modules/views/includes/plugins.inc on line 9

I found several various bug reports and questions with similar errors. Some said it was a bug in views, some said it was a bug in VBO, and some reported it being issues with a specific module (like finder) none of which am I really concerned about.

My question is, since most of the solutions had to do with either commenting or uncommenting a particular line. Line 9 in views/views/includes/plugins.inc views_include('base'), what does this line actually do? Furthermore, what is the harm/benefit of having it commented or uncommented?

For my personal part, I was able to comment out the line (which cleared the error) then clear my cache and uncomment the line without the error returning, which seems awfully bizarre.

I the code is generally something with including (libraries/functions?) for views plugins, but further explanation would be much appreciated.

3

From views.module:

/**
 * Include views .inc files as necessary.
 */
function views_include($file) {
  static $used = array();
  if (!isset($used[$file])) {
    require_once './' . drupal_get_path('module', 'views') . "/includes/$file.inc";
  }

  $used[$file] = TRUE;
}

so to your question, it is trying to load up base.inc out of the Views module includes directory. Unfortunately, for whatever reason, the views module itself doesn't appear to be loading up (and thus defining the function to begin with).

2
  • Thanks for the response, but I was really hoping for a bit higher level. "Why is that code there" in other words "what is the harm/benefit of having it commented or uncommented"? – Kara Feb 15 '13 at 14:52
  • This is really beyond my scope, but basically this line is needed to bring in the functions defined in base.inc. Without them, I am assuming Views won't work. However, for whatever reason, the views.module file isn't being loaded on your system, yet the plugins.inc file is. Given that you can comment out the line, clear caches, and put it back in and then things run again fine seems to me to suggest that there is a bug somewhere and should be put in the Views issue queue, not here. IMHO. – Jimajamma Feb 15 '13 at 15:05

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.