plirof2 / d7_webform_results_access

DEPRECATED to gitlab- Clone of http://tylerfrankenstein.com/code/drupal-webform-submission-results-user-access-control
0 stars 0 forks source link

Shows webform_results_access: users even in anonymous , display error line 42 if none specified #1

Open plirof2 opened 7 years ago

plirof2 commented 7 years ago

1.Shows in plain view the user list that has access

  1. If no user is specified with access in anonymous it displays error: Warning: Invalid argument supplied for foreach() στην webform_results_access_webform_access() (γραμμή 42 του /opt/lampp/htdocs/forms_minedu/sites/all/modules/drupal7_webform_results_access-master/webform_results_access.module).

Note line 42 is :

foreach ($node->field_webform_results_access['und'] as $i => $ref) { // User Reference if (isset($ref['uid']) && (($ref['uid'] == $account->uid))) { $access = true; break; }

plirof2 commented 7 years ago

quick fix for (2) (maybe not really working: before line 42:

add : if (isset($node->field_webform_results_access['und'])){ and add after line break; } } the line : } //end of if (isset($node->field_webform_results_access['und']))

This does not enter the foreach in anonymous users

plirof2 commented 7 years ago

Fix for (1): set CUSTOM PERMISSION ONLY administrator navigate here : http://mydrupal7site/admin/structure/types/manage/webform/fields/field_webform_results_access