Drupalcon notes: Best Practices in Contrib Development and Support

domesticat's picture

For new, improving, and prospective module maintainers.

What's expected

You're not forced to do anything. However, if you post it, you're endorsing it. At that point, you have some responsibility. You'll need to work with the security team on fixing vulnerabilities, and support your code. Clearly communicating your intentions to your users is good, too. Poorly maintained projects give us a bad name.

Best practices: Community Management

How to enlist help:

Finding maintainers / co-maintainers:

  • Put it on your project page
  • Blog, tweet, IRC, etc
  • What makes you a good co-maintainer? Involved with issue queues, IRC, forums; likes communicating; Sloppy Sam
  • http://drupal.org/node/363367

Good tips:

  • Be responsive.
  • Involve community members.
  • Provide docs!
  • Train contributors.
  • http://drupal.org/node/467548 templates for issue status transitions
  • Remember that not everyone speaks English natively.

Best practices: Drupal Project Management

When to branch? How to maintain branches?

Release management:

Source code control:

Coding Best Practices

  • http://drupal.org/node/1354 - Doxygen doc standards
  • http://drupal.org/project/api - make your own API site!
  • http://drupal.org/handbook - put a doc page for your module in the Drupal handbook
  • Add README.txt and INSTALL.txt files to your module.
  • If your module provides hooks, make a mymodule.api.php file.
  • Always start with the module's short name
  • Avoid collisions
  • Files: mymodule.stuff.inc
  • Functions are generally modulename_noun_subject
  • Constants: define('MYMODULE_STUFFED', TRUE);
  • Hooks: function hook_mmodule_stuff_alter()
  • Classes: class MyModuleTestCase
  • Don't ever give a module, theme, or install profile the same name

 Testing

Drupal standard methods and APIs

Internationalization (i19n)

  • Learn to use t() except in hook_menu() and watchdog()
  • Crucial: it lets your site be localized, but lets you change string presentations in an English site using locale or stringoverrides
  • http://drupal.org/node/322729 - Localization API handbook
  • http://localize.drupal.org - localization site
  • http://localize.drupal.org/translate/projects/$project/warnings - localization warnings for your drupal project.

Make your module themable:

Post new comment

User login

Recent comments

  • Anonymous 3 days 11 hours ago [view]
  • Charli 2 weeks 3 hours ago [view]
  • quiltmom anna 3 weeks 3 days ago [view]
  • rslatkin 3 weeks 5 days ago [view]
  • Donna 3 weeks 6 days ago [view]

Search

Hello, anonymous!

If you're seeing this, you're not logged in. A lot of content here is only visible if you're logged in, and comments by anonymous users are held for moderation. Consider getting an account to save yourself some frustration?

domesticat.net

is the home of Amy Qualls-McClure since 2000. She is a Drupal / quilt geek in Huntsville, Alabama. One spouse, two cats, no kids, lots of opinions.

Public account for work and Drupal stuff: Private account for friends and personal life:

me on plurk me on drupal.org my music habits on last.fm my photos on flickr my bookmarks on del.icio.us my bookmarks on pinboard.in Amy Q. on foursquare what I'm reading

Some content is locked. Copy these links AFTER logging in for a query string giving you full feed-reader access:

Atom feed, entries RSS feed, entries RSS feed, comments