I set up a custom content type in Drupal 8.3.2. After the content type was built I installed and enabled DS 8.x-3.1. When I created a new node in my content type, I received an error that "the website encountered an unexpected error. Please try again later" and the content was not added.
In the server error log is this message: Uncaught PHP Exception Drupal\\Core\\Entity\\EntityStorageException: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ds_switch' in 'field list': INSERT INTO {node_field_data} (nid, vid, type, langcode, status, title, uid, created, changed, promote, sticky, revision_translation_affected, default_langcode, ds_switch)...
I assume the "ds_switch" column refers to a column in Display Suite. It doesn't seem that enabling DS to my site after the content type was created should have caused the error but that's what the error message seems to imply.
I then built another content type, this time with DS already enabled, but I still encounter the same error.
Finally, I tried to uninstall Display Suite but I encountered the same error in the browser, with this error in the log file: Uncaught PHP Exception Drupal\\Core\\Database\\DatabaseExceptionWrapper: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ds_switch' in 'where clause': SELECT 1 AS expression\nFROM \n{node_field_data} t\nWHERE ds_switch IS NOT NULL\nLIMIT 1 OFFSET 0; Array\n(\n)\n" at /[webroot]/core/lib/Drupal/Core/Database/Connection.php line 685, referer: http://[webroot]/admin/modules
Comments
Comment #2
rvanderh1 CreditAttribution: rvanderh1 commentedI also just backed down to DS 8.x-3.0 but the errors I described above still persist.
Comment #3
aspilicious CreditAttribution: aspilicious commentedYour database seems corrupt.
Did you run update.php?
Have you access to drush?
You could try:
drush entity-updates
It fixes your schema.
Comment #4
rvanderh1 CreditAttribution: rvanderh1 commentedI did run update.php several times but each time it came back and said no pending updates. I was working on a pretty fresh installation of Drupal 8.3.2 so I'm not sure how the database could get corrupted.
I do not currently have access to drush but I'm interested in learning more about it.
Comment #5
rvanderh1 CreditAttribution: rvanderh1 commentedBTW, doesn't this look a lot like this thread:
https://www.drupal.org/node/2770171
Comment #6
aspilicious CreditAttribution: aspilicious commentedHmm, I'll need to test this myself....
Seems we are lacking test coverage if there is still a problem...
This column is only needed when you have the switch viewmode submodule enabled.
Comment #7
swentel CreditAttribution: swentel at eps & kaas commentedComment #8
swentel CreditAttribution: swentel at eps & kaas commentedOops, didn't want to close it yet
Comment #9
swentel CreditAttribution: swentel at eps & kaas commentedTested installing, setting a value, then uninstalling, no errors, Entity/field definitions are up to date, so assuming everything is fine nowadays.