Contrib Development Best Practices

Events happening in the community are now at Drupal community events on www.drupal.org.

Contrib developers often need some help figuring out the best way to maintain their modules, both strategically and tactically.

This can include (but is not limited to)

  • git best practices in contrib (branch naming? How to commit patches? How to commit my own work?)
  • How to manage the issue queue
  • How to deal with difficult people in the issue queue.

When we reach consensus and develop some quality material, it can move over to the Best Practices section of the Handbook (under Start a new project).

Inconsistent drop-menu activation

Posted by charles belov on February 18, 2021 at 2:05am

Is there a standard for keyboard activation of drop-down menus? We are using multiple drop-down menus from various sources which behave differently from one another. Technically speaking, each individual jump menu is WCAG 2.0 AA accessible because it can be navigated keyboard-only, but the technique for opening the menu varies from menu to menu.

I can't imagine that to be a pleasant experience for site visitors, but I also can't seem to find documentation from an authoritative source for a standard menu-open behavior that could (theoretically) be applied across all drop-down menus.

Is there a standard? Where is it documented? If there is no standard, is there a way to force a single behavior across incompatible drop-downs or else enable forgiving actions? If not, is there a reasonable way, e.g., through appropriate ARIA labeling, to communicate the correct way to access a particular drop-down menu without forcing the site visitor to figure it out for themselves?

I despair of keyboard-only visitors being able to achieve mastery of drop-down menus on websites.

Details follow:

Read more

Use of word "fungates"

Posted by charles belov on July 29, 2020 at 8:24pm

I noticed the following language in the hook documentation comment of a module hook-alter:

Function that fungates as last resort to alter the pre_render build.

/**
* Implements hook_field_group_pre_render().
* Function that fungates as last resort to alter the pre_render build.
*/

The only definitions I can find for "fungates" have to do with fungus, which I doubt is what is intended. But I get lots of search results if I search on Drupal and fungates, so it's apparently in common use.

Read more

Modules *should* implement hook_help()

Posted by mario steinitz on February 9, 2018 at 5:09am

Having reviewed a module recently within the Security Advisory Coverage application queue, a discussion came up of whether hook_help() must be used or should be used to comply with the module documentation guidelines.

The guidelines state

All but the most trivial modules should implement hook_help().

in bold letters.

Read more

Best practices for deprecating old module/adding new release

Posted by charles belov on January 26, 2012 at 9:34pm

I'm wondering what is the best practice for creating new releases of modules and deprecating the old version, in terms of maintaining security while the new version proceeds to release status. I'm asking this as a Drupal newbie.

Read more
Categories: ,

Wastelands group defunct/not needed?

Posted by pwolanin on March 20, 2011 at 4:54pm

This group looks defunct and will be merged or deleted in 1 week.

Especially with the availability of sandbox projects, and the frequent pushing of code to places like github this seems a solved problem.

Read more

Recommended Markup Guide for Modules

Posted by mlncn on March 20, 2011 at 3:27pm

I'm referencing the Drupal Markup Style Guide g.d.o wiki in the Definitive Guide to Drupal 7 and it hasn't been updated in a couple years so i wanted to give all interested parties, especially HTML5 folk, foreknowledge to update it (or link it to a d.o equivalent?).

Advice is sound and it's the most comprehensive take i've seen from a module developer's perspective, so that's why i'm providing the link: http://groups.drupal.org/node/6355

Read more

Sprint based development for Drupal 8

Posted by arianek on March 16, 2011 at 7:58pm

Hi Drupalfolk -

I documented a bunch of the ideas/discussion points from Dries' D8 core convo on a blog post:

http://affinitybridge.com/blog/drupal-8-git-sprints-efficient-smooth

I am considering making a page/section in the Initiatives section on d.o but would really like a bit more input first - I got a lot of positive tweets and a couple more detailed comments, but I still am not sure exactly how much support there would be for this, nor how much more detail would need to be hashed out for it to become a method that people would be comfortable experimenting with.

Read more

Package names for contributed modules (Drupal 7)

Posted by mlncn on October 4, 2010 at 3:02pm
Last updated by mlncn on Wed, 2019年10月16日 19:20

Modules are grouped on the module administration page (admin/modules in Drupal 7) by package, which is defined, optionally, in our module's .info file. Package, then, is the most visible way in which modules are categorized. This wiki page documents package names chosen by module maintainers, please edit it!

Read more
Categories:

Package names for contributed modules

Posted by mlncn on September 28, 2010 at 1:33pm

Modules are grouped on the module administration page (admin/modules in Drupal 7) by Package. Sensible grouping can greatly enhance site builders' Drupal experience. (Package is defined, optionally, in our module's .info file.) As developers of contrib modules, we can come to this wiki page before choosing our package name to see what other thoughtful module developers have chosen for their package.

Read more

Should the docs style guide apply to interface text?

Posted by arianek on September 15, 2010 at 8:05pm

A ping in #drupal-docs earlier has brought to my attention that the Docs style guide only applies to handbook and not explicitly to interface text in Drupal core/contrib.

I'd think it should apply so we get consistent text and grammar formatting Drupal-wide, but didn't want to make such a sweeping declaration without some consensus from the community at large.

Read more

Drupal.org policies on module behaviour

Posted by xurizaemon on July 1, 2010 at 10:38pm

I posted this question yesterday after seeing some contrib code (not yet submitted) which included HTML tags to track module installations.

