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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geodaniel’s picture

Status: Active » Needs work
FileSize
2.13 KB

Attached 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.

Crell’s picture

Status: Needs work » Needs review

Haven'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.

catch’s picture

Makes complete sense to me. Could you provide a screenshot with and without?

Crell’s picture

Er, 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.

catch’s picture

Hi 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.

agentrickard’s picture

I 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.

geodaniel’s picture

Category: task » bug

Changing 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.

geodaniel’s picture

Title: MySQL not available as a PDO driver on install on Mac OS X » List all available databases, even if only one is available
Category: bug » task
chx’s picture

Category: bug » task

Huh 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 ...???

geodaniel’s picture

I 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? ;)

Crell’s picture

What 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.

chx’s picture

Make 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"

Dave Reid’s picture

Component: database system » install system
Issue tags: +Usability, +DrupalWTF
catch’s picture

Status: Needs review » Needs work

Yeah let's not add a single disabled radio button to this form, but showing which driver will be used is a good change.

alexanderpas’s picture

for your consideration: how do we do it with input types?

Crell’s picture

My 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.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
2.78 KB
2.78 KB

I 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.

Dave Reid’s picture

Screenshot attached this time.

Crell’s picture

Hm. I'd actually be OK with that visually, especially since the help text says why it's grayed out.

geodaniel’s picture

I like the idea of it being greyed out but also adding to the help text beneath it.

alexanderpas’s picture

+1 for #17/#18

chx’s picture

Status: Needs review » Reviewed & tested by the community

I think we have an agreement.

beeradb’s picture

This looks like a considerable improvement over the current state of things, so +1 from me.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all. :) Committed to HEAD.

geodaniel’s picture

Thanks everyone

Status: Fixed » Closed (fixed)
Issue tags: -Needs usability review, -Usability, -DrupalWTF

Automatically closed -- issue fixed for 2 weeks with no activity.