Skip to main content
deleted 20 characters in body
Source Link
Clive
  • 167.9k
  • 19
  • 303
  • 337

For removing the link all you have to do is click on REWRITE RESULTS Then click on "Rewrite the output of this field" and then check "Strip HTML tags" That should remove the link.

The easiest way to achieve the other one is a bit of a hackish solution. You need can go to webfor/views folder and look for the file webform_handler_field_submission_count.inc

with in that file check for the render function.

  function render($values) {
    global $user;

    $output = NULL;
    if ($this->count_type == 'node' && in_array($values->{$this->aliases['type']}, webform_variable_get('webform_node_types'))) {
      module_load_include('inc', 'webform', 'includes/webform.submissions');
      $node = node_load($values->{$this->aliases['nid']});
      //if (webform_results_access($node, $user)) {
        $count = webform_get_submission_count($node->nid);
        $output = l($count, "node/$node->nid/webform-results");
      /*}
      else {
        $count = webform_get_submission_count($node->nid, $user->uid);
        $output = l($count, "node/$node->nid/submissions");
      }*/
    }
    elseif ($this->count_type == 'users') {
      $output = db_select('webform_submissions')
        ->condition('uid', $values->{$this->aliases['uid']})
        ->countQuery->execute()->fetchField();
    }

    return $output;
  }

In this above code I have commented a section. You can do the same it should work now for anonymous user. As I said this is a hackish solution and wont advice to do the same. The cleaner method would be to create a custom module and add the handler you want in the custom module and use that instead.

Hope this helps.

For removing the link all you have to do is click on REWRITE RESULTS Then click on "Rewrite the output of this field" and then check "Strip HTML tags" That should remove the link.

The easiest way to achieve the other one is a bit of a hackish solution. You need can go to webfor/views folder and look for the file webform_handler_field_submission_count.inc

with in that file check for the render function.

  function render($values) {
    global $user;

    $output = NULL;
    if ($this->count_type == 'node' && in_array($values->{$this->aliases['type']}, webform_variable_get('webform_node_types'))) {
      module_load_include('inc', 'webform', 'includes/webform.submissions');
      $node = node_load($values->{$this->aliases['nid']});
      //if (webform_results_access($node, $user)) {
        $count = webform_get_submission_count($node->nid);
        $output = l($count, "node/$node->nid/webform-results");
      /*}
      else {
        $count = webform_get_submission_count($node->nid, $user->uid);
        $output = l($count, "node/$node->nid/submissions");
      }*/
    }
    elseif ($this->count_type == 'users') {
      $output = db_select('webform_submissions')
        ->condition('uid', $values->{$this->aliases['uid']})
        ->countQuery->execute()->fetchField();
    }

    return $output;
  }

In this above code I have commented a section. You can do the same it should work now for anonymous user. As I said this is a hackish solution and wont advice to do the same. The cleaner method would be to create a custom module and add the handler you want in the custom module and use that instead.

Hope this helps.

For removing the link all you have to do is click on REWRITE RESULTS Then click on "Rewrite the output of this field" and then check "Strip HTML tags" That should remove the link.

The easiest way to achieve the other one is a bit of a hackish solution. You need can go to webfor/views folder and look for the file webform_handler_field_submission_count.inc

with in that file check for the render function.

  function render($values) {
    global $user;

    $output = NULL;
    if ($this->count_type == 'node' && in_array($values->{$this->aliases['type']}, webform_variable_get('webform_node_types'))) {
      module_load_include('inc', 'webform', 'includes/webform.submissions');
      $node = node_load($values->{$this->aliases['nid']});
      //if (webform_results_access($node, $user)) {
        $count = webform_get_submission_count($node->nid);
        $output = l($count, "node/$node->nid/webform-results");
      /*}
      else {
        $count = webform_get_submission_count($node->nid, $user->uid);
        $output = l($count, "node/$node->nid/submissions");
      }*/
    }
    elseif ($this->count_type == 'users') {
      $output = db_select('webform_submissions')
        ->condition('uid', $values->{$this->aliases['uid']})
        ->countQuery->execute()->fetchField();
    }

    return $output;
  }

In this above code I have commented a section. You can do the same it should work now for anonymous user. As I said this is a hackish solution and wont advice to do the same. The cleaner method would be to create a custom module and add the handler you want in the custom module and use that instead.

Source Link
Mohammed Shameem
  • 5.6k
  • 1
  • 20
  • 32

For removing the link all you have to do is click on REWRITE RESULTS Then click on "Rewrite the output of this field" and then check "Strip HTML tags" That should remove the link.

The easiest way to achieve the other one is a bit of a hackish solution. You need can go to webfor/views folder and look for the file webform_handler_field_submission_count.inc

with in that file check for the render function.

  function render($values) {
    global $user;

    $output = NULL;
    if ($this->count_type == 'node' && in_array($values->{$this->aliases['type']}, webform_variable_get('webform_node_types'))) {
      module_load_include('inc', 'webform', 'includes/webform.submissions');
      $node = node_load($values->{$this->aliases['nid']});
      //if (webform_results_access($node, $user)) {
        $count = webform_get_submission_count($node->nid);
        $output = l($count, "node/$node->nid/webform-results");
      /*}
      else {
        $count = webform_get_submission_count($node->nid, $user->uid);
        $output = l($count, "node/$node->nid/submissions");
      }*/
    }
    elseif ($this->count_type == 'users') {
      $output = db_select('webform_submissions')
        ->condition('uid', $values->{$this->aliases['uid']})
        ->countQuery->execute()->fetchField();
    }

    return $output;
  }

In this above code I have commented a section. You can do the same it should work now for anonymous user. As I said this is a hackish solution and wont advice to do the same. The cleaner method would be to create a custom module and add the handler you want in the custom module and use that instead.

Hope this helps.