While working in a nearly fresh install of Drupal 7 I'm encountering these errors:

    * Notice: Undefined variable: node in eval() (regel 3 van /var/www/vhosts/vandemaele.be/httpdocs/modules/php/php.module(75) : eval()'d code).
    * Notice: Trying to get property of non-object in eval() (regel 3 van /var/www/vhosts/vandemaele.be/httpdocs/modules/php/php.module(75) : eval()'d code).

The closest match with an already mentionned issue is this post in the topic "Deleting a content type leaves orphaned fields". As I deleted the two default content types of D7 indeed, I thought applying the patch mentionned in the related topic ("Deleting node type with only instance of a field leaves the field in a strange zombie state") would solve the problem, but unfortunately it didn't. The patching-process returned this message in Terminal:

patching file field.crud.inc
Reversed (or previously applied) patch detected!  Assume -R? [n] 

So the patch didn't resolve the issue since the file is already modified since the build of dec. 15th 2010 (using the D7 version of jan. 5th 2011 atm).

The error persists though.

I've disabled modules like "Translation management", and "Chaos Tools" (the only two relevant modules on my install afaik). No result.

I'm also using the Omega 960-theme, but switching to a default theme (like "Stark") results in the same error.

I'm out of ideas. Does someone have an idea what else could be the issue?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

knalstaaf’s picture

Category: support » bug
Status: Fixed » Active

Another thing: the website will officially be located at domain.com (as mentionned in the error, but there's a plain html site there atm), but is currently located at subdomain.domain.com. If this could be of any relevance, is there a way I can solve this error without publishing the website at its future destination?

Morbus Iff’s picture

Category: bug » support

You're using the php.module, which suggests you've got some PHP custom code you've written somewhere. Based on the
error message, I'd say some of your PHP custom code is attempting to use $node at a time when $node isn't defined.

knalstaaf’s picture

That was the cheeky bugger that caused all the trouble indeed, thanks!

I was using this code in a block:

<?php
  print render($content['field_company_image']);
?>

This doesn't work in a block apparently. What if I need to render this image in the page.tpl.php (this code doesn't work in page.tpl.php either, only in node.tpl.php)?

Kars-T’s picture

Status: Active » Fixed

Dear fellow Drupal enthusiasts,

this issue is now lasting for a very long time in the issue queue and was unfortunately never solved. As Drupal is a open source project everyone is helping on voluntary basis. So that this is was not solved is nothing personal and means no harm. But perhaps no one had time to deal with this issue, maybe it is too complex or did not pose the problem comprehensible.

But this issue is not the only one. There are thousands of issues on Drupal.org that have never been worked on or could not be processed. This means that we are building a wave that is unmanageable and just a problem for the Drupal project as a whole. Please help us keep the issue queue smaller and more manageable.

Please read again, "Making an issue report" and see if you can improve the issue. Test the problem with the current Core and modules. Maybe the problem doesn't exist anymore, is a duplicate or has even been solved within this issue but never closed.

Help can also be found for it on IRC and in the user groups.

In order this issue no longer remains, I put this issue to "fixed".

If there is new information, please re-open the issue.

Category: bug » support
Status: Active » Closed (fixed)
Issue tags: -eval, -node in eval, -property of non-object

Automatically closed -- issue fixed for 2 weeks with no activity.

Rohit_Rajput’s picture

Notice: Trying to get property of non-object in eval() (line 2 of /home/projectname/public_html/modules/php/php.module(80) : eval()'d code).

I'm using views the output on the page is correct, but I still get the following error: