Just a heads up...

When I click on DB Tuner from my admin panel, I get the WSOD. My error_log shows the following:

PHP Fatal error: Call to a member function get_option() on a non-object in /var/www/html/modules/views/includes/view.inc on line 1904, referer: http://www.svherald.com/admin

Comments

mikeytown2’s picture

Title: Call to a member function get_option() » Call to a member function get_option() on a non-object in views/includes/view.inc on line 1904

My guess in terms of the flow for this error to occur

function dbtuner_views_filters_relationshps() {
  $results = db_query("SELECT id, name FROM {views_display} INNER JOIN {views_view} USING (vid)");
  $indexes = array();
  while ($row = db_fetch_array($results)) {
    // Load View
    $view = views_get_view($row['name']);
    $filters = $view->get_items('filter', $row['id']);
    $relationships = $view->get_items('relationship', $row['id']);
...
  function get_items($type, $display_id = NULL) {
    $this->set_display($display_id);

    if (!isset($display_id)) {
      $display_id = $this->current_display;
    }

    // Get info about the types so we can get the right data.
    $types = views_object_types();
    return $this->display[$display_id]->handler->get_option($types[$type]['plural']);
  }

Looking at this it seems like you have a bad view. Can you give me any more details? Any idea on what view could be causing this? Have you tried the latest dev version of views to see if it still occurs with it?
http://drupal.org/node/95897 2.x
OR
http://drupal.org/node/467670 3.x

My guess is an invalid display_id

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

see if this fixes the error

djudd’s picture

Tried the patch, no luck there. Thanks for the effort though.

I am running the latest dev for views. It seems you are correct, this has to be a bad view somewhere, I'm just not even sure how to begin finding it.

mikeytown2’s picture

StatusFileSize
new1.23 KB

try this

djudd’s picture

Still no luck mikeytown2. I do appreciate the effort, but I'm thinking this has to be something on my end going buggy.

mikeytown2’s picture

Project: DB Tuner » Views (for Drupal 7)
Version: 6.x-1.0-alpha2 » 6.x-2.x-dev
Component: Code » Views Data
Status: Needs review » Active

I'm going to see if anyone on the views issue queue might have any ideas for this.

mikeytown2’s picture

Project: Views (for Drupal 7) » DB Tuner
Version: 6.x-2.x-dev » 6.x-1.x-dev
Component: Views Data » Code

Taking it back for now...

adam_c’s picture

Im experincing the same problem...

adam_c’s picture

how would you attempt to debug this, is there any exception handling that could be put into the code to notify the user which view is causing the problem?

adam_c’s picture

Actually after rolling the patch in #4 its telling me that every single one of my views is broken.

This is a very of problem as all of the views i use work fine.

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new1.76 KB

This is impossible for me to debug since I have never had this error before. Best I can do is guess, so here is another guess.

webwriter’s picture

Subscribe. Same error.

mikeytown2’s picture

@webwriter
Any did you try the patch at #11?

webwriter’s picture

Hi mikeytown2-

When patched I get this:

Parse error: syntax error, unexpected '}' in /home/domain/public_html/sites/all/modules/dbtuner/dbtuner.admin.inc on line 451

mikeytown2’s picture

StatusFileSize
new1.74 KB

looks like i forgot 2 semicolons

dmiric’s picture

Subscribe. Same error. Last patch didnt help I patched last dev version and the error is

Fatal error: Call to a member function get_option() on a non-object in /home/********sites/all/modules/dbtuner/dbtuner.admin.inc on line 497

that is

$view->display[$row['id']]->handler->get_option($types['filter']['plural']);

mikeytown2’s picture

StatusFileSize
new3.46 KB

looking at this
http://stackoverflow.com/questions/277224/how-do-i-catch-a-php-fatal-error

This is some nutty code. try this patch please and let me know if it outputs the offending views name. If it does, can you lookup the view and tell if something is wrong with that view?

samgreco’s picture

Had the same issue. Last patch fixed it. Thanks.

mikeytown2’s picture

@samgreco
Did you get the view that threw the error? If so; can you look into it and see if something is broken in it?

chrisada’s picture

I am getting the same error using 6.x-1.x-dev with Views 6.x-2.11.

Since this issue persist with both stable and dev version of views, I think it's better to debug this against stable?

TallDavid’s picture

Fatal error: Call to a member function get_option() on a non-object in .../modules/views/includes/view.inc on line 1924

Same error on multiple sites. Does not occur when Engines or Collation is selected/used, but, occurs when the Indexes tab is selected. Versions for one site:

  • Drupal 6.19
  • DB Tuner 6.x-1.x-dev (2010-Aug-16)
  • Views 6.x-2.11

Note to self: az.o

omega8cc’s picture

WSOD here is an almost 100% sign you have some really bad view(s) used.

To debug this I would recommend to clone the site and then disable/remove views one by one until there is no more WSOD.

BTW: I have found DB Tuner as a very good tool to discover views related issues which can cause some too heavy/slow queries and needs to be debugged anyway.

jean84’s picture

i get it with the development version too

jean84’s picture

i disable

Default Node view: apk_user_posts (Advanced Profile Kit) Enable
Title: Topics participated in
Path: user/%/posts
Page Module: advanced_profile; Shows topics started by or commented on by a given user.
Default Comment view: apk_user_replies (Advanced Profile Kit) Enable
Path: user/%/comments
Page Module: advanced_profile; Comments by a given user
Default Node view: apk_user_topics (Advanced Profile Kit) Enable
Title: Topics started by user
Path: user/%/topics
Page Module: advanced_profile; Shows topics by a given user.

after this its working again. but i am not sure if my apk is installed propper because i allready had problems.

mikeytown2’s picture

Bug related to this one #1001542: $view->set_display($display_id); returns TRUE for displays that do not exist.
The code in DB Tuner doesn't check the return value of set_display(), something to do in the future. As of right now I have a workaround

if (empty($view->display[$display_id])) {
  continue;
}

Will work on patch soon.

mikeytown2’s picture

StatusFileSize
new885 bytes
mikeytown2’s picture

committed the change; not sure if this will fix it. If someone can repo this would you mind testing the latest dev when it comes out in a couple of hrs?

spazfox’s picture

I'm receiving the same error (on line 1924) using the latest dev. Just like #21, I can access the other settings but not Indexes. My error log spits out this error message 15 times:

"Division by zero in /mysite/sites/all/modules/dbtuner/dbtuner.mysqltuner.inc(84) : eval()'d code on line 1."

mikeytown2’s picture

@spazfox
try it with the latest dev of views. http://drupal.org/node/95897 That should fix the 1924 error.

spazfox’s picture

Just upgraded to the latest dev of views, but am getting the same error (but now on line 2015):

Fatal error: Call to a member function get_option() on a non-object in /home/mysite/sites/all/modules/views/includes/view.inc on line 2015

Anything else I should try?

mikeytown2’s picture

Status: Needs review » Needs work

hmm... I'll dig around more; was kinda hoping #1001542: $view->set_display($display_id); returns TRUE for displays that do not exist. would fix it.

dalin’s picture

Can you do something kinda like:

try{
  // Analyze view here.
}
catch{
  drupal_set_message(t('The %name view is fubar and cannot be analyzed.', array('%name' => $name)), 'error');
} 
mikeytown2’s picture

#17 is a patch to catch fatal errors and report what went wrong.

marta_yo’s picture

suscribe

Footeuz’s picture

I think i've found where the problem come from.
It's from the view apk_user_posts.
For the display 'panel_pane_1' you must have the module "Views content panes" activated.
And if not there is a fatal error.

It's as simple as that !!!

Anonymous’s picture

subscribe

xeraseth’s picture

@ #35, I have Views Content Panes module activated and I still get the error

xeraseth’s picture

The patch at #17 worked for me, it displayed which view was not working. The view that wasn't working was "image-gallery" which the description says "The default gallery of image nodes from Image gallery module." but I don't ever think I installed the Image module (which is what the Image Gallery Module comes from). When viewing the display that is reported as wrong it says "Error: Display image_gallery_1 refers to a plugin named 'image_gallery', but that plugin doesn't exist!"

I deleted this view and the error disappeared on the index screen

something I wasn't sure on and isn't really an issue is the error message displayed by the patch is green, I would think it should be red (but this is neither here nor there, just wasn't sure if you wanted it to be green)

broncomania’s picture

The #17 worked for me also. The module is now running perfectly for me. Thx and please update the module to next alpha stage with this patch, because without this patch I only see a wsod page like the others here.

Thx for your work

NoUseFreak’s picture

Subscribe. Same error.

K.MacKenzie’s picture

I am still getting this error with the latest dev version.

tobiberlin’s picture

I get the same error in latest alpha-version referring to line 1995 in sites/all/modules/views/includes/view.inc

mikeytown2’s picture

For people with this issue; give this module a shot http://drupal.org/project/views_maintenance
"It helps you to detect unused and broken displays to modify them or completely remove from your site."

rhawkins’s picture

I had a comment here about having the same error in D7, but it turned out I was still trying to load a display I had deleted.

southpolekat’s picture

I got the same error today in D7 after I modified the machine name of the display.

skessler’s picture

I have this issue in D7 as well when I try and recreate a Feature that I have all my views in. I have made *many* changes in it. I am seeing some other views pieces show that they are missing but they are on the site I made the Feature from.

Thanks,
Steve

steinmb’s picture

Status: Needs work » Closed (won't fix)

Suggest this issue get closed. More then one module extending how views is used might experience this if one or more of the views are corrupt. Fixing/removing those views normally take care of this.