6

I have a fairly extensive plugin system that I wrote.

It uses an MVVM pattern, where the lions' share of the code is in a cross-CMS class.

I haven't submitted the Drupal plugin to the Drupal repo, because it does not follow their coding conventions.

It has extremely rigorous coding conventions; just not the ones prescribed by Drupal.

Fair enough. They have every right to dictate coding standards. That's a good idea, and I support it.

However, I can't rewrite the MVVM library to make just one of the targets happy.

Since the MVVM library is actually a submodule, can I submit the plugin to the Drupal repository if the Drupal-specific parts (just a couple of files) are set up to use Drupal standards?

For that matter, since Git is so horrible with submodules, I wonder if the Drupal repository can even handle submodules.

5
  • 1
    A decent IDE can format your code for you.
    – Pinoniq
    Commented Apr 28, 2015 at 6:00
  • Thanks, but I don't use an IDE for PHP/JS/XML/HTML; only for ObjC. I'm not a huge Eclipse fan, as I have to basically reinstall all the good parts every time I update my main OS. Commented Apr 28, 2015 at 15:15
  • 1
    Even if a decent IDE can do the formatting, it will be a hassle to do so for every target. Excellent question. By the way, take a look at the NetBeans for PHP IDE. It's awesome to say the least. Cheers.
    – Mario Awad
    Commented Apr 29, 2015 at 8:11
  • @Mario Awad Thanks for the suggestion. I've not looked at NetBeans before, and I'll take a gander at it. I'm pretty used to just using BBEdit and ForkLift. Commented Apr 29, 2015 at 13:21
  • @MAGNAWS I'm sure you'll love NetBeans then. Debugging, refactoring, jumping to method definitions or usages easily, find and replace, GIT support, all with keyboard shortcuts, and many other features. Cheers.
    – Mario Awad
    Commented May 1, 2015 at 9:00

2 Answers 2

8

Since the MVVM library is actually a submodule, can I submit the plugin to the Drupal repository if the Drupal-specific parts (just a couple of files) are set up to use Drupal standards?

Yes, as long as your Drupal project conforms to the GIT repo policy - where just one of terms are: "All code should comply to the coding standards." you can commit it (such projects are known as "bridge modules") to the Drupal repo (provided you have the access level required to do so - the access bar is low for sandboxes, but a lot higher for full projects). Note: You should only commit the Drupal-specific part. The rest has to be hosted somewhere else. Tell your users how to find it, and how it shall be combined with the Drupal-specific bridge.

However, there are other terms, and it looks like the BMLT License, as it currently appears, is a blocker:

"BMLT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version." (my emphasis)

Drupal.org doesn't accept this license for any code in its repo. For code to be permitted in the repo, it must be licensed under: "version 2 of the [GPL] License, or (at your option) any later version". There are no exceptions to this rule.

Provided you can get the license right, there is nothing in the Drupal.org Git Repo Policy that prohibits a bridge module that requires other software (i.e. not packaged on Drupal.org) to be hosted on Drupal.org.

For that matter, since Git is so horrible with submodules, I wonder if the Drupal repository can even handle submodules.

When a bridge module is hosted on Drupal.org (and there are plenty of them there already), it has to be combined with other required bits and pieces manually (i.e. there must be human readable instructions in the README about where to find the other software and how to assemble the pieces). While I can see the beauty of using Git to pull all the pieces together, that is not how it is done. Provided you and your users can deal with a two phase install where a human is required to do the assembly, it is doable.

As noted by Alfred Armstrong in a comment, the convention is to have a directory below the libraries folder (usually sites/all/libraries) to hold files the user must download from elsewhere. Then use the Libraries API module to integrate the bridge with the other files.

4
  • 1
    good writeup, deleted 80% of what I was writing :D
    – tenken
    Commented Apr 27, 2015 at 15:59
  • 1
    The convention is to use the libraries folder (eg sites/all/libraries) for libraries. The libraries module (drupal.org/project/libraries) will help with managing this. Commented Apr 28, 2015 at 11:39
  • I really appreciate that! Great response! Yeah, kinda looks like the fox ain't worth the chase. Not really a big deal, as Drupaliers are a lot more technical than WordPrestonians or Joomlauts. Commented Apr 28, 2015 at 15:11
  • I did want to mention one other thing: The BMLT Serves a rather small, but "pithy" audience that often aren't as technically astute as I'd like, so I really need to supply the plugin as a "complete set." I don't even want to think about the "feedback" (think The Nuge, standing in front of his stacks) I'd get for not making it simple. The only reason that I'd want it in the Drupal Repository, is to remove another install step. Commented Apr 28, 2015 at 15:23
2

I recommend adjusting your coding style to fit with Drupal coding standards for your bridge module, otherwise you're not fully supporting Drupal.

I'd expect you to do the same thing for a Wordpress module, or Plone specific integration module -- follow those communities conventions.

1
  • Well, since the MVVM module is used in all plugins, then that's a showstopper. WordPress doesn't have a standard of code formatting, so that doesn't matter. I used to host in the Joomla repository, but stopped that a while back, because I wanted to use Git (I still need to use SVN for WP, which is a big fat pain). Commented Apr 28, 2015 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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