I am writing a custom module to bridge the gap between organic groups and location by saying that the admin can define certain content types as inheriting location from their organic group, in the case that their organic group has a location. However, this is my first time working with hook_nodeapi, and I don't understand it very well, and am having trouble getting it to work. What happens now is that when the user submits a form of a location-inheriting node, "location" and "locations" are added to the node object, but as empty arrays. Here is my entire code for this module (don't worry, it's not too long).
/*
* Implementation of hook_perm().
*/
function og_location_perm() {
return array('administer og location');
}
/*
* Implementation of hook_menu().
*/
function og_location_menu($may_cache) {
if ($may_cache) {
$items[] = array(
'path' => 'admin/og/location',
'title' => t('Organic Groups Location'),
'description' => t('Configure Organic Groups Location.'),
'callback' => 'drupal_get_form',
'callback arguments' => array('og_location_admin_settings'),
'access' => user_access('administer og location'),
'type' => MENU_NORMAL_ITEM,
);
}
return $items;
}
/*
* Menu callback.
*/
function og_location_admin_settings() {
$types = node_get_types();
foreach ($types as $type) {