Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By sevenBananas on
I have written custom module that I am trying to install.
the module is called "scorecard" and all of the files are located in
sites/default/modules/scorecard
and the scorecard.info file is as follows:
;$ID$
name = Scorecard
description = A module for tracking scores
package = Drupal 7 Development
core = 7.x
files[] = scorecard.module
files[] = scorecard.controller.inc
files[] = scorecard.install
I am running Drupal 7.21 and thought that Drupal would just recognize it when I navigated to "Modules" as Admin, but it just doesn't show up. I assume there is something very basic that I am not doing, but at the moment I have no idea.
thanks
Comments
The file seems mostly good.
The file seems mostly good. Browser cache, perhaps?
Minor notes:
;$ID$
is long obsolete (was used back when drupal.org was using CVS);.module
and.install
files do not need to be declared in.info
.Neither of these is likely to do any real harm though.
location-location-location
I would recommend putting the code in sites/modules/all/custom/[yourmodule] and see if Drupal notices it. I don't use default for anything except the files folder and the settings.php.
Perfect
Thanks, that did the trick, created a custom folder & dropped it in and drupal picked it right up
To avoid confusion, custom
To avoid confusion, custom modules should go into sites/all/modules or a subdirectory. sites/all/modules/custom is fine (and not quite what got typed above).
--
www.ztwistbooks.com. Math books that are actually fun.
For the info of others - I
For the info of others - I had this issue and the problem turned out to have been caused by the character encoding of the text editor I'd used to create the custom module. For some reason, my editor (notepad++) was using Macintosh EOL format - something not obvious at all - but this was preventing Drupal from discovering the module.
So my advice to others in this situation, in addition to the responses above, is: check your module's character encoding and EOL format by comparison to another module that works fine.
Thanks for emphasizing location!
Hello. I had the correct path (sites/all/modules/custom), but the wrong installation (have several Acquia Dev Desktop installations). Once I put the .info and .module files into the correct installation, my custom module showed up in the modules list. Thanks again!
Check file extensions
Always double check your file names!!!!
I was tripped up by the file extension, my_module.modules should of been my_module.module
Module in wrong folder
Just in case anyone ends up here looking for an answer and these aren't helping...
I had a similar issue and it turned out that I'd accidentally uploaded the modulename.module file to the sites/all/modules folder in addition to the sites/all/modules/modulename folder. That caused Drupal to think the file was missing. I had to delete the one from sites/all/modules to get it to recognize the one in the sites/all/modules/modulename folder.
*facepalm*
i was searching like ages...
i was searching like ages... thank you so much :)
Don't forgot to add a .module file
A .info file but no .module file would make the module not show up in /admin/modules. Both files need to be present in order for the module to show up in the list of modules. The module list is not cached in Drupal, so this would likely indicate a problem with the file configuration/missing files. Also, the directory for the module must be located in sites/all/modules or sites/all/modules/custom for Drupal to recognize your module.