Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2012 at 01:50 UTC
Updated:
5 Sep 2012 at 11:31 UTC
This module gives the creator of a webform the option to hide make the submission results anonymous, by hiding the user ID and IP of all the users who submitted the webform. More info on project page.
This module is only for Drupal 7+
Project page
http://drupal.org/sandbox/dwieeb/1697964
Dependencies
webform
Git
git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/dwieeb/1697964.git webform_anonymous
Project applications I've reviewed
Comments
Comment #1
primsi commentedHi,
I don't know if that is an issue, but you have a closed Project application.
http://drupal.org/node/1303068
You should fix the coding standard issues listed here:
http://ventral.org/pareview/httpgitdrupalorgsandboxdwieeb1697964git
... where it's also pointed out, that README.txt is missing.
I am not sure about the readability of the "yoda conditions", e.g.:
Comment #2
j2r commentedThere are some coding standard issue please check : http://ventral.org/pareview/httpgitdrupalorgsandboxdwieeb1697964git-7x-1x
and in module there is no README.txt file. It would be better if you can add some instruction of flow of the module in README.txt file.
Comment #3
dwieeb commented@primsi: I deemed that "closed (won't fix)" is an appropriate status for that project. The styling issues have been fixed, and the "yoda conditions" are actually standard in the source code of Symfony. I'll change them if need be..
README.txt has also been added.
Comment #4
primsi commentedRegarding the other application: I din't know exactly what should be done in such cases and just wanted to point it out, so other reviewers would not need to check this.
Comment #5
roynilanjan commentedHere some basic inputs regards that module,
webform_anonymous_form_alter(invokes hook_alter)
In this case we should use only hook_form_FORM_ID alter(); which is more form specific will not be invoked with form-alter hook from other modules
Also the implementation for the existing form_alter hook should be like below,
There are two different functions are used although the query is almost same only a different of parameter,
_webform_anonymous_webform_is_anonymous($nid) & _webform_anonymous_webform_anonymous_information($nid)
It seems to me that
_webform_anonymous_webform_anonymous_information($nid) is more generic function
only needs a parsing on the return object.
Comment #6
dwieeb commentedMy hook_form_alter() function is adding the anonymous status to every webform so other modules can use it. I'm not altering just one form.
I agree with you on the redundant functions, I've fixed it.
Comment #7
roynilanjan commentedat least always should have a check using form_id within hook_form_alter
e.g.
hook_form_alter(&form,&form_state,$form_id) {
switch ($form_id) {
case 'form-id':
if (!isset($form['#node']) || !in_array($form['#node']->type, webform_variable_get('webform_node_types'))) {
return;
}
// Set the status of the anonymity of this webform's results.
$form['#node']->webform['anonymous'] = _webform_anonymous_webform_is_anonymous($form['#node']->nid);
break;
}
}
Comment #8
dwieeb commented.. I don't think you understand the purpose my module has of hooking into each form. I'm not determining which forms to alter by their ID, I'm determining that by whether they are a webform.
Perhaps my hook_form_alter() is excessive, but I figured it was best to store the anonymous status along with the rest of the webform's settings in
$form['#node']->webform.Comment #9
roynilanjan commentedyou can't put any logic within a hook_form_alter without any filter with respect to form-id...
suppose I have implemented hook_form_alter in my module during the execution all the hook_form_alter will be executed from other module as well... this is always a performance overload...
for test please make a vardump($form) in your module hook_form_alter .. then see whatever form(even the content type form or general custom form from any module will be effected) you try to open that form array will be shown means that alter hook is executed from your module...but it seems to that your purpose only for the webform!
So the better if can little bit change the logic like
because that #node is not available in content type form or any custom form & checking will be only on one line... because it's only available on node
Comment #10
dwieeb commentedThe code you just showed me is exactly like mine. I check to see if the $form['#node'] is set, and if it's not, I return out of the function. I don't understand the difference between our code.
But alright, I'll take out the hook. I just thought it was a good idea to present the anonymous setting along with the rest of the webform's settings.
Perhaps I should use hook_node_view() to add my setting to that array.
Comment #11
dwieeb commentedOkay, I took out the hook. Ready for more review. =)
Comment #12
dwieeb commentedAdding review bonus tag after manually reviewing 3 modules.
Just as a note, I have two other webform extension modules that I'd like to submit as full projects if I get full project access. Webform Anonymous is the smallest of them. I figured it'd be easiest.
Comment #13
klausiLooks good to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #13.0
klausiadding modules that I've reviewed
Comment #14
dwieeb commentedAdding review bonus tag after 3 more manual reviews.
Comment #15
misc commentedThanks for your contribution, dwieeb!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #16
misc commentedDouble post.
Comment #17.0
(not verified) commentedadding more project reviews