Customer bought a D8 theme with Drupal Commerce installed with it. Every time I start out to build a custom module, at some point the site goes down with what I suspect is due to a misconfiguration involving the profile module which is a dependency of the Commerce Suite according to composer.lock. The latest is a simple custom form and when I hit submit I get a stacktrace. The general form is the same for every page where it seems to be attempting to build a SQL query involving the profiles table. This is the top of the stack trace for this Drupal home page.
Error: Call to a member function getType() on null in Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::propertyDefinitions() (line 73 of core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php). Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::propertyDefinitions(Object) (Line: 118) Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::schema(Object) (Line: 713) Drupal\Core\Field\BaseFieldDefinition->getSchema() (Line: 736) Drupal\Core\Field\BaseFieldDefinition->getColumns() (Line: 388) Drupal\Core\Entity\Sql\DefaultTableMapping->getColumnNames('uid') (Line: 310) Drupal\Core\Entity\Sql\DefaultTableMapping->getAllColumns('profile') (Line: 428) Drupal\Core\Entity\Query\Sql\Tables->getTableMapping('profile', 'profile') (Line: 207) Drupal\Core\Entity\Query\Sql\Tables->addField('status', 'INNER', NULL) (Line: 52) Drupal\Core\Entity\Query\Sql\Condition->compile(Object) (Line: 162)
My efforts to uninstall the Commerce Suite crash the site attempting to uninstall one of its dependencies, like Price or Product. Of course, I attempt to click the link to remove all data from that dependency, usually returning a 500 error.
I'm sure I'm not understanding how Entity can be modified and how to fix this, but when this happens the site is hosed and no UI can be used since emptying the cache.* tables and
drush pm:uninstall mycustommodule have been run. The only way I've been able to get out of this crashed state was to import an old database.
Looking at the stacktrace, is it the profile module that's causing the crash here?