Project Page: http://drupal.org/sandbox/klopsen/1606640
Git: git.drupal.org/sandbox/klopsen/1606640.git
Module for Drupal 7.
This module integrates Drupal site with Correct.li service. It provides simple configuration and restrictions (per role and/or page) where correct.li widget will appear.
Correct.li lets your users correct your mistakes by selecting text on your website. It provides simple integration with page and a control panel, where you can check users correct propositions. All you need is to register to Correct.li and configure this module on your Drupal site.
More of future features are specified on module's page.
This is my first module and first try of using git so please don't be gentle. :)
Comments
Comment #1
farhadhf commentedWelcome,
Please add the direct link to your sandbox repository in the issue summary.
We really need more hands in the application queue and recommend to get a review bonus so we can review your application sooner :)
While waiting for an in-depth review of you module, you can start fixing some code styling issues detected by automatic tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxklopsen1606640git
Regards
Comment #2
farhadhf commentedJust looked at your code and found this problems:
correct_li_admin_settings_form()is the form callback and it should get 2 parameters,$formand&$form_statet()function should not include any html tags, take a look at http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7variable_get()is NULL, so there is no need to pass an empty string as the second argument.request_uri()function.I found some other problems in your code that I'm not sure about their solutions.. Let's wait for a more experienced developer to jump in! :)
Regards
Comment #3
klopsen commentedThank you for reply!
I cleared code and corrected mistakes.
Comment #4
rrbambrey commentedHi there,
Firstly, nice work! Well comment tidy code, very readable.
You've still got a .info file in your master branch (I noticed when I mucked up the git clone).
Manual review of the 7.x-1.x branch:
configure = admin/config/system/correctlibut your hook_menu() defines the path as admin/config/system/correct_li.I did a quick install and click around - just a couple of suggestions:
Other than those few things, module works great, installs and uninstalls without hiccup using drush. Good work!
Comment #5
klopsen commentedMany thanks for suggestions!
Here's what is done:
New tab is now in settings area - 'panel'. Here you can visit correct.li site in iframe and check your user suggestions without going out to different window. Similar module for WordPress has this feature also.
Comment #6
rrbambrey commentedHi again,
A few more points.
I'm not a big JS user but concerned about the drupal_add_js calls you've added still, have a look here http://drupal.org/node/304258 it seems to shed a lot of light on best practice for including Javascript including php variables. Or there's the general page here http://drupal.org/node/756722.
In correct_li.admin.inc line 25: you could do these links by just putting a placeholder in the t() and using an l() in the parameters rather than hard coding the link tag inside string literal. Also there's no replacement value for !panels in the parameters.
Line 51 also with the l() thing
And again line 135
Other than that I'd say that this is damn good!
Comment #7
rrbambrey commentedComment #8
klopsen commentedThanks for suggestions!
I've cleared all about links - hope it's ok now.
About JS code - I changed generation method - it's now in addictional file. Please check if it's ok and let me know about anything wrong. I never did anything with JS code before.
Module has now new admin features - min/max selected lenght and key combination settings.
Comment #9
Milena commentedPlease, remove everything from master branch and set 7.x-1.x branch as default on version control page
.install file
You do not need to set variable_set('correct_li_language', 'en'); on hook_install. It's what second element is for - to provide default value if variable is not set.
Some if structures also check if variable is empty. It probably won't be, because you are setting the second parameter.
.module file
You may place all the conditions in one line. 80 charecter limit is only for comments and array multiple elements.
Drupal coding standards tells us to use underscore instead of camel case in variable names.
Your $correct_li settings does not follow it.
Some pages might have https:// protocol. Browsers will alert users about unsecure content. If correct.li has it's https version you probably can add //correct.li without protocol, hovewer I'm not sure if Drupal will allow this.
I'm not sure about php_eval, but you have own permission. Consider adding alert in permission description that only user with trusted roles should have this permission because it may result in evaling php code. Or you might add second permission only to trusted users.
admin.inc.php file
Maybe you can add all enabled languages rather than predefined.
You need not to set '#required' => FALSE because it is default option.
The same is with '#multiple'.
.js file
Use Drupal.behavior instead of document.ready.
Whats more you can freely use $("body") instead of jQuery("body"). These two lines make sure of that:
(function($) {
})(jQuery);
Automatic review
Fix issues listed on http://ventral.org/pareview/httpgitdrupalorgsandboxklopsen1606640git
I believe these are not RTBC blockers, and I have not found any security issues. I'm setting into RTBC. If someone thinks otherwise please feel free to change.
@klopsen
Consider getting a review bonus to have your application reviewed sooner.
Comment #10
klausiComment #11
sreynen commentedSorry, this is a release blocker. It's very important security holes like this not make it into releases. This is complicated because you're executing the PHP on every page load, so you would need to limit access to writing PHP to the variable rather than reading PHP from the variable. And because there are a few modules that allow writing to any variable, you don't have a good way of limiting access there.
Your default correct_li_pages value doesn't include PHP. Would it work to just remove the PHP eval functionality entirely?
Comment #12
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
Comment #12.0
klausiGit link added