Rename all Rules events

Created on 19 January 2022, over 2 years ago
Updated 9 July 2024, 2 months ago

This is a follow-up to the Rules Essentials issue: #3257884: Rename events β†’

Motivation:

Drupal core has been gradually adding events over the years, and a pattern has emerged that event names should typically be prefixed with the name of the module providing the event, separated with a period.

While this is not strictly adhered to by Drupal core, and while there are no coding standards or other standards to guide us on this, it does seem like a good practice to follow. Especially since the flat namespace for events is likely to cause problems in the future, just as the flat namespace for hooks and other Drupal API constructs has caused problems in the past. The way to avoid these has always been to use the module name as a prefix.

As this has the potential to be disruptive, I'd rather get us into the habit of using this naming convention now, while Rules is still in alpha. But a hook_update_N() will be provided to update any installed Rules configurations so that existing sites will continue to function after the renaming.

#3257884: Rename events β†’ did exactly this for the Rules Essentials module. The patch here will be modeled after the one in that issue, so if you are concerned about potential problems please try the upgrade path in that module first to see if it causes you any problems. My experience on test sites is that this upgrade works and is reversible in the case it generates unforseen problems.

πŸ“Œ Task
Status

Needs review

Version

4.0

Component

Events

Created by

πŸ‡ΊπŸ‡ΈUnited States TR Cascadia

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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