Hi Folks,
I've developed a 'student' node module with which I'm trying to use the Location API to save its address information. In my student_form()
hook I use the location_form()
hook to collect the student's address like this:
$form['address']['address'] = location_form(array('street', 'additional', 'city', 'province', 'postal_code', 'country'), $node->location ? location_api2form($node->location) : array(), array('street', 'city', 'province', 'postal_code', 'country'));
The Problem
The location form displays nicely within my student form but the location data never seems to save. I've tried calling location_nodeapi()
in my student_insert()
hook but that didn't do the trick either (I didn't think I had to explicitly call location_nodeapi()
anyway so I was pretty sure that wasn't the problem). I've combed through location.module, location_API.txt, location.inc and much of drupal.org but can't get my hands on an answer.
What I Do Know
I know the location.module is alive and well though because it saved just fine when I tested it with a custom content-student node I built using the CCK. Also, location_nodeapi()
does fire its validate, prepare, view and load operations when I create and edit students, so, I'm getting some response from it, just no 'insert' or 'update'. For what it's worth, I'm also trying to get the Image Assist API to work in the same way and am having the same problem with it.