We are using Drupal 7.22, Views 3.7 and we just upgraded to CiviCRM 4.3.7.

We use views to expose civicrm contact information in drupal pages. Right after the Civi upgrade all the pages are working fine except one that is showing the following error:

"Fatal error: Call to undefined method stdClass::build_join() in sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1313"

In the log report the error is more specific:

"Notice: Undefined index: relationship in views_plugin_query_default->ensure_table() (line 606 of sites/all/modules/views/plugins/views_plugin_query_default.inc)."

When I edit the views involved in that page in the preview the content is shown perfect and there is no error, the error is just when trying to load the page.

Any ideas!
Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zetxek’s picture

Issue summary: View changes

Any update on the issue? It seems to be happening in the latest version too

michielkenis’s picture

I have exactly the same issue after updating Views 3.11 to 3.14. Any updates?

firoz2456’s picture

Any updates regarding this issue?

MustangGB’s picture

Priority: Critical » Normal

Is this still a problem?

dmudie’s picture

Still getting this: PHP Fatal error: Call to undefined method stdClass::build_join() .../views_plugin_query_default.inc on line 1316
Drupal 7.56
PHP 5.3.3
Views 7.x-3.18

dnmurray’s picture

I ran into this issue today, and the first google hit was this issue. My problem was due to custom code trying to add a join to a view, but not using a `new views_join()` as the initial object. Default is to create a StdClass which was incorrect. It needs to be a views_join object.

MustangGB’s picture

Status: Active » Closed (cannot reproduce)

I'm going to say dnmurray is correct, this looks like either custom code, or another module, not using a views_join() when it should be.

isa.bel’s picture

we are facing this issue after version 3.20, after trying some things, we could solve it by adding isset($table["table"] to views_plugin_query_default.inc
I'm attaching the patch, hope it can be useful to someone else.

isa.bel’s picture

Sorry, wrong name.

isa.bel’s picture

Status: Closed (cannot reproduce) » Needs review
renatog’s picture

Status: Needs review » Reviewed & tested by the community

#9 really looks good to me. Moving to RTBC

renatog’s picture

FileSize
606 bytes

Patch re-rolled

With the same solution of Isabel on #9

DamienMcKenna’s picture

Version: 7.x-3.7 » 7.x-3.x-dev
Status: Reviewed & tested by the community » Needs work

Still tempted to mark this "won't fix" because it's failing because of custom code or another module.

How about we add some logic to specifically catch for the error and throw an exception with a message that explains the problem along with how to fix it?

renatog’s picture

How about we add some logic to specifically catch for the error and throw an exception with a message that explains the problem along with how to fix it?

Totally agree. It really makes sense