Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#4 | webform-duplicate-webform-schema-2891116-4.patch | 2.48 KB | Berdir |
| |||
#2 | webform-duplicate-webform-schema-2891116-2.patch | 1.2 KB | Berdir |
Comments
Comment #2
BerdirAn 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.
Comment #4
BerdirHm, so apparently some kernel tests rely on the table being created through that.
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThanks for catching that mistake. I committed the patch and will roll out a hotfix release in the next day or so.
Comment #7
attheshow CreditAttribution: attheshow at FleetThought commentedAfter 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.
Comment #8
BerdirSounds 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.
Comment #9
attheshow CreditAttribution: attheshow at FleetThought commentedSorry, I don't even know how to accomplish what you're describing. Is that something that one can do accidentally?
Comment #10
attheshow CreditAttribution: attheshow at FleetThought commentedOr 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.
Comment #11
BerdirWhat 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.
Comment #12
attheshow CreditAttribution: attheshow at FleetThought commentedOh, 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! :)