Inconsistent loading of third party hook implementations

Created on 16 October 2019, about 5 years ago
Updated 24 November 2023, about 1 year ago

Problem/Motivation

Token implements token hooks for various core modules. These implementations are placed in the token.tokens.inc file. To counter the fact that this file isn't included at the time (for example) the field_tokens() implementation is called there is an implementation of hook_module_implements_alter which attempts to move the implementation of the token module to the top of the implementations list ensuring that the token.tokens.inc is included and thus the field_tokens() exists and can be executed.
This implementation only works on the assumption that the implementation change made by the module remains, it however is possible for other modules to also change the implementation listing which can unexpectedly break the token handling.

An implementation that works based upon the assumption of a certain include path seems inherently wrong.

Proposed resolution

There are two logic ways to resolve the issue

  1. Move the third party implementations into the token.module file, ensuring that they are always available
  2. Always include token.tokens.inc from the module file.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands erik frΓ¨rejean πŸ΄β€β˜ οΈ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024