Found this hook by looking at webform_results_access() in webform.module but don't see it in webform.api.php

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rocketeerbkw’s picture

Status: Active » Needs review
FileSize
1.31 KB

I've added the hook to webform.api.php

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/webform.api.phpundefined
@@ -432,6 +432,27 @@ function hook_webform_component_info_alter(&$components) {
+ * The $account must have view access to the webform as well as

This looks like its wrapped well before 80 characters, might as well rewrap it.

+++ b/webform.api.phpundefined
@@ -432,6 +432,27 @@ function hook_webform_component_info_alter(&$components) {
+ *   The User account to check access on.

User shouldn't be capitalized.

+++ b/webform.api.phpundefined
@@ -432,6 +432,27 @@ function hook_webform_component_info_alter(&$components) {
+ *   True or False if the user can access the webform results.

Should TRUE or FALSE

+++ b/webform.api.phpundefined
@@ -432,6 +432,27 @@ function hook_webform_component_info_alter(&$components) {
+  // Let editors view results of unpublished webforms

Should end with a full stop.

+++ b/webform.api.phpundefined
@@ -432,6 +432,27 @@ function hook_webform_component_info_alter(&$components) {
+  if ($node->status = 0 && in_array('editor', $account->roles)) {

Should be == 0, not = 0.

+++ b/webform.api.phpundefined
@@ -432,6 +432,27 @@ function hook_webform_component_info_alter(&$components) {
+    return true;

replace true with TRUE

rocketeerbkw’s picture

Status: Needs work » Needs review
FileSize
1.31 KB

Thanks!

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Looks great!

fenstrat’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @rocketeerbkw and @tim.plunkett!

I minor adjustments to the doc description, punctiation on the @see, and added a explicit FALSE return.

Committed and pushed to 7.x-4.x, 6.x-3.x and 7.x-3.x.

Status: Fixed » Closed (fixed)

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