Problem/Motivation
Per #3484105: Automatically included .inc files are no longer included and https://www.drupal.org/node/3489765 , Drupal will no longer automatically pick up *.inc files. The entity module includes an entity_views_data() hook in entity.views.inc. On Drupal 12, this hook is no longer discovered, leading to downstream problems for modules that implement the Entity API.
Steps to reproduce
1. Install a site on Drupal 12 and enable the Entity module (bypassing/modifying the core_version_requirement)
2. Implement a module that implements a ContentEntity type that has a views_data handler.
3. Create a View of this Content Entity type.
4. Fatal error, with "InvalidArgumentException: Class "entity_views_data" does not exist"
Proposed resolution
For the time being, move the implementation of entity_views_data to to the .module file.
Remaining tasks
In a subsequent task, for Drupal 13, which drops support of .module files, all of the hooks in the .module file will need to be relocated to object-oriented equivalents.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Issue fork entity-3610940
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mark_fullmerComment #5
daften commentedI merged 8.x-1.x into the fork, to allow merging, since entity_views.inc was changed through #3331201
Comment #6
orkutmuratyilmazI have 8.x-1.8 (without any patches) installed on my Drupal environment and upgrade_status says, there's only one problem for D12 upgrade:
Since this issue is about D12 compatibility, I wanted to add this comment here.
Comment #7
damienmckennaThis is a duplicate of #3553240: Convert hooks to OOP.