There is a similar issue (exact same error) against VBO: #1093818: Fatal error: Call to undefined function views_include() in sites/all/modules/views/includes/plugins.inc on line 9

...but I am not using VBO on the site that this happened. It is reproducible each time:

1. Install latest Views 7.x-3.x and Basic Cart module: http://simplytest.me/project/views/7.x-3.x?add[]=basic_cart
2. Go to the modules page (/admin/modules) and enable Views UI and Basic Cart.
3. Go to the Basic Cart config page (/admin/config/basic_cart/settings): Configuration -> Basic Cart
4. Under the "Content type selection" fieldset, enable the "Add to cart" option for one of the available content types (also tested with new content types - for example "Product" - same results).
5. Save configuration.
6. Go to Structure -> Content types (/admin/structure/types) and select "manage display" for the content type you selected in step 4.
7. Set the format for the "Add to cart" field to "Add to cart button".
8. Save
9. Go to Structure -> Views -> Add new view (/admin/structure/views/add)
10. Give the view a name (for example "Products")
11. Make sure "Show" is set to "Content"
12. From the "of type" drop-down menu select the content type you enabled the "Add to cart" option in step 4
13. Make sure "Create page" is checked.
14. Change the display format from "teasers" to "full posts"
15. (optional) Enable the "Create a menu link" option so you can access the view with ease.
16. Save & exit.
17. Add some content (/node/add) - a couple of nodes of the the type you selected in step 4.
18. Go to the views-generated page (use the menu item if you took step 15 above)
19. Click on any of the "Add to cart" buttons of the listed nodes.

A page with this error is shown:

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

Notes

1. If in step 17 above you add only one node, the "Add to cart" button works properly and there is no error. The fatal happens when there are at least two nodes in the page generated by the view and you click the "Add to cart" button of any of these nodes.

2. I realize that this use case involves a 3rd party module, but in the issue filed against VBO, even after a fix was committed, people report having the issue still. So, I'm guessing this happens for various contrib modules when using views and this needs to be addressed in the root.

Workaround

People in #1093818: Fatal error: Call to undefined function views_include() in sites/all/modules/views/includes/plugins.inc on line 9 have reported that commenting out (or deleting) the views_include('base'); line in \views\includes\plugins.inc solves the issue. I confirm this.

Files: 

Comments

FranCarstens’s picture

Commenting out views_include('base'); works. Question is... what does it break?

bumblebee’s picture

Concerning the basic_cart we currently had the same issue. But we realized that this only happens if you render the Shop Items as Full Nodes in your View.

If the view renders fields, you won't experience this issue and plugins.inc in views module can be kept untouched (no commenting out).

Feels like this has something to do with the Format Settings in views.

These settings seem to work when using basic_cart module (see screenshot).

Hope this helps.

Best,
Christian

Jigar.addweb’s picture

Issue tags: +fatal error, +undefined index
Derimagia’s picture

Yep, right now comments never will display even if you have the module enabled. Added patch here for the unfortunate typo: https://www.drupal.org/node/2879613