Custom modules only partially functional with uppercase characters in module name

Created on 12 February 2018, over 6 years ago
Updated 24 June 2023, 12 months ago

/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php converts module names to lowercase in getProviderFromNamespace(), which causes any modules named with uppercase characters to not match the file system name on case-sensitive file systems.

Our test case has been using blocks. When the module name uses uppercase characters the block will not load. Once renamed to all lowercase it loads. Hooks in the .module file work fine regardless of case. This issue only applies to code that relies on the annotation discovery.

What I've seen so far is that this was added in https://www.drupal.org/files/issues/2294177.1.patch β†’ for issue https://www.drupal.org/node/2294177 β†’ . The issue is discussing the need to change "Core" to "core" in entity config, however this patch affects all modules and not just the places in core that needed to be changed. The final comment mentions that it is a hack, but was approved to get to beta.

I propose adding an if to check for "Core" and only changing that to "core", while allowing all other modules to retain their proper casing. I've been testing with this change since 8.3.x and it has been working for us.

✨ Feature request
Status

Closed: outdated

Version

9.5

Component
ExtensionΒ  β†’

Last updated 3 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States ASA DBank

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.69.0 2024