Soooo, I tried adding a menu link programmatically with the following code:

//found this code online...
$link = array();

$link['mlid'] = 0;
$link['plid'] = 454;
$link['link_title'] = 'Precious Metals Extend Gains';
$link['link_path'] = 'node/1647';
$link['menu_name'] = 'menu_why_goldline';
$link['router_path'] = 'node/%';
$link['module'] = 'menu';


//menu_rebuild();
//$return_mlid = menu_link_save($link);
//menu_cache_clear_all();
print 'new menu id: ' . $return_mlid;

Now, my site doesn't come up at all, not event he admin panel! A bunch of errors, if you're interested in seeing the mess: lima[dot]goldline[dot]com.

I tried restoring a three month old version of the tables menu_router and menu_links but no go. Same error. I know that these were two tables directly affected by the above code. Wondering what other tables got affected?... =[

Still Googling and reading menu.inc. Any insight would be helpful.

Thanks in advance!

Comments

xxparanormalxx’s picture

Nevermind. I did an update.php and everything came back. Except for 2 months of menu-links that I lost......