My site was okay, then I did the 6.x-2.4 views update and now I get a white screen with the following error message:

Fatal error: Cannot access empty property in /home/thindig5/public_html/kzoocpcl/modules/views/modules/node.views.inc on line 670

I don't know what the exact protocol for updating a module is, but I always just upload the new files to my server and then run the database update. For this instance, I uploaded the files to the server and then got this error when trying to access any page on the website (kzoocpcl.org to see error in action). Thanks.

Comments

yched’s picture

Try rebuilding your theme registry by visiting admin/build/modules

davedg629’s picture

Thanks for the suggestion. When I visit that path I get the same error. It seems like the only pages I can access are "page not found" pages. Anything with any kind of content gives me the fatal error.

yched’s picture

Hm. Maybe try directly truncating the cache table in your db ?

davedg629’s picture

Status: Active » Fixed

Yup that worked, for anyone else who's having the same problem, doesn't know much about databases, and uses phpmyadmin: truncate is the same as 'empty' in phpmyadmin.

Thanks a ton!

amysragbag’s picture

Hi Dave, Thanks for the explanation. It looks like this is what I'm going to have to do, but I'm scared. Does 'empty' mean I will lose data?

amysragbag’s picture

I did it, and it worked! Thanks so much.

yched’s picture

Also, Views 2.4 has (unrelated) update functions. Drupal caches get rebuilt at the end of the update process, so unless I'm mistaken, if you are getting a WSOD (and *if* stale theme registry is indeed the explanation of the WSODs a few people reported here and there), it means you didn't run update.php after uploading the new code as you're supposed to...

mrgoltra’s picture

is this the cache table or the cache view table?

mrgoltra’s picture

I tried the suggestion above. I just get a WSOD and when I access the view and view edit page just a WS. I don't get any fatal error messages on the screen. Checked logs no entry relating to this issue.

yched’s picture

mrgoltra : I meant the "cache' table. It was a workaround solution for davedg629, though. What you need to do is make sure you ran all the pending updates on update.php.

mrgoltra’s picture

Thank you very much, I tried the suggestion but still a white screen.

yched’s picture

mrgoltra : Then maybe what you are experiencing is something different and unrelated. Unfortunately, little can be said about a a WSOD alone, unless you can provide a more specific error message, either from the watchdog, or from your PHP error log...

mrgoltra’s picture

not a problem. I will do some more troubleshooting. thanks.

mrgoltra’s picture

well I finally managed to update I just had to recreate one view that was getting WSOD. Thank you everyone.

pratyush’s picture

yes..it worked, i just emptied the cache table and site working good. thanks

binhcan’s picture

Thanks from me too. It worked for me after I try to go to admin and clear all caches.

luckysmack’s picture

Status: Fixed » Active

I am having the same issue as the original poster. But i did not upgrade to the newer version of views as i have had it since it was released. clearing caches (both from drush and phpmyadmin) and running update.php (from drush as i was unable to run it from the browser at /update.php).

I did disable all my views modules and ctools and i was able to get my site back. I deleted the views folder and put in a fresh copy, ran update from drush (after enabling the views modules) and i got the same errors. Tried clearing caches again but no problem. It seems as I may need to uninstall and rebuild all my views from scratch which will suck but will hopefully fix the issue. I only had 3 views so it shouldn't be too bad.

Now that I am back into my site, this is the error i received:

call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'views_access' was given in /home/public_html/d6/public/includes/menu.inc on line 452

and the original error for reverence:

Fatal error: Cannot access empty property in /home/public_html/d6/public/modules/acquia/views/modules/node.views.inc on line 670

any help is greatly appreciated. also, since i use drush i was looking at drush_views to try and export them but it doesnt seem to work with the newer drush-3.x. If anyone knows how I could do this it would help as well. I did export my DB during this so I am able to help try to debug and fix it (loaded it onto a dev subsite) if I havent been able to rebuild my views yet and so I can help try and figure out this bug.

Thanks

winnie80’s picture

i also experience the same problem too

i don't really understand why but the problem originated from line 670 within node.views.inc like you said
which is: $nid = $vars['row']->{$vars['field_alias']};

