In Drupal 4.6.0 I tried writing something similar to module taxonomy_menu so that I can insert extra menu items using a different data source. I read the documentation for hook_menu but it does not mention how it uses caching or the menu table. My use of hook_menu produced something different to taxonomy_menu.
Some of the added items never appeared in the menu no matter what I did. I tried MENU_DYNAMIC_ITEM but nothing changed.
I then shut down the computer for a rest (I have a strict rule of spending at least 0.5 hours a day away from the computer). This morning some extra menu items appeared. What changed?
Last night I tried clearing the cache table but that did nothing. I tried resetting the menu table but that did nothing. I tried my code in the $may_cache is true section and in the false section. There must be something else stopping the menu items displaying.
I found the menu items were appearing in the menu table with settings that are exactly the same as menu items that display. When I visit administration >> menus I found some of the temporary menu items from my code were being added to the menu table. After a few visits to the menus page I have items added seven times.
The extra entries have a pid of 1. pid is the index of url_alias but there is no entry in url_alias with pid=1.
The extra entries are of type 22 and I have not found where the type field is defined or used.