{"action":"closed","issue":{"url":"https://api.github.com/repos/meteor/blaze/issues/192","repository_url":"https://api.github.com/repos/meteor/blaze","labels_url":"https://api.github.com/repos/meteor/blaze/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/meteor/blaze/issues/192/comments","events_url":"https://api.github.com/repos/meteor/blaze/issues/192/events","html_url":"https://github.com/meteor/blaze/issues/192","id":192904467,"number":192,"title":"Bug in {{else}}.  Does not fully evaluate expressions using helpers.","user":{"login":"MichaelJCole","id":1504790,"avatar_url":"https://avatars.githubusercontent.com/u/1504790?v=3","gravatar_id":"","url":"https://api.github.com/users/MichaelJCole","html_url":"https://github.com/MichaelJCole","followers_url":"https://api.github.com/users/MichaelJCole/followers","following_url":"https://api.github.com/users/MichaelJCole/following{/other_user}","gists_url":"https://api.github.com/users/MichaelJCole/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelJCole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelJCole/subscriptions","organizations_url":"https://api.github.com/users/MichaelJCole/orgs","repos_url":"https://api.github.com/users/MichaelJCole/repos","events_url":"https://api.github.com/users/MichaelJCole/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelJCole/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-01T17:02:15Z","updated_at":"2016-12-01T19:24:53Z","closed_at":"2016-12-01T19:24:53Z","body":"There is a bug when using {{else}} with a helper.  \r\n\r\nTemplate expressions are not fully evaluated in {{else}}.\r\n The first call to log evaluates submission(), then prints the id.  \r\nThe call to log in the {{else}} evaluates an returns submission(), without evaluating .id\r\n\r\n`submission` is a helper on the Meteor user. (See below)\r\n\r\n```\r\n                        {{#if submission.completedAt}}\r\n                          {{submission._id}}   <-- prints string id\r\n                        {{else}}\r\n                          {{submission._id}}  <-- prints object\r\n                        {{/if}}\r\n```\r\n\r\nsubmission() looks like:\r\n```\r\n// Helpers\r\nMeteor.users.helpers({\r\n  submission() {\r\n    var s = Submissions.find().fetch()\r\n    if (s && s[0]) return s[0];\r\n  },\r\n});\r\n```\r\nlog is a template helper:\r\n```\r\nTemplate.registerHelper('log', function(thing) {\r\n  if (!thing) thing = this;\r\n  console.log(thing);\r\n});\r\n```"}}
{"actor":{"display_login":"MichaelJCole"}}