Closed (fixed)
Project:
SmarTest
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2015 at 15:03 UTC
Updated:
2 Jul 2015 at 20:14 UTC
Jump to comment: Most recent, Most recent file
Hello!
In the source code of your module, you are including a 3rd party library (PHPLOC) that is licensed with a different licene (BSD-3). This breaks the Terms of Service of the usage of the Drupal Git repository: https://www.drupal.org/git-repository-usage-policy
There are options to resolve this. You can integrate your module with the Libraries module (https://drupal.org/project/libraries ) or you could remove the library and add a hook_requirement ( https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func... ) to verify if the user has manually downloaded it.
Regards,
David.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | add_hooklibrary_2504591-21.patch | 30 KB | David Hernández |
| #18 | add_hooklibrary_2504591-18.patch | 30.7 KB | gabrielhruiz |
Comments
Comment #1
gabrielhruiz commentedHello, We have a problem with the best practise for this case. First I'm going to explain how we use the library:
We only use a class of PHPLOC (Analyser in Analyser.php), no the rest of the project. This class has been modified to add new attributes, functions and global variables not has been modified. In summary we use only a file of the total library.
We have received many possible solutions, like to make a fork to PHPLOC, I think that is very tedious for a little part of code that we use.
Is possible to add this class of PHPLOC code as part of smartest module with BSD lisence?
What do you think about the best solution in this case?
thanks @David_Hernández
You can see the class there: https://github.com/sebastianbergmann/phploc/blob/master/src/Analyser.php
Comment #2
David Hernández commentedThis is not about best practices. It's about violating the terms of service of Drupal.org, so it's not possible to keep the file of the phploc library on the source code.
As you said, I think the best solution is to fork the PHPLOC library and only leave the required class with the modifications you need, so it can be included using Libraries or other solution.
Comment #3
gabrielhruiz commentedSorry, I said that we modified PHPLOC library, but now I search the PHPLOC repository and has changes. these changes make that we not have to modified the library. We can use it as it is now. Therefore we use Libraries API to integrate PHPLOC in our module, as you propose.
thank you very much.
Comment #4
gabrielhruiz commentedThe code was modified like appears in "patch Issue #2504591.diff" for this issue.
We have deleted the code of the class Analyser.php of phploc from our module, following your instructions. Now expected to be extracted into 'sites/all/libraries/phploc'.
Comment #5
fran seva commented@gabrielhruiz
The patch is not following the Drupal name signature. Should be a file with the following structure
_#issue-#comment.patch.
In other hand, every time a patch is posted the issue state should be update to Needs Review. In [1] you can check all the drupal issue status and what means.
[1] https://www.drupal.org/issue-queue/status
I change the issue status to Needs Review.
Comment #6
gabrielhruiz commentedSorry, this is the .patch file for this issue.
Comment #7
fran seva commented@babrielhruiz, thanks for the update but I think I didn't explain as well as I supposed :p.
The patch should be something like this: add_hooklibrary_2504591-7.patch where :
- add_hooklibrary is a short issue description
- 2504591: The issue number aka #issue
- 7: The comment number where I'm posting the patch aka #comment
I recommend you use Dreditor [1]
[1] https://dreditor.org/
Comment #8
gabrielhruiz commentedThanks you for the explanation. I add a correct patch.
Comment #9
fran seva commentedComment #10
fran seva commentedWhat I see in the patch.
In line comments should ends with '.'
There are functions without comments.
Comment #11
gabrielhruiz commentedAdd hooks comments and ends comments fixed.
Comment #12
fran seva commented@gabrielhruiz great patch but I think the patch is not correct, I mean the patch only have the comments and should have all the code from patch #8. Also, an interdiff file could be great to check what is new.
Create an interdiff is easy, you only have to create a branch with the patch #8 and other with the patch #11 and execute git diff between the branches.
Also I saw you change the patch name from add_hooklibrary to implement_comment_lines. That's not a problem but I'm not sure if you did it because you believe that each patch have to change it's name depending what you do on it. The patch name, AFAIK, should have a short description of the issue and not the last change it is done.
If you has any doubt you can try to ask in #drupal-es or #drupal-contribute IRC channels
Comment #13
gabrielhruiz commentedUpload patch wich contains the changes only of this issue.
Comment #14
David Hernández commentedThanks for pushing this issue forward!
Here is a small review:
The full path is not required, only phploc/Analyser.php
Libraries can be installed in multiple folders: sites/all, sites/default, sites/[site-name], profiles/[profile-name]... Find more documentation about this here: https://www.drupal.org/node/1342238
Unnecessary capital letter: Implements hook_phploc_libraries_Info().
Should be: Implements phploc_libraries_info().
Shouldn't this hook be hook_libraries_info() / smartest_libraries_info()?
Extra space at the end of line.
Comment #15
gabrielhruiz commentedthis .patch contains changes in other hooks that isn't appear in #14 comment, because were necessary to resolve the problem of .info.
Comment #16
gabrielhruiz commentedThe correct patch with all changes.
Comment #17
David Hernández commentedThere are a few things that can be fixed, but I think this is already good to go.
I don't like this solution, but for now, I think we can go on with it.
CSS files don't need to be at the info file. The files listed here are always included: https://www.drupal.org/node/542202#files
I think this function can be removed.
Should be:
Comment #18
gabrielhruiz commentedLast changes.
Comment #19
David Hernández commentedGood so far. I think this is ready to be commited.
Comment #20
fran seva commentedThe code is good for me too.
Comment #21
David Hernández commentedOk, I tried to apply the patch and didn't apply. The paths were generated incorrectly (maybe because you are not using a direct git clone of the sandbox repository).
This patch is exactly the same as before, but with the paths fixed.
Comment #23
anabsanchez commented