SqlContentEntityStorageSchema::updateDedicatedTableSchema()
is broken when the entity type doesn't support revision.
The error message is:
TypeError: Argument 4 passed to Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::addIndex() must be of the type array, null given, called in /Project/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php on line 1388 in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->addIndex() (line 2102 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php).
I use the config_devel to update the field config file automatically. To adding indexes in field table, I add an item indexes into field.storage.registrant.field_my_field.yml. It looks like:
langcode: zh-hant
status: true
dependencies:
module:
- rng
id: registrant.field_my_field
field_name: field_my_field
entity_type: registrant
type: string
settings:
max_length: 255
is_ascii: false
case_sensitive: false
module: core
locked: false
cardinality: 1
translatable: true
indexes:
value:
- value
persist_with_no_fields: false
custom_storage: false
Set the config file importing automatically in config_devel. I expect config_devel will import the config and add value (field_register_code_value) field as index in field_my_field database table. However, when the index is added or dropped, it will throw an exception as above.
Check if the entity type support revision or not.
Needs work
11.0 🔥
The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.