1

I'm writing a Drupal module and I want to make use of a JQuery plugin, but I'm unsure if I'm a) breaking any rules and b) if there are any licensing considerations.

My question is can I use plugins and what is the best way to include them (i.e. in the libraries folder or as part of my module or via something third party).

3

Do you intend to publish your module as a contributed module on drupal.org? In that case: Probably not. The page 3rd party libraries on Drupal.org states:

This is the policy for 3rd party code libraries in Drupal's contribution repositories.

  1. In general 3rd party libraries are forbidden, so do not commit any. Document for your users how to find and install it.

After that, it mentions some exceptions.

I understand that it's tempting to include the plugin in your module, but there are some good reasons not to. For instance:

  • If other modules use the same plugin, having it in the libraries folder will prevent collisions.
  • Users will always be able to get the latest version of the plugin.
  • You, as module maintainer, probably do not want to be bugged about releasing a new version every time the plugin is updated.
  • 2
    The Libraries module helps dealing with third party libraries: drupal.org/project/libraries – Pierre Buyle May 11 '12 at 15:22
  • I guess it's still interesting to note that Drupal itself comes bundled with JQuery which is a 3rd party library. I am intending to publish so I will see how it goes, but thanks for a good answer – Sprog May 14 '12 at 9:19
  • Drupal core includes jQuery since the release of D6 on February 13, 2008. The "no 3rd party libs" policy dates from April 3, 2009. I assume jQuery cannot be removed from core all of a sudden because of compatibility / upgradability. – marcvangend May 14 '12 at 12:49
1

http://jquery.org/license/

You don’t have to do anything special to choose one license or the other and you don’t have to notify anyone which license you are using. You are free to use a jQuery project in commercial projects as long as the copyright header is left intact.

http://en.wikipedia.org/wiki/MIT_License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

To sum it up - you can use it and it is up to you to choose how - the libraries folder is what you want

  • Ahh, but the problem with the libraries folder is that whoever installs the module then has to download the library. I would rather it came packaged with my module – Sprog May 11 '12 at 14:18
  • If it's GPLv2/3, you can. (this applies to images also). See how most of the jquery slideshow modules and smtp auth module have included javascripts/classes. – AyeshK May 13 '12 at 3:19
0

Some modules provide a drush script for downloading the libraries. See CKEditor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.