Hooks in includes files are not included with .module with php8.1 in drupal 7.98

Created on 28 July 2023, over 1 year ago
Updated 13 September 2023, about 1 year ago

Problem/Motivation

Entity module broke with an error EntityMetadataWrapperException: Invalid data value given. on an og field.

Upon debugging we added the entity.info.inc file to entity module and the issue was resolved. This seems to be an issue for various modules where hooks are defined outside .module file in .inc files. This is specific to PHP8.1 and does not happen in PHP7.3

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Postponed: needs info

Version

7.0 โšฐ๏ธ

Component
Otherย  โ†’

Last updated about 11 hours ago

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia aravindkrishna

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

  • Issue created by @aravindkrishna
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    Is this the same as ๐Ÿ› module_implements works differently for php 7 and php 8 Closed: duplicate ?

  • This almost seems like the reporterโ€™s PHP 8 build has disabled language features, or some other platform issue on their end.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aravindkrishna

    Is there a list of configuration changes that needs to be done for PHP 8.1 when moving from PHP 7.3 ?

  • Status changed to Postponed: needs info over 1 year ago
  • ๐Ÿ‡ธ๐Ÿ‡ฐSlovakia poker10

    Thanks for reporting this.

    I am personally using Entity module on multiple D7 sites on PHP 8.1 without any problems (no extra configuration needed). Please ensure that you have updated D7 core to the latest version and also all used contrib modules to their latest versions (if you are using some less common modules, probably you would have to apply some patches manually to fix all PHP 8.1 issues). If you have any PHP 8.1 deprecations displayed, these can cause unexpected behavior of the site (for example I saw some tokens missing, etc..), so it can be related. It would be also helpful to check logs (Drupal / server) if there are any errors / problems, to help debugging this.

    If you have updated all modules and core correctly, please provide more information, how to simulate this on clean Drupal 7 + Entity module (e.g. steps to reproduce). Thanks!

  • ๐Ÿ‡ต๐Ÿ‡ฑPoland netmachina

    The same problem is with for example metatag module (tested on PHP 8.2).
    I have checked recent versions and between version 7.92 and 7.93 something happened, that causes that error.

    I will try to look for that and give you feedback.

Production build 0.71.5 2024