after i take a look into $vars return value, i change it into $nid = $vars['row']->nid;
after that my page run smoothly, without any fatal error or wsod

but know the question is this the right adjustment to node.views.inc?
at least for me it's a temporary solution

any suggestion or answer to this issue?

thanks

kyle_mathews’s picture

I had the same problem -- this comment fixed it for me, deleting the date module folder and reinstalling it:
http://drupal.org/node/349105#comment-1471972

sillygwailo’s picture

Version: 6.x-2.4 » 6.x-2.5

I'm getting this too with a couple of my views: one is a view that shows an entire book outline and another is a Gmap view. I tried re-installing the Date module but I don't even use Date in those views. I've cleared the cache several times, and I'm still getting the same error.

If it matters, the error does not occur on in the feed display of the view. Bumping up the version number since I'm running 2.5.

dadderley’s picture

I am having the same problem after updating to 6.x-2.5
This is only affecting a gmap view.

I had this problem earlier in the day and de-installed and went to my back up.
I am going from 6.x-2.3 to 6.x-2.5.

This has nothing to do with the date module and flushing the cache table has no effect on it either.
I am using the views_attach module as well, but it does not seem to be a factor.

Junro’s picture

same problem, clear cache seems to work, but i(ve got another problems upgrading 2.5 version.

sillygwailo’s picture

winnie80's solution (if temporary?) works for me, though I do run out of memory in bigger views. Attached is a patch based on the proposed fix, applying to 2.5.

merlinofchaos’s picture

Status: Active » Needs review

Patches need to be marked or they disappear in the sea.

merlinofchaos’s picture

Status: Needs review » Needs work

Ok, that patch is not relationship safe. The field may not always be called 'nid'. It doesn't fix the problem correctly.

eric_a’s picture

Version: 6.x-2.5 » 6.x-2.6

In 2.6 it's line 784... devel/cache/clear "fixed" the problem.

Cannot access empty property in /.../sites/all/modules/views/modules/node.views.inc on line 784

dadderley’s picture

This is killing me.
I try to update from views-6.x-2.3 to views-6.x-2.6 and I get this when I run the update

The following queries were executed
views module
Update #6003
Failed: ALTER TABLE {views_view} ADD UNIQUE KEY name (name)
Update #6004
ALTER TABLE {views_object_cache} DROP data
ALTER TABLE {views_object_cache} ADD `data` LONGTEXT DEFAULT NULL
Update #6005
ALTER TABLE {views_view} CHANGE base_table `base_table` VARCHAR(64) NOT NULL DEFAULT ''
Update #6006
Failed: CREATE TABLE {cache_views_data} ( `cid` VARCHAR(255) NOT NULL DEFAULT '', `data` LONGBLOB DEFAULT NULL, `expire` INT NOT NULL DEFAULT 0, `created` INT NOT NULL DEFAULT 0, `headers` TEXT DEFAULT NULL, `serialized` SMALLINT NOT NULL DEFAULT 1, PRIMARY KEY (cid), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

Then I get the WSOD with this error:
Fatal error: Cannot access empty property in /home/xxxxx/yyyyyyyyyy.net/sites/all/modules/views/modules/node.views.inc on line 784

I have tried everything that I can think of but all fails.
Is there a solution out there?

dadderley’s picture

OK,
I de-installed views-6.x-2.3 and installed views-6.x-2.6. I am rebuilding my views. I can live with this.
But the dreaded error:
Fatal error: Cannot access empty property in /home/xxxxx/yyyyyyyyyy.net/sites/all/modules/views/modules/node.views.inc on line 784

Is still there, but at least I know what is causing it now.

First off, I have a view where I have Row style: Fields, this works in all view styles including gmap.

Then I change it so that Row style: Node, this works in all view styles except gmap. Here I get the WSOD and the above error message.

this is the code that the error points to node.views.inc on line 784

function template_preprocess_views_view_row_node(&$vars) {
  $options = $vars['options'];

  // Make sure the variables are defined.
  $vars['node'] = '';
  $vars['comments'] = '';
/**
*below is line 784
 */
  $nid = $vars['row']->{$vars['field_alias']};
  if (!is_numeric($nid)) {
    return;
  }

  $node = node_load($nid);

  if (empty($node)) {
    return;
  }

I actually need to show the full node as it shows an attached view, showing the node body as a field does not work. I had this working beautifully in views-6.x-2.3 but alas in views-6.x-2.6 this functionality is borked.
Here is a working example: http://www.suncountry.myenergymatters.net/energy-renewal-program/project...

ore’s picture

subscribing

techninja’s picture

Same problem as #28. Imported a view from a views 6.x-2.3 site with the same modules, view has three displays (Default, Page & Attachment). The Default display previews perfectly! ...but when previewing or viewing, WSOD and AJAX calls fail with
Fatal error: Cannot access empty property in /sites/all/modules/views/modules/node.views.inc on line 784

I've cleared the caches multiple times, truncated all the cache tables by hand, deleted & re-imported the view, ran upgrade.php and many other combination of the same to no avail.

Any ideas?

Elehas’s picture

**Updated

Ok so back in July I originally posted this:

"On line 674, change to $nid = $vars['row']->nid;

this resolved the issue!"

It's March 2010, and I'm working on a site that received the same error. After researching I come to this thread and come across my own post (completely forgot)! For anyone receiving this error, use this fix..it worked for the second time! Only thing is my typo..it's line 784.

Weird..

j0k3z’s picture

I have the same issue. It happened when I changed the row style to nodes instead of fields.

I was told you need to change row style to nodes if you want to show a nodes teaser using contemplate so Im hoping to figure this out soon.

Vahalaman’s picture

I have this same issue. Anyone find a solution to this?

the fatman’s picture

Subscribe

Dru’s picture

Had the same problem, used a similar solution to winnie80's one, but I checked if there is a value where the Views module looks for it first, and only if one doesnt exist use winnie80's solution.

Code:
Replace this line -
$nid = $vars['row']->{$vars['field_alias']};

With -
if(!empty($vars['row']->{$vars['field_alias']}))
$nid = $vars['row']->{$vars['field_alias']};
else
$nid = $vars['row']->nid;

This is on different line numbers in different versions, but it seems like the solution works in the latest and the previosu version (just go to the line the error shows in)

ryanhunt’s picture

I am getting the same error in my Organic Groups (og) group pages.

Does anyone know if this is going to be patched in an official release, or if we just need to keep track of the fact we have patched it ourselves and re-implement the patch on each upgrade?

merlinofchaos’s picture

Patches marked 'needs work' need work and are therefore not going to be committed. I explained, above, why this can't be committed.

ryanhunt’s picture

So how does that work then.

This patch fixes the problem. But it can't be officialized because it might break in the future?

I am not sure what relationship safe means... Can you help me out. Just trying to understand the process.

merlinofchaos’s picture

Sure. 'relationship safe' means that field names can be arbitrary and change. Let's say I have a 'node' view and I add a 'nodereference' relationship. I then set the style to utilize the relationship.

$result->nid points to the original node, not the referenced node. Thus, not 'relationship safe'. The rule is that you can never refer directly to a field by what you think the alias will be, because the query object is free to change that alias as it needs to in order to prevent collisions. Sure, the field might be named 'nid' today, but tomorrow it might be named 'pink_elephant' because the query object got drunk, I suppose. (I realize the example is ridiculous, but ridiculous as it is, it's a good way to demonstrate it; always assume that your field might be named pink_elephant and you'll never have a problem again =)

The problem here is that, for no readily apparent reason, the field alias isn't getting set in the aliases array. Since I've never been able to duplicate this problem on my system, I don't know why that might be.

dadderley’s picture

This is in reference to my comment up the page @ http://drupal.org/node/428206#comment-1783384

On a clean install I have Views 6.x-2.8 and GMap Module 6.x-1.x-dev (2009-Dec-01) installed.
The particular problem that I described above seems to be fixed.
I can once again use "Row style: Node" for my map displays.

I am happy. Thanks

dawehner’s picture

Status: Needs work » Postponed (maintainer needs more info)

Is this still the case with 2.11?

There were some patches in this direction.

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No updates for more than 30 days.