I have been doing a new Drupal 7.27 site and am heavily into creating, modifying and deleting content types in the early stages of development.

After a while, the "Add Content" link stopped working with the message that "You haven't created any content types..." even though there were 20+ available. I was able to add content for each specific type by jumping to that content creation menu, but the landing page for all content types which could be created never showed up given the error.

After much digging around, it seems that if you make a content type from a module and then delete the module, it may leave around a menu item in the menu_links table which is "orphaned", that is the mlid of that item does match a plid anywhere. When that happens, the db join query in system_admin_menu_block() function (system.module file line 2117 in Drupal 7.27) returns no results for that query because of this orphaned item.

After digging through the SQL and manually imitating the module's calls, I discovered it. By deleting the orphaned item (using SQL, e.g. phpMyAdmin or similar) with a non-matching mlid in the menu_links table (which needs to match a plid in the same menu_links table), then the Add Content worked fine again.

The Add Content item should be more robust than this.

Hopefully this will help any other users or developers to check their setup if they run into this problem.

Comments

Version: 7.27 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.