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

primsi’s picture

Status: Needs review » Needs work

Hi,

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.:

if (FALSE !== $anonymous_setting) {
j2r’s picture

There 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.

dwieeb’s picture

Status: Needs work » Needs review

@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.

primsi’s picture

Regarding 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.

roynilanjan’s picture

Here 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,

function webform_anonymous_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;
  }
}

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.

dwieeb’s picture

My 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.

roynilanjan’s picture

at 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;
}
}

dwieeb’s picture

.. 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.

roynilanjan’s picture

you 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

if(isset(form[#node]) {
  //Here will be your logic for webform
  $form['#node']->webform['anonymous'] = _webform_anonymous_webform_is_anonymous($form['#node']->nid);
}

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

dwieeb’s picture

The 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.

dwieeb’s picture

Okay, I took out the hook. Ready for more review. =)

dwieeb’s picture

Issue tags: +PAreview: review bonus

Adding 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.

klausi’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

Looks good to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

klausi’s picture

Issue summary: View changes

adding modules that I've reviewed

dwieeb’s picture

Issue tags: +PAreview: review bonus

Adding review bonus tag after 3 more manual reviews.

misc’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -PAreview: review bonus

Thanks 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.

misc’s picture

Double post.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

adding more project reviews