Drupal 6.22. Code line is
$node = node_load($nid, NULL, TRUE);
error is Fatal error: Call to undefined function node_load() in...

The code is in a php file (not a custom module) in sites/mysite.com on a multi-site installation.

The node module is set to active (1) in the database. I have uploaded a new clean copy of the node module. I have cleared all caches. Caching is on, normal. I have run update.php and cron.php. I have disabled and re-enabled the node module.

Any ideas? Thanks.

Comments

Anonymous’s picture

How are you including your php file into the Drupal system if not in a custom module?

gjmokcb’s picture

Excellent question. Exactly the right question. Thank you. I use small standalone php files to do various things. But I have learned in the past (in the context of users) that those files will not extract the value of user fields. To do that, I must put the code either in a module or in a node. This is exactly the same circumstance. The error msg is a PHP error, not a Drupal error. I need to put any code that calls Drupal functions into a node or a module.

Again, thanks.

gjmokcb’s picture

[deleted]