Problem/Motivation
When installing Drupal 8 with the minimal profile, enable views & views_ui, disable node, a view can be configured to create an invalid SQL statement:
Create a view based on users and add the 'Content authored' relationship.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd8_dev.node_field_data' doesn't exist: SELECT users_field_data.created AS users_field_data_created, users_field_data.uid AS uid FROM {users_field_data} users_field_data LEFT JOIN {node_field_data} node_field_data_users_field_data ON users_field_data.uid = node_field_data_users_field_data.uid WHERE (( (users_field_data.status = :db_condition_placeholder_0) )) ORDER BY users_field_data_created DESC LIMIT 11 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 )
Proposed resolution
Either move the relationship to the node module (hook_views_data_alter()) or fix this in #2706431: provide Views reverse relationships automatically for entity base fields
Remaining tasks
Write the code.
User interface changes
The content authored relationship will not be visible in user-based views if the node module is not enabled.
API changes
No real public API changes.
Data model changes
The views data for the relationship will move from the user module to the node module.
Comments
Comment #2
Jelle_SComment #11
catchThis is still valid - node module is optional, user module isn't.
There should be a ticket somewhere to make this generic for entities that implement EntityOwnerInterface, in which case it could move back to user module, but then it would still need to correctly handle modules being enabled or disabled.