Entity type does not exist

Created on 30 May 2025, 4 days ago

Problem/Motivation

On one of my sites, I'm getting this error:
The action plugin comment_unpublish_by_keyword_action can not be initialized. ECA is ignoring this action. The issue with this action: The "comment" entity type does not exist

Steps to reproduce

  1. Enable the action module.
  2. Keep the comment module disabled.
  3. Create a simple ECA module.
  4. You will see the error mentioned above in the Drupal logs.

Proposed resolution

This error stems from another module that defines an action dependent on a specific entity type that does not exist. Since ECA loads all actions without checking whether the required entity type exists, it throws an error.

To fix this, I propose that while loading actions, ECA should verify whether the corresponding entity type exists. In this patch, I’m addressing the issue for the "comment" entity type only, but I hope the module's maintainer will extend the fix to handle all entity types.

šŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

šŸ‡ØšŸ‡¦Canada hargurpreet Kitchener

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

Comments & Activities

  • Issue created by @hargurpreet
  • šŸ‡©šŸ‡ŖGermany jurgenhaas Gottmadingen

    Well, the error comes from the fact that the action plugin should not exist, if it depends upon comments, but doesn't make sure that they really exist, or are enabled. The patch would just heal a symptom, but the error is not within ECA. That's why ECA is trying to not crash and just reporting about the problem, but the solution needs to be found elsewhere. In this case, you need to report this in the action module and ask them to declare the comment module as a dependency or to remove that action plugin.

    In general, contributions like this are very welcome. But please don't provide patch files any more. The workflow for contributions is based on issue forks and merge requests.

Production build 0.71.5 2024