Views attached has been working fine. This week I updated the Views Module and right after updating I got the error message.

I had to go back to the old version of Views and the problem was solved. I have tried many times and it always happens when trying to get the latest version of Views.

Is views_attached incompatible with the new views? Is the fix coming any soon?

Many Thanks

Comments

Crell’s picture

Status: Active » Postponed (maintainer needs more info)

What (exact) version of Views did you update to? views_include() is a fairly core function and I can't believe that API would change...

No one else has reported an issue so I assume it's an issue with caching or module ordering or something like that rather than a bug in views_attach itself.

Also please paste in the complete error you're getting, including the file and line number.

Dave Reid’s picture

Make sure you run update.php.

Lubas’s picture

I've got the same issue..
I ran update.php (twice).. It doesn't change anything

Fatal error: Call to undefined function views_include() in /Applications/MAMP/htdocs/*/sites/all/modules/views_attach/views_attach.module on line 188

eaton’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

This isn't something any of us seem to be able to reproduce - views_include() is a core function of the views module, and if it can't be found, Views itself is not loading correctly.

kr8tiv1’s picture

I've got the same error after migrating my site from a Acquia Drupal stack install to a non-Acquia Drupal install. The Acquia stack installer includes Views. I suspect there is a difference between Acquia's version of views and the plain vanilla views which is causing a conflict plain vanilla views_attach module.

Fatal error: Call to undefined function views_include() in */sites/all/modules/views_attach/views_attach.module on line 188

kr8tiv1’s picture

My assumption was partially correct. It's related to the Acquia Stack Installer. It places a folder called "acquia" in the global Modules folder. I suspect there are other Drupal install customizations to the Acquia stack installer. I'll have fun duck hunting :-(

AntiNSA’s picture

Im receiving this too...

gcassie’s picture

I ran into this on a site recently. As a workaround, I disabled views_attach, ran the database updates, and re-enabled views_attach - site recovered.

asb’s picture

Status: Closed (cannot reproduce) » Active

Similar issue here when updating to Views 3: Only the administrative pages remain accessible, the normal pages give a WSOD. From Apache's error.log:

[Sat Apr 21 20:18:45 2012] [error] [client 12.34.56.78] PHP Fatal error:  Call to undefined function views_include() in /var/www/drupal/sites/all/modules/views_attach/views_attach.module on line 188

The code around line 188 is:

function views_attach_get_node_views($type, $mode = NULL) {

  static $used_views = array();

  if (empty($used_views)) {
    views_include('cache');
    $cache = views_cache_get("views_attach:nodes");
    if (isset($cache->data)) {
      $used_views = $cache->data;
    }
[...]

The update was run through drush, and running update.php didn't throw any errors. After the update, the site is just dead.

The approach from #8 does not fix the issue for me; disabling 'views_attach' still results in a WSOD, but now points to several core modules:

[Sat Apr 21 20:20:51 2012] [error] [client 12.34.56.78] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/drupal/includes/common.inc on line 2575
[Sat Apr 21 20:22:16 2012] [error] [client 12.34.56.78] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/drupal/includes/theme.inc on line 206, referer: http://.../update.php?op=results
[Sat Apr 21 20:30:18 2012] [error] [client 12.34.56.78] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/drupal/modules/node/node.module on line 454

As it seems, the 'views_attach' related error might be just indicate for a symptom for something deeper, or the data structures created by 'views_attach' break something when the module isn't active. This might explain why it is so hard to provide a procedure to reproduce the issue (I successfully completed two updates to Views 3 on sites with 'views_attach').

I can not debug stuff like this; please suggest a more appropriate issue queue for this chain of "PHP Fatal errors" (it might not be the Views issue queue since none of the errors point to Views, and it might not be a core module since it is improbable that multiple core modules are affected at once by a not-yet-known bug). However, if views_include() is a core function of Views, this issue probably best fits to the Views issue queue.

The only "workaround" for this issue is to not use Views 3 - downgrading to views-6.x-2.16 immediately restores the site.

Any suggestions are greatly appreciated!

danielb’s picture

The solution is to uncomment a line at the top of views/includes/plugins.inc

views_include('base');

I have no idea what's going on and why that is commented out

bgogoi’s picture

1. removed the views_atatch module from module folder
2. run update - it worked worked
3. uploaded views_attach module again
4. run update again
it worked.