Do not allow a module and theme to use the same name.

Created on 9 February 2009, almost 16 years ago
Updated 20 August 2023, over 1 year ago

Problem/Motivation

It would be keen if Drupal core were nice enough to alert you if you tried to register a module and theme of the same name... but it doesn't.

If you name your theme and a module the same name you get name space collisions. E.G samename_block(..) will conflict if you have it declared in both module and theme.

It would save a lot of new Drupal developers frustration if Drupal didn't let you register a theme and active module by the same name.

Also noted here http://drupal.org/node/143020

Steps to reproduce

Proposed resolution

Add a new exception \Drupal\Core\Extension\ExtensionNameReservedException. Throw that exception when installing a module or theme with the same name as an installed extension.

The text for the exception messages:
Module name $module is already in use by an enabled theme.
Theme name $key is already in use by an enabled module.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

11.0 🔥

Component
System 

Last updated about 22 hours ago

No maintainer
Created by

🇺🇸United States MartysMind

Live updates comments and jobs are added and updated live.
  • DrupalWTF

    Worse Than Failure. Approximates the unpleasant remark made by Drupal developers when they first encounter a particular (mis)feature.

  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

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