- Issue created by @GrahamShepherd
- Status changed to Closed: works as designed
about 2 years ago 9:21pm 17 September 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Drupals module discovery system favours a module in /modules over one in /core
So if you have both, the contrib one is in useI would recommend removing the contrib one from your codebase for now
We wanted to remove it from core for 10.x but didn't complete it. So for now there are no differences, we hope to remove the core one before 11
- π©π°Denmark ressa Copenhagen
I searched for keywords such as "site:drupal.org module discovery hierarchy", but didn't find a documentation page about this ... So like this Issue Summary says, it seems to be an undocumented feature:
By design, Drupal allows multiple copies of a module in different directory spaces (eg one in /core/modules, one in /modules, one in sites/all/modules).
However, if duplicate copies exist in the same space, this works too, though I assume this is by accident rather than by design. So for example if I have:
- sites/all/modules/foo
- sites/all/modules/contrib/foothen the first one is taken by Drupal, and the second one is simply ignored.
However, because this behaviour is undocumented, it effectively puts the codebase in an unstable state: a developer doesn't know which module is being used by Drupal without inspecting the system table.
From #2647388: Don't allow duplicate modules in the same directory space β .