I created a module that maintains a taxonomy using hook_nodeapi and 'presave'. When I add a taxonomy term, I also add a menu item with the same name. The resulting menu is added to sitemap.xml as suggested in the documentation. This creates an entry in the sitemap associated with the terms in the vocabulary with custom path.

Here is the code that is causing the fatal error:

// add a memu item so this page makes it into sitemap.xml
$form_state = array();
$form_state['values']['menu'] = array(
'link_title' => 'Genesis 1',
'link_path' => 'commentary/genesis-1',
'enabled' => 1,
'expanded' => 0,
'weight' => 1,
);
drupal_execute('menu_edit_item',$form_state,'add',Null,array('menu_name' => 'menu-commentary-xmlsitemap'));

Comments

Greg Sims’s picture

Status: Active » Closed (works as designed)

It helps to have menu.admin.inc included in my code. This is working well now.