Links
Sandbox: https://www.drupal.org/sandbox/ronslow/2376897
Git clone: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ronslow/2376897.git privacybuilder
Automated review: http://pareview.sh/pareview/httpgitdrupalorgsandboxronslow2376897git
Smooth Review: Quick tips checklist
- Application checklist: TODO
- Review bonus: TODO
- Intended Drupal version: 7
- Avoid 3rd party code or images: TO FIX
- Similar modules: mparker17 could not find any.
- XSS vulnerabilities: There is one that's unavoidable, so the permission needs to be given
'restrict access' => TRUE. - Translatable: TO FIX
- Uninstall variables:
privacybuilder_userneeds to be deleted when the module is uninstalled. - Automated Project Application Review
Problem/Motivation
PrivacyBuilder is a service which manages user consents in compliance with EU data protection law - see https://privacybuilder.eu/home.html
This module integrates Drupal with PrivacyBuilder.eu by adding PrivacyBuilder consent widgets to the registration and user profile pages.
Proposed resolution
Give ronslow permission to promote privacybuilder to a full project.
| Comment | File | Size | Author |
|---|---|---|---|
| profile.jpeg | 152.84 KB | ronslow | |
| regitration.jpeg | 114.48 KB | ronslow | |
| config.jpeg | 114.48 KB | ronslow |
Comments
Comment #1
ameymudras commentedHello,
Please review at least 3 projects and add the urls of reviews on your issue page so that community members will consider reviewing your code.
Here is my observation on your module:
1. Where ever possible try making use #attach to attach js rather than drupal_add_js
2. Make use of t() function
'#markup' => '<div id="consents"></div>'3. The code has indentation issues. make use of pareview.sh or coder module
4. There is a un necessary temp file of the module
Comment #2
mayurjadhav commentedHi Robert!
Automated reviews
There are many errors reported by automated review tools, did you already check them? See
http://pareview.sh/pareview/httpgitdrupalorgsandboxronslow2376897git
Manual review
1. Coding standard is very poor, I think you didn't follow the Drupal coding Standards.
2. Don't commit junk files, use git diff before committing code.
3. Info file has only one line of incorrect code
"name = PrivacyBuilder" name should be like this,
name = "PrivacyBuilder"
missing version like 7.x
4.
Not able to enable module
5.
Don't use file path directly, Make use of drupal_get_path()
e.g.
Comment #3
ronslow commentedThanks for reviewing this guys.
I wasn't aware of paraview, so that was really helpful.
Have updated the git.
Hope everything is in order now.
The comment from DrupalPractice is a false positive because I have to use $form_state['input'] rather than $form_state['values']
Thanks
Robert
Comment #4
ronslow commentedForgot to set status to "needs review"
Comment #5
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #6
IcreonGlobal commentedIn my testing, I have found one syntax error when I enabled this module.
Parse error: syntax error, unexpected '[' in ..\sites\all\modules\privacybuilder\privacybuilder.module on line 178
Thanks
Comment #7
ronslow commentedOh. Thanks ICreon
Yes, for PHP < 5.4 I cannot access an array return value from a function directly with square bracket.
Need a temp variable.
Now in place
Could someone certify me for public access?
Thanks
Robert
Comment #8
ronslow commentedComment #9
sendinblue commentedFor review by me
Comment #10
sendinblue commentedHi @ronslow, I had time to review your module and found some issues:
Manual Reviews
- Please keep the standard of drupal issue to promote your project. Please read carefully this article.
https://www.drupal.org/node/1011698
- Please remove .gitignore file in git source.
- All variables used in your module should be removed when uninstall. For example, 'privacybuilder_infofield_map'.
You can use varaible_del() function in hook_uninstall
- Please add your permission role (administer privacybuilder settings) in hook_permission().
- Drupal prefer drupal_base64_encode() function over the use of base64_encode(). Please use drupal_base64_encode() function instead of base64_encode() function in your module.
Comment #11
ronslow commentedThanks very much SendinBlue
I have made those changes, and hope that the module is ready to be approved.
Robert
Comment #12
ronslow commentedI hope it's OK to raise the priority here - I have been a month in the queue.
I would love to be able to help with the bonus program but unfortunately I am not an experienced Drupal developer.
Robert
Comment #13
mparker17Automated Review
The automated review still found a lot of best-practices and coding-standards violations. See http://pareview.sh/pareview/httpgitdrupalorgsandboxronslow2376897git for more information.
In two places, you added items to $form_state['values'] from $form_state['input'] manually, but Drupal does this automatically in
drupal_form_submit().The docblock for
privacybuilder_admin()says it "Implements hook_admin()." but there is no hook_admin() in Drupal 7. Rather, it's a a hook_menu() page router callback function.Manual Review
administer privacybuilder settingsallows a user to insert raw JSON (or their own malicious JavaScript; i.e.: XSS attack) into the page. As far as I can see this is intentional and unavoidable, but theadminister privacybuilder settingsrole should be defined with'restrict access' => TRUE. Seehook_permission()for more information.Possibly insecure:
privacybuilder_admin, the there is a form control namedprivacbuilder_infofield_map(note the missing "y"); but the rest of the code, including it's#default_valuerefer toprivacybuilder_infofield_map. The difference in the spelling of the name of the form control will cause the data entered in this field to be saved to a variable name that is never used elsewhere in the module; and other parts that read from the correctly-spelled variable name will get a NULL value.privacybuilder_usernameand other parts refer to a variable namedprivacybuilder_user. If this is intentional, you will need tovariable_delete('privacybuilder_user')inprivacybuilder.install::privacybuilder_uninstall().mp_client.js. This should be removed before release.The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #14
mparker17Accidentally set the wrong category.
Updating the issue summary.
I also noticed that there are some translatable text problems:
privacybuilder_form_user_profile_form_alter(), the label "Consents" is not translatable:titleanddescriptionstrings inprivacybuilder_permission()need to be wrapped int()functions.mp_client.js(e.g.:"Forget me") which need to be wrapped withDrupal.t(): see https://www.drupal.org/node/304258 and https://www.drupal.org/node/114774#javascript-translationComment #15
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.