Hello!
I am wondering if it is possible to run a script to call the "add node" process for existing nodes?
I have added a bunch of nodes via SQL. I have GMAP/Location installed... When I add a node from the drupal website, it geocodes the lat/long from the address. Since I have added the nodes via the database though, and not through the regular add node website, it is not geocoding the address.
I have gone to administer>content and see I can "publish" this content... but I need to "add" it so the gmap encodes the location.
Is there a way I could look at the "add node" process to see when/where it is envolking gmap to encode the location?
Or is there just a way I can run through all nodes and make sure they have gone through the "add" process? Because these locations are only getting encoded when I do a add node from the website.
Any help would be greatly apreciated!
Comments
hook_nodeapi, hook_load, hook_save
There are several functions that you might find helpful. Look for location_nodeapi in the location module. I'd bet that it's geocoding the location there, and you'll be able to tell at what stage of the node-saving process it does that. (You can read more about hook_nodeapi here.)
In terms of "resaving" your nodes to invoke that process, you'll probably want to use node_load and node_save.