There's a minor documentation issue in views.api.php. It says that the views property should be used on an entity to point at the class that implements EntityViewsDataInterface. This is wrong; it should be the handlers.views_data property. This is what content entity types like Node and File do.
Going to attach a patch that tries to clarify this. Honestly, I think I could do better. Maybe we could add a @see so that the person can find a good example more easily?
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | interdiff_10-12.txt | 754 bytes | ayushmishra206 |
| #12 | 2470753-12.patch | 1.11 KB | ayushmishra206 |
| #10 | 2470753-10.patch | 1.11 KB | lendude |
| #1 | 2470753_views_data_documentation.patch | 775 bytes | wizonesolutions |
Comments
Comment #1
wizonesolutionsVoilà.
Comment #10
lendudeCleaning up old bugs.
Docs are still wrong after all these years :)
Fixed the line wrapping at 80 characters.
Comment #11
longwaveTypo: th -> the
Comment #12
ayushmishra206 commentedCorrected the typo in #10.
Comment #13
ayushmishra206 commentedComment #14
longwaveComment #15
alexpottCommitted and pushed dddfc88551 to 9.2.x and 6632bbfa21 to 9.1.x. Thanks!
Backported to 9.1.x since this is a docs fix.