Visiting the Drupal path track/add results in this error message:

Fatal error: Call to undefined function node_add() in /home/drupal/sites6/any/modules/_geo/track/track.module on line 25

My guess is that it's an issue with 5.x to 6.x upgrades. I found these two things in the module upgrade notes that seem related:
http://drupal.org/node/114774#module_load_include
http://drupal.org/node/114774#node_add_summary

Comments

aubreymoore’s picture

I get the same error when I click on "Track list | Track upload" on the Navigation menu. Apparently, this menu item calls the wrong URL: "track/add".

I fixed the problem on my site by disabling the ""Track upload" menu item and creating a new one to replace it. My new menu item is "Upload a track" and this calls the URL "node/add/track".

gadzuk’s picture

Confirmed bug, thanks!

emorling’s picture

It appears the function does not exist, because the module has not yet been loaded.

Simply include this code snippet, straight before node_add().

if( ! function_exists("node_add")) {
	include_once(drupal_get_path('module', 'node') . '/node.pages.inc');
}
sanduhrs’s picture

richH’s picture

Hi,

I added this code to the beginning of 'sites/all/modules/track/track.module' and it works fine:

module_load_include('inc', 'node', 'node.pages');