Module don't appear on the extend page

Happy new year all!

I’m trying to create a new custom module from scratch, but it doesn’t show up on the extend page.

Just a test module to add a filtered log list to the dashboard.
The module lives in web/modules/custom/farm_dash-withdrawal

/opt/drupal/web/modules/custom/farm_dash-withdrawal# ls -l
total 12
-rw-r--r-- 1 www-data www-data 179 Jan  1 09:47 farm_dash-withdrawal.info.yml
-rw-r--r-- 1 www-data www-data  72 Jan  1 09:45 farm_dash-withdrawal.module

.info.yml:

name: Farm Dash Withdrawal
type: module
description: 'Custom module to list animals with an active withdrawal period.'
core_version_requirement: ^9 || ^10
package: farmOS Contrib

.module

<?php
/**
 * @file
 * Contains hook implementations for My Module.
 */

Do I need more files?

1 Like

Ah… seems the - in the name is no good idea.
Changed very farm_dash-withdrawal to farm_dashwithdrawal.

2 Likes

Ah yea module naming rules are an upstream Drupal thing that we inherit: https://www.drupal.org/docs/develop/creating-modules/naming-and-placing-your-drupal-module

  • It must start with a letter.
  • It must contain only lower-case letters, digits, and underscores.
  • It must not contain any spaces.
  • It must not be longer than 50 characters.
  • It must be unique. Your module should not have the same short name as any other module, theme, theme engine, or installation profile you will be using on the site.
  • It should not be any of the reserved terms : src, lib, vendor, assets, css, files, images, js, misc, templates, includes, fixtures, Drupal.
2 Likes