Add Media button doesn't work when Visual Editor is disabled (3.5)

Description

In my User Profile, I have the option "Disable the visual editor when writing" checked.

When writing a post, I am unable to add media with the "Add Media" button. Clicking on it does nothing.

I go back to my User Profile, and uncheck the visual editor setting to enable it.

I go back to writing a post. In visual mode, I can click on the "Add Media" button, and I am able to add media. I close the window and click on the code view tab of the editor. I click on the "Add Media" button and am still able to add media.

I go back to my User Profile and check the visual editor setting to disable it.

I go back to writing a post and cannot add media with the "Add Media" button.

I suppose I could keep the visual editor enabled and stay in code view all the time, but it's still a bug.

Nacin: I had the same issue as onions in FF 17.0.1, Chrome, and IE 9. I've also noticed complaints online about this. I will do more research in the morning to try and find where the issue is so I can submit a patch. I tried two different themes to see if maybe it was a theme issue. The themes I used were 2012 and 2010. I had all the plugins disabled. The media button does work if you right click and hit open in new tab. I'll keep you posted.

Nacin and onions: I installed two dummy wordpress sites. One using PHP 5.3.xx and one using 5.4.8 This is not a bug, because it doesn't occur when WordPress is installed or updated properly. Without more information, I'd say this happens to sites when an auto-update doesn't finish or for some reason it is finished, but improperly.

Out of the 3 installs only one had the same issue as Onions. After putting define('SCRIPT_DEBUG', true); in wp-config.php. the issues disappeared, but that doesn't fix the issue. I will read the debug.log when WordPress creates one. One has yet to appear.
Edit: I added define('WP_DEBUG_LOG', true); so it will be posted soon.