I found another possible cause of this. A serious bug.
This assumes you are running 4.3.x, and are adding a new Module Definition from the Add New Module Definition link.
Problem:If you add a module using the Module Definition tool, you must be CAREFUL. Naturally, you want to scroll down to find a "submit" button at the bottom (called Update in this case). BUT if you click that Update button you will find your module HALF installed in a screwed up state.
It will allow you to see it in the drop down but not add it to the page if you click Add!Furthermore:If you are in this state, you are hosed. You cannot re-install, you cannot uninstall, you cannot fix this. Unless you know what 3 tables to edit, you are screwed.
This is the only table that gets a record for your module:
DesktopModulesThese are the other 3 tables that need related records:
ModuleDefinitions
ModuleControls
ModulesOnce I added records in these tables, it seemed to fix the problem.
Conclusion: DO NOT click UPDATE at the bottom when adding new Module Definitions.
You must click INSTALL (small link to the right of the drop down list of available modules to add).
Suggestions for Core team:This should be logged (if not already) as a bug in the tracker. I would check, but at the time of discovery and writing this, the tracker was down.
Bug 1:
Usability issue. User naturally heads to bottom of page after filling out fields, and will inevitably click Update when in fact Install is what needs to be clicked. Do not mix installing and updating module definitions into the same UI. Thats just asking for catastrophe.
Bug 2:
For the love of all that is good and holy... Block running the Update code on a module definition that doesnt exist. Prevent database corruption (incomplete records) from happening when trying to Update a module definition that has not even been installed/added yet!
Note: If you fix bug 1, then bug 2 can never happen anyway. I'm a huge advocate of good and proper UI, and there is one of many reasons why.