Problem/Motivation

We noticed after updating to beta14 that we get entity update mismatch errors on the webform_submission entity.

I don't quite understand why webform was added *both* to webform_schema() and WebformSubmissionStorageSchema. This only doesn't fail because entity schema installation silently ignores already existing tables, which I think is a bug and this might eventually change and throw an exception.

As far as I see, the table should just be removed from there, so it is only defined in one place.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

An alternative fix would of course be to remove webform_schema() instead but then the update function would also need to run entity updates instead (I think this actually needs another entity updates call anyway in a new update function for sites that now already updated and did run it).

And yet another fix would be to add an update function that runs it now, once. But I really think it shouldn't be defined twice and removed from either location.

Status: Needs review » Needs work

The last submitted patch, 2: webform-duplicate-webform-schema-2891116-2.patch, failed testing. View results

Berdir’s picture

Status: Needs work » Needs review
FileSize
2.48 KB

Hm, so apparently some kernel tests rely on the table being created through that.

jrockowitz’s picture

Status: Needs review » Fixed

Thanks for catching that mistake. I committed the patch and will roll out a hotfix release in the next day or so.

  • jrockowitz committed cc60ad7 on 8.x-5.x authored by Berdir
    Issue #2891116 by Berdir: Defining webform table in...
attheshow’s picture

Status: Fixed » Active

After updating to the latest dev version, clearing the cache, and trying to update the database again, I'm still getting the error on update 8061.

Do you wish to run all pending updates? (y/n): y
Table webform already exists.                                             [error]
Performing webform_update_8061                                               [ok]
Failed: Table webform already exists.                                     [error]
Cache rebuild complete.                                                      [ok]
Finished performing updates. 
Berdir’s picture

Status: Active » Fixed

Sounds like you executed entity updates before normal updates. You shouldn't do that. In fact, there shouldn't be a reason to run entity updates at all unless you're developing your own modules or something went wrong.

You will have to manually delete the webform table and then run the updates.

attheshow’s picture

Sorry, I don't even know how to accomplish what you're describing. Is that something that one can do accidentally?

attheshow’s picture

Or I wonder if it's caused by the transition from YAMLForm module to Webform. I had originally installed YAMLForm and then went through the migration video that @jrockowitz made a few months ago.

Berdir’s picture

What I meant is running drush entity-updates/drush entup, if you did that without running drush updb first then you have that problem.

But as I said, doing a drop table webform and or doing the same in some UI and then running updates again should fix it.

attheshow’s picture

Oh, ok that makes sense. I haven't been using the entity commands, but I'll try your suggestion of dropping the table manually tonight to see if that helps. Thanks! :)

Status: Fixed » Closed (fixed)

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