1

Following the instructions in the documentation for creating a custom module, I created a directory modules/custom/my_module and put a my_module.info.yml with some minimal contents like this:

name: 'My Module'
description: 'Does some stuff'
package: 'Custom'

type: module
core: 8.x

In that documentation page, directly after the section that describes the info.yml file, there's a section called "Debugging .info.yml files" and the first item there is "Module is not listed on admin/modules". I'm assuming that means that after I created the info.yml file in the right place, the module should be listed on admin/modules.

Is that assumption correct, or do I need to get farther along in the process before the module is listed on admin/modules? Is there something I need to run to refresh the list or should Drupal be able to find the module automatically as soon as the info.yml file exists, even though there's nothing else in it yet?

closed as off-topic by Shawn Conn, kiamlaluno Sep 18 '18 at 9:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question was caused by a problem that can no longer be reproduced, was solved by a cache clear, or was a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers." – Shawn Conn, kiamlaluno
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Did you try uninstalling or installing a module to see if the list of modules does then include yours? – kiamlaluno Sep 17 '18 at 18:40
  • That should be enough - you used to need a .module file but not any more. You could try rebuilding the cache, although if memory serves I think just visiting the modules page should refresh the list (in theory) – Clive Sep 17 '18 at 18:40
  • Sorry, I had to step away from my desk unexpectedly right after asking the question. I haven't tried either of those things, but I will when I return. Thanks for the suggestions. – Don't Panic Sep 17 '18 at 18:45
  • 1
    To make it clearer: The Drupal 8 documentation says that a .info.yaml file is sufficient for Drupal to recognize a module, and that has not changed. If the list of modules doesn't show the new module, Drupal is showing the list it has in its cache. – kiamlaluno Sep 17 '18 at 21:28
  • @kiamlaluno Thanks for the clarification. I actually just figured out why the new module wasn't showing up. My app is running in a container and it turns out that my working directory is not synced to the container like I thought it was. – Don't Panic Sep 17 '18 at 21:33

Browse other questions tagged or ask your own question.