I'd appreciate any pointers or feedback on the practice, and how we can educate contrib developers about what practices are and aren't acceptable in code hosted on Drupal.org.

I don't know of any specific security or privacy policy this practice would be forbidden by, even though to me it seems clear that the practice wouldn't be acceptable.

Thanks in advance!

http://twitter.com/grobot

Read more

Call hook_node_access_records() from custom function

Posted by DrupalCuckoo on June 29, 2010 at 3:13pm

hi,

usually the hook "hook_node_access_records($node)" gets called when you hit the save-button on the edit page of a node. I need to call this function outside the edit-form.

I'm building a custom content-privacy module and I need to call this function for all existing nodes filtered by content-type (for example all blog nodes).

The problem I have is that this hook needs a node-object as a parameter. When being on a node-edit page (node/[NID]/edit) this object will be available. But when I don't edit a node I have no node-object available.

Read more

Proposal for "Best Practices in Contrib Development" Drupalcon session

Posted by rfay on February 8, 2010 at 2:04am
Last updated by rfay on Wed, 2010年04月07日 17:49

I'd like to get some of you great people to give a panel discussion on best practices. Here's a proposal - edit it! Who would be willing to lead it? Who has something to offer?

Session Proposal: Best practices in Contrib development and support

Contributed modules and themes are fundamental to the Drupal experience, but the quality varies oh, so widely.

How can we improve our development process, keep modules maintained, help maintainers, and somehow harness the explosion of modules.

This forum will cover:

  • What's expected of a module maintainer
  • How to keep the modules you maintain from overwhelming you
  • How to get help from others
  • Finding maintainers, abandoning projects, dealing with abandoned projects
  • Best practices in CVS, including when to branch, and how to maintain branches
  • Best practices in patch issue workflow
  • Best practices in the issue queue: How to enlist the community, deal with support, and deal with newbies.
  • Avoiding duplication in contributed projects
Read more

Branch versioning across Drupal versions

Posted by ilo on January 22, 2010 at 9:06am

So, I've got a question pointed by a services module discussion.. What should be the best practice for contributed module versioning when Drupal version is updated, keep current contrib versioning?

Read more
3 comments Categories: ,

Methods of managing commits, patches, and issues

Posted by rfay on January 13, 2010 at 11:53pm
Last updated by rfay on Wed, 2010年01月13日 23:53

Here are some notes from a discussion with greggles that influenced me on managing commits and patches:

  • Every commit should be matched with an issue that has a patchfile, just as would be done in core.
  • Every commit should give credit to the contributor of the patch, and a link to the patch. This page gives a great summary

This can seem hard to do in a rapidly developing project, but it gives great discipline to the code.

Read more

CVS Practices for contrib

Posted by rfay on January 13, 2010 at 11:47pm
Last updated by rfay on Wed, 2010年01月13日 23:48

There is a standard Drupal (and maybe everywhere) methodology for managing a project in CVS, but not all of us know about it.

  • Always do new development on HEAD.
  • When the time comes to leave a branch behind (as when beginning Drupal 7 development) branch off the old (like D6) stuff. Continue working on HEAD.
  • You can apply patches from HEAD onto other branches, if you have other branches going.

This is the approach described in the fine Pro Drupal Development.

Please add to this.

Read more

Best Practice notes

Posted by Chris Charlton on November 17, 2009 at 6:42pm
Last updated by Chris Charlton on Wed, 2010年01月06日 19:01

Drupal Coding standards

Follow the [Drupal coding standards] (http://drupal.org/coding-standards). The coding standards provide information on code syntax, white space in code, and currently more development detail than this wiki page.

Required Files

When a module gets too long it is wisest to break up a custom module into the following files:

  • MYMODULE.info - Module declaration file.
  • MYMODULE.module - for Drupal hooks like hook_menu, hook_forms, etc.

Additional Files

Read more

WOW! I'm not alone here anymore!

Posted by eclipsegc on June 16, 2009 at 12:08am

HAHA, welcome everyone, been a while since I checked this group. So, here's the basic need to get us going. I'd really like to put our heads together and start to put a list of features that would be needed for this sort of thing, together. Let's get it started, and we'll see where it goes from there.

Obviously we need some serious taxonomy controls to help make code easier to find and categorize. I'd like to start off by asking what sort of scheme you all think might work best here.

Eclipse

Read more

Wastelands: Let's start thinking about use cases and spec

Posted by joachim on June 14, 2009 at 2:35pm

So I'm at DrupalCamp UK and the topic of this site has come up again.
Lots of developers mention cool modules they've written in-house but aren't releasing because they're too specific to their projects or too raw for a release.

A space where these could be released without too much expectation would mean the next person who needs this feature doesn't reinvent the wheel, but instead can give some time to pushing the code a little more towards being generic and ready for release.

So let's think about use cases for the Wastelands and the spec we'd need.

Read more

Turn it more positive : what about a "Recycling drupal code factory" ?

Posted by julma on June 10, 2009 at 11:31am

I think there is a huge potential in this idea.

There are lot of modules on d.o that are not maintened, and lot more code never published.

A true "recycling drupal code factory" could have several benefits :

To allow the drupal community to better understand the general needs behind lots of "custom modules", reuse some code but also some conception work.

For the beginners users of d.o, a smaller list of contributed modules really maintened instead of a large list of 2000 modules with lot of weird modules would be a huge time saving.

Read more
Categories:
Subscribe with RSS Syndicate content

Contrib Development Best Practices

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /