- 🇳🇱Netherlands Lendude Amsterdam
This came up as a daily triage target for the bug smash initiative.
We have a patch that doesn't give geen tests, so 'Needs work' I guess. Hard to manually test, so great to see some test coverage for this.
It is possible to end up with invalid views data if caches get built twice in a single request. This can cause install errors where config dependencies are concerned. NB: This only occurs when base fields change outside of a module install, e.g. config change.
ViewsData::clear
- ViewsData::getAll
builds the data rather than retrieve from cache.ViewsData::getAll
- collects views data, including constructing all ‘views_data’ handlers, eg. UserViewsData.ViewsData::clear
via views_field_config_insert as the views data is now incomplete.ViewsData::getAll
- collects data, including already instantiated ‘views_data’ handlers.The second ViewsData::getAll ends up with incomplete field storage definitions, because the already instantiated UserViewsData uses a version of the field storage definitions from the first run through prior to the new field being added (see \Drupal\views\EntityViewsData::getFieldStorageDefinitions
).
Contacts module adds a profile type, an entity reference field to that profile type on a user and a view that uses that field. ProfileType::postSave rebuilds the router, which triggers ViewsData::getAll
. The field is then added and then a view that depends on it. When the view is added, ViewsData::getAll
is triggered and does not return a required field. This causes an install exception.
#2875157: ProfileType::postSave should not immediately rebuild the router →
is looking into a possibly inappropriate rebuild (rather than setRebuildNeeded), but this may be something that should also be addressed in core, as even if this case can be avoided it still feels fragile.
EntityViewsData::$fieldStorageDefinitions
. Possible performance implications?ViewsData::clear
. Will result in lot more work every time ViewsData::clear
is called.ViewsData::getAll
is called we have clean information from entity ‘views_data’ handlers. Essentially just switching views_views_data to use EntityTypeManager::createHandlerInstance
rather than EntityTypeManager::getHandler
.Needs work
10.1 ✨
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This came up as a daily triage target for the bug smash initiative.
We have a patch that doesn't give geen tests, so 'Needs work' I guess. Hard to manually test, so great to see some test coverage for this.