We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10378
    • 375 Posts
    As we released our first commercial add-on for MODX, I'm concerned about how to license the full package:

    It's the nature of MODX add-ons to be at least linked to code or libraries released under the GPL. A few scripts in our complete package (which consists of about 170 self written php scripts) includes some functions or code parts which were released under GPL by it's original authors.

    So, as far as I understand, our complete package also needs to be released under a GPL license. Is this true?
    If so, how can I ever sell copies of my add-on, if I need to provide the full sources and everyone could simply use them for free - or even redistribute them?

    Does it make sense to put over a year of work into a premium add-on, which then needs to be licensed under the GPL?

    How should we handle this?
    Any hints?

    Maybe @modmore could share their thoughts, as they are the first big players in commercial MODX add-on development?

    Greetings,
    Martin
      Freelancer @bitego http://www.bitego.com
      ---
      GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
      More infos here: http://www.bitego.com/extras/goodnews/
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      No. Using APIs from GPL programs does not require using a GPL license.

      If you actually copy code from any of the MODX core .php files, then yes, your application must be licensed GPL.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 27708 MODX Staff
        • 2,502 Posts
        Our approach has been that if you're building your addon's using the API, the GPL doesn't infect your code. I am not a FOSS lawyer (nor a lawyer of any kind) We believe that selling supported premium addons is a valid way to earn a living. This post from Ryan is his take on it: http://thrash.me/tech-and-modx/modx-and-the-gpl.html
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 10378
          • 375 Posts
          The problem with add-ons of this size (about 190 PHP and JS scripts) is, that it's nearly impossible not to reuse code parts from existing scripts without reinventing the wheel each time. ExtJS code parts are especially affected. And also some common PHP methods...

          For example:

          The following well known methods are from MODX core or some GPL licensed add-ons and reused nearly in every add-on I had a look at. Even ContentBlocks from @modmore has this code inside. Doesn't this require GPL?

              public function getChunk($name, $properties = array()) {
              
                  $chunk = null;
                  
                  if (!isset($this->chunks[$name])) {
                      $chunk = $this->_getTplChunk($name);
                      if (empty($chunk)) {
                          $chunk = $this->modx->getObject('modChunk', array('name' => $name));
                          if ($chunk == false) return false;
                      }
                      $this->chunks[$name] = $chunk->getContent();
                  } else {
                      $o = $this->chunks[$name];
                      $chunk = $this->modx->newObject('modChunk');
                      $chunk->setContent($o);
                  }
                  $chunk->setCacheable(false);
                  
                  return $chunk->process($properties);
              }
          
              private function _getTplChunk($name, $postfix = '.chunk.tpl') {
              
                  $chunk = false;
                  
                  $f = $this->config['chunksPath'].strtolower($name).$postfix;
                  if (file_exists($f)) {
                      $o = file_get_contents($f);
                      $chunk = $this->modx->newObject('modChunk');
                      $chunk->set('name',$name);
                      $chunk->setContent($o);
                  }
                  return $chunk;
              }
          


          Also most processors reuse code in each add-on I know. [ed. note: gadgetto last edited this post 12 years, 7 months ago.]
            Freelancer @bitego http://www.bitego.com
            ---
            GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
            More infos here: http://www.bitego.com/extras/goodnews/
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            There's a difference between reusing code (e.g. a processor extending modObjectCreateProcessor) and shipping the code (including the modObjectCreateProcessor code in your package), and in my perspective as long as you're doing the first it should be fine with whatever license you come up with. You're not shipping the core, so the GPL license should not be a hurdle.

            I do try, if relying on other libraries that are included in the package, to make sure they are licensed MIT and not GPL, as that's just a lot "safer" from a licensing perspective. Or for non-open source things like Redactor that they allow commercial distribution. Especially if packages are the cornerstone of a tool.

            That piece of code that Shaun wrote has been floating around for years and I don't know if he added a specific license to it. Plus it has also evolved over time with small tweaks so is not exactly the same as his work anymore.
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 10378
              • 375 Posts
              Quote from: markh at Mar 13, 2014, 05:33 AM
              There's a difference between reusing code (e.g. a processor extending modObjectCreateProcessor) and shipping the code (including the modObjectCreateProcessor code in your package), and in my perspective as long as you're doing the first it should be fine with whatever license you come up with. You're not shipping the core, so the GPL license should not be a hurdle.

              OK, thats clear.

              Quote from: markh at Mar 13, 2014, 05:33 AM
              That piece of code that Shaun wrote has been floating around for years and I don't know if he added a specific license to it. Plus it has also evolved over time with small tweaks so is not exactly the same as his work anymore.

              Mark, this code was only a sample (maybe a bad one). But tweaking a code doesn't remove the GPL requirement. There are so many other code parts we reuse in each project so it's very hard to say if its under GPL or not.

              The point is this: http://thrash.me/tech-and-modx/modx-and-the-gpl.html
              So currently we should be on the save side.

              Greetings,
              Martin

                Freelancer @bitego http://www.bitego.com
                ---
                GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
                More infos here: http://www.bitego.com/extras/goodnews/
                • 22303 MODX Staff
                • 10,725 Posts
                My advice: copyright your code in any way you like but license it GPL and there is no problem for you and no lock in for your customers. It's a win+win situation and you can avoid this whole discussion.

                You value is generated by your ability to support and improve the software, and let's face it, this is PHP—you are going to have to jump through flaming hoops to obfuscate your code anyway. Keep it Open Source.

                As for reusing code, same thing. Keep the license and attribution and there is no problem. But always get permission from the author if you want to reuse code without maintaining license or attribution.
                  • 10378
                  • 375 Posts
                  Quote from: opengeek at Mar 13, 2014, 08:11 AM
                  My advice: copyright your code in any way you like but license it GPL and there is no problem for you and no lock in for your customers. It's a win+win situation and you can avoid this whole discussion.

                  This is exactly the part I don't understand Jason: How could I copyright my code and at the same time license it under GPL. The GPL would allow everyone to reuse, modify, redistribute and even resell the package and I won't see one single Euro for over one year of hard work. How can this be a win + win situation?
                    Freelancer @bitego http://www.bitego.com
                    ---
                    GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
                    More infos here: http://www.bitego.com/extras/goodnews/
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Just because something is GPL doesn't mean you can't charge for it; you can package up whole sites including the MODX core and sell them as long as you maintain the GPL license if you want to. It's been established over the years that it won't lose you any business, and anybody who does rip off your stuff to pass off as theirs will do it no matter what your license is.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org