It looks like the call to drupal_install_schema() in webform.install is unnecessary, per
http://drupal.org/node/224333#install-schema. The attached patch simply removes that line.

Comments

quicksketch’s picture

Version: 7.x-3.x-dev » 7.x-3.0-beta4
Status: Active » Needs work

Thanks, we'll need to remove the drupal_uninstall_schema() also it looks like.

hansrossel’s picture

Priority: Normal » Critical

I got this error on install of beta4, I suppose it's this issue. Marking as critical, because it's not possible to install webform beta 4 because of this.

DatabaseSchemaObjectExistsException: Table webform already exists. in DatabaseSchema->createTable() (line 544 of /home/example/public_html/includes/database/schema.inc).

The website encountered an unexpected error. Please try again later.

hansrossel’s picture

StatusFileSize
new676 bytes

Attaching new patch which also removes drupal_uninstall_schema(). Works for me.

quicksketch’s picture

Status: Needs work » Fixed

Thanks, committed. My version of Drupal 7 (I was using somewhere between alpha 2 and alpha 3) didn't have this problem. But updating to alpha 3, this definitely causes a large problem on install. I'll put out another beta of Webform shortly.

Status: Fixed » Closed (fixed)

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

geerlingguy’s picture

Version: 7.x-3.0-beta4 » 7.x-3.4-beta1
Status: Closed (fixed) » Active

Getting this error on upgrade - I was using 6.x-3.4, and I tried upgrading to 7.x-3.4 (on Drupal 7 RC1), and got this error (it won't go away):

Update #7304

Failed: DatabaseSchemaObjectExistsException: Cannot add field <em class="placeholder">webform</em>.<em class="placeholder">block</em>: field already exists. in DatabaseSchema_mysql->addField() (line 324 of /home/midweste/public_html/includes/database/mysql/schema.inc).
geerlingguy’s picture

If I comment out line 442 (below - db_add_field()), then the update runs fine - is there a way to check if that field already exists?

/**
 * Add field for block feature and redirection setting.
 */
function webform_update_7304() {
  // db_add_field('webform', 'block', array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0));
  db_change_field('webform', 'redirect_url', 'redirect_url', array('type' => 'varchar', 'length' => 255, 'default' => '<confirmation>'));
  db_update('webform')
    ->fields(array('redirect_url' => 'confirmation'))
    ->condition('redirect_url', '')
    ->execute();
}
quicksketch’s picture

Priority: Critical » Normal
Status: Active » Closed (fixed)
StatusFileSize
new1.26 KB

@geerlingguy: This probably should have been opened as a new issue, since it's not at all the same as the original problem (but it is a problem in the same file). When webform_update_7304() was added I didn't think of the situation where a user would be upgrading from Webform 6.x-3.4 to Webform 7.x-3.4 or higher, which of course is a very likely thing to have happen as the 3.4 version of Webform has now been out for months. I've committed this patch which conditionally only adds the "block" column if needed, just like all the other updates in webform.install.

I'm closing this issue directly as it should not have been reopened to begin with (and the title doesn't make any sense).

geerlingguy’s picture

Ah well, at least it's fixed :)