{"action":"created","issue":{"url":"https://api.github.com/repos/signalpoint/webform/issues/3","labels_url":"https://api.github.com/repos/signalpoint/webform/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/signalpoint/webform/issues/3/comments","events_url":"https://api.github.com/repos/signalpoint/webform/issues/3/events","html_url":"https://github.com/signalpoint/webform/issues/3","id":74402728,"number":3,"title":"incorrect email field","user":{"login":"coolman7","id":11715129,"avatar_url":"https://avatars.githubusercontent.com/u/11715129?v=3","gravatar_id":"","url":"https://api.github.com/users/coolman7","html_url":"https://github.com/coolman7","followers_url":"https://api.github.com/users/coolman7/followers","following_url":"https://api.github.com/users/coolman7/following{/other_user}","gists_url":"https://api.github.com/users/coolman7/gists{/gist_id}","starred_url":"https://api.github.com/users/coolman7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolman7/subscriptions","organizations_url":"https://api.github.com/users/coolman7/orgs","repos_url":"https://api.github.com/users/coolman7/repos","events_url":"https://api.github.com/users/coolman7/events{/privacy}","received_events_url":"https://api.github.com/users/coolman7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-08T15:33:54Z","updated_at":"2015-05-08T17:44:12Z","closed_at":null,"body":"I installed this module as explained. It is running but I have some minor problems:\r\nIt loads the form, but email field filled with [current-user:mail] instead of current logged in users' email address. I have to fill email address every time I fill form.\r\nAlso unregistered users should see a blank email field but they also get [current-user:mail] in email field."},"comment":{"url":"https://api.github.com/repos/signalpoint/webform/issues/comments/100309222","html_url":"https://github.com/signalpoint/webform/issues/3#issuecomment-100309222","issue_url":"https://api.github.com/repos/signalpoint/webform/issues/3","id":100309222,"user":{"login":"coolman7","id":11715129,"avatar_url":"https://avatars.githubusercontent.com/u/11715129?v=3","gravatar_id":"","url":"https://api.github.com/users/coolman7","html_url":"https://github.com/coolman7","followers_url":"https://api.github.com/users/coolman7/followers","following_url":"https://api.github.com/users/coolman7/following{/other_user}","gists_url":"https://api.github.com/users/coolman7/gists{/gist_id}","starred_url":"https://api.github.com/users/coolman7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolman7/subscriptions","organizations_url":"https://api.github.com/users/coolman7/orgs","repos_url":"https://api.github.com/users/coolman7/repos","events_url":"https://api.github.com/users/coolman7/events{/privacy}","received_events_url":"https://api.github.com/users/coolman7/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T17:44:12Z","updated_at":"2015-05-08T17:44:12Z","body":"I changed as this. Now email field is ok. But name field was also empty and neither %username nor [current-user:name] value is never come to this function as parameter.\r\n~~~\r\nfunction webform_tokens_replace(value) {\r\n  try {\r\n    if (!value) { return ''; }\r\n    var _value;\r\n    var _token;\r\n    var parts = value.split(' ');\r\n    for (var i = 0; i < parts.length; i++) {\r\n      _value = '';\r\n      _token = '';\r\n      if (parts[i].indexOf('%') == 0) {\r\n        if (parts[i].indexOf('%username') == 0 && Drupal.user.uid != 0) {\r\n          _token = '%username';\r\n          _value = Drupal.user.name;\r\n        }\r\n        else if (parts[i].indexOf('%useremail') == 0 && Drupal.user.uid != 0) {\r\n          _token = '%useremail';\r\n          _value = Drupal.user.mail;\r\n        }\r\n        else if (parts[i].indexOf('%ip_address') == 0) {\r\n          _token = '%ip_address';\r\n          _value = drupalgap_get_ip();\r\n        }\r\n        else if (parts[i].indexOf('%site') == 0) {\r\n          _token = '%site';\r\n          _value = drupalgap.settings.title;\r\n        }\r\n        else if (parts[i].indexOf('%nid') == 0) {\r\n          _token = '%nid';\r\n          _value = entity.nid;\r\n        }\r\n        else if (parts[i].indexOf('%title') == 0) {\r\n          _token = '%title';\r\n          _value = entity.title;\r\n        }\r\n      }\r\n// added by coolman7 - start\r\n      if (parts[i] == '[current-user:mail]') {\r\n        _token = '[current-user:mail]';\r\n        if (Drupal.user.uid == 0)\r\n          value = '';\r\n        else\r\n          value = Drupal.user.mail;\r\n      }\r\n      else\r\n// added by coolman7 - end\r\n        if (!empty(_value)) { value = value.replace(_token, _value); }\r\n    }\r\n    return value;\r\n  }\r\n  catch (error) { console.log('webform_tokens_replace - ' + error); }\r\n}\r\n~~~"}}