Trying to install Drupal 7 on Mac OS X, I am given only the option of a SQLite database, and not MySQL. In terms of usability this is confusing, as I just presumed that the fields I was being given were for MySQL connection information, and only realised that assumption was incorrect when I got SQLite errors:
Failed to create a test table on your SQLite database server with the command CREATE TABLE drupal_install_test (id int NULL). SQLite reports the following message: SQLSTATE[HY000] [14] unable to open database file.
PDO::getAvailableDrivers() is returning only sqlite as being available.
I had thought this was a localised problem because of the way my environment is set up, but it seems from this support thread and blog post that it is a wider problem with the standard installation of PDO on Mac OS X 5 (Leopard), so others are likely to run into it too.
At a minimum we should highlight the database type that is being used (the only mention is in the help text at the moment), even if there is only one available, but beyond that, perhaps find a workaround that could be coded in (MySQL still works, just not through PDO) or provide documentation that would help developers fix the issue on their system.
Comment | File | Size | Author |
---|---|---|---|
#18 | drupal-install-one-dbtype.png | 45.78 KB | Dave Reid |
#17 | 355496-install-one-db-type-D7.patch | 2.78 KB | Dave Reid |
#1 | 355496_singular_databases.patch | 2.13 KB | geodaniel |
Comments
Comment #1
geodaniel CreditAttribution: geodaniel commentedAttached is a patch which (as a first step) re-introduces the list of database types, even if only one is available. This way, the user installing the site can see at a glance what database type is being used.
Comment #2
Crell CreditAttribution: Crell commentedHaven't tried the patch yet, but on visual inspection looks OK. I agree that making it clear what database is in use is a good thing, independent of any other Mac considerations. I don't know what we can do about buggy Mac drivers other than recommend that people fix PDO on the Mac.
Comment #3
catchMakes complete sense to me. Could you provide a screenshot with and without?
Comment #4
Crell CreditAttribution: Crell commentedEr, there's not much to the screen shot. Before, there will sometimes be a 2-or-more-value radio button, and sometimes no radio button. With the patch, there will always be a radio button even if it only has one value.
Comment #5
catchHi Crell, yeah I know. But I'm trying to get screenshots for any usability related patches so that patch averse people from the usability group can look them over easily.
Comment #6
agentrickardI would support the patch and a docs page explaining the issue. The PDO-layer is what made me switch to MAMP instead of vanilla OSX, fyi.
Comment #7
geodaniel CreditAttribution: geodaniel commentedChanging the title to reflect the patch in #1, and I've added a short handbook page at http://drupal.org/node/369107 which at least points people to some other resources. I tried the switch from 64-bit to 32-bit but still have had no success. I think it's about time to switch to MAMP, but it seems a shame to have to force people to do that.
Comment #8
geodaniel CreditAttribution: geodaniel commentedComment #9
chx CreditAttribution: chx commentedHuh what? There was already text saying t('The name of the %driver database your @drupal data will be stored in. It must exist on your server before @drupal can be installed.') so what do you want with a single radio ...???
Comment #10
geodaniel CreditAttribution: geodaniel commentedI think it just helps from a usability standpoint to highlight which database type is being used. Who really reads the help text under the fields? ;)
Comment #11
Crell CreditAttribution: Crell commentedWhat geodaniel said. :-) If you have only one DB available, right now it doesn't indicate to you which one you're using. That's ungood.
Comment #12
chx CreditAttribution: chx commentedMake the help more visible but do not make a form with one radio button that's very confusing "I am supposed to choose something. But what? There is only one option. Why? What did I do wrong there are no more"
Comment #13
Dave ReidComment #14
catchYeah let's not add a single disabled radio button to this form, but showing which driver will be used is a good change.
Comment #15
alexanderpas CreditAttribution: alexanderpas commentedfor your consideration: how do we do it with input types?
Comment #16
Crell CreditAttribution: Crell commentedMy first thought is that if there's only one, you get a one-item UL instead of radio buttons and a value form element instead of the radio to carry the value. Arguably you wouldn't even want the bullet there, so just a div with the database name in it.
Comment #17
Dave ReidI wanted to try what a grey-ed out single radio button would look like, and I don't think it's all that bad. I added
unset($drivers['pgsql']); unset($drivers['sqlite']);
to install_settings_form() to simulate this condition and the installer worked correctly since disabled fields still return a value in $form_state['values']. Screenshot attached for review.Comment #18
Dave ReidScreenshot attached this time.
Comment #19
Crell CreditAttribution: Crell commentedHm. I'd actually be OK with that visually, especially since the help text says why it's grayed out.
Comment #20
geodaniel CreditAttribution: geodaniel commentedI like the idea of it being greyed out but also adding to the help text beneath it.
Comment #21
alexanderpas CreditAttribution: alexanderpas commented+1 for #17/#18
Comment #22
chx CreditAttribution: chx commentedI think we have an agreement.
Comment #23
beeradb CreditAttribution: beeradb commentedThis looks like a considerable improvement over the current state of things, so +1 from me.
Comment #24
webchickThanks all. :) Committed to HEAD.
Comment #25
geodaniel CreditAttribution: geodaniel commentedThanks everyone