- π¦πΊAustralia acbramley
I agree this file could use some love. We even have some fun comments like
// Bogus fields for aliasing purposes.
We need a bit more of a plan here about what we should do though.
The file NodeViewsData.php
, which implements a single function, getViewsData()
should be a model of good organization and well documented.
This function returns an array with the structure documented in hook_views_data(). It is pretty complicated, with a lot of options. (In other words, not all of Drupal 7's info arrays were replaced by more object-oriented structures.) Anyone who has to implement that hook, or the related alter hook, and wants more examples than in the API documentation is going to look first at NodeViewsData.php
. It has a lot of examples that affect options (fields, sorts, relations) that are familiar to anyone who has used Views.
Add an @see
comment pointing to the documentation for hook_views_data()
.
Reorganize the function so that everything related to one primary key is in the same place. As it is now, I see a few lines related to $data['node']['node_bulk_form']
, and later more lines for $data['node']['node_listing_empty']
, interrupting the long definition of $data['node_field_data']
.
Consider splitting off into a separate function the part that applies only if the Search module is enabled.
Add code comments explaining how each section affects what a site builder sees when working with Views.
None. This issue is all about developer experience (DX). If it is done correctly, it will have no effect on functionality nor interface.
None
None
Postponed: needs info
11.0 π₯
node system
Enhances developer experience.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I agree this file could use some love. We even have some fun comments like // Bogus fields for aliasing purposes.
We need a bit more of a plan here about what we should do though.