I see this message when upgrading from D6 to D7. The update script ran just fine, the site functions, but there are three instances of the following error message on every page:

Notice: Use of undefined constant user - assumed 'user' in eval() (line 2 of /Users/sean/dev/icateens_dev/modules/php/php.module(74) : eval()'d code).

Any ideas? Searches didn't turn up much.

Comments

heine’s picture

It is likely you have a block containing PHP code on those pages where you used a bare string. Check your blocks.

seaneffel’s picture

I've disabled all the blocks except the main content one, those three errors still come up.

nathan tsai’s picture

Worked for me!

seaneffel’s picture

Going to report a proper issue so this gets noticed. Here:

http://drupal.org/node/1430866

heine’s picture

Go edit the php module and add a

drupal_set_message(check_plain(print_r(debug_backtrace(), TRUE)));

just before the eval. This allows you to see the call stack. Wrap in access control (eg check $GLOBALS['user']->uid == 1).

If you can't figure out the problem with this, paste the callstack here.

navi85sin’s picture

Where to edit and put the above line in php module.
I have used the php filter option so i cant disable it.

rmcom’s picture

This happens because in your PHP code you wrote user instead of 'user' ... that's it: add the single quotes on each side and the problem is fixed.