- Issue created by @daniels____
- 🇮🇹Italy apaderno Brescia, 🇮🇹
There is no requirement to put
hook_views_data()
in a .views.inc file. When there is no .views.inc file, the hook is looked for in the .module file.If there were a requirement, Drupal core would at least log a warning, or a deprecation error.
- 🇦🇹Austria agoradesign Grieskirchen
daniels____ wrote, that it is recommended, not required.
Although this is or at least was true in former days, I'm against changing this for a simple reason. This change would be an unnecessary and unsustainable step. Drupal 11.2 introduced a lot of OOP hooks, deprecating many of the procedural hooks, we are all used for years. I honestly don't know exactly, whether hook_views_data() does already have an OOP replacement too, but in the long run any hook will be replaced, I guess (comparable with the fact, that any plugin declaration is currently going to be changed from annotations to PHP attributes)