User login

Drupal 7 module development gotchas

First we discovered that you need a .module file for your module to be recognized. A .info file is not enough. (In this case, we only wanted the .install file, we made an empty .module file, and all was well. But then we wanted to add some functions to that empty .module file...)

Now we have found that you need to declare

files[] = agaric_example.module

in your agaric_example.info file for your agaric_example.module to be read!!!

This is a gotcha that'll get ya before you even get going. So declare your .module as a file you want in your .info file and be on your way to Drupal 7 module-making goodness.

Resolution

Comments

This may have been a bug...?

... This is not a pre-requisite in Drupal 7 - perhaps a bug in an early release?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.