{"action":"opened","issue":{"url":"https://api.github.com/repos/MarkLogicUniversity/mlu-character-search/issues/4","repository_url":"https://api.github.com/repos/MarkLogicUniversity/mlu-character-search","labels_url":"https://api.github.com/repos/MarkLogicUniversity/mlu-character-search/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/MarkLogicUniversity/mlu-character-search/issues/4/comments","events_url":"https://api.github.com/repos/MarkLogicUniversity/mlu-character-search/issues/4/events","html_url":"https://github.com/MarkLogicUniversity/mlu-character-search/issues/4","id":313527337,"number":4,"title":"\"Load Star Wars JSON and Binary Data\" has error","user":{"login":"dmcassel","id":701394,"avatar_url":"https://avatars1.githubusercontent.com/u/701394?v=4","gravatar_id":"","url":"https://api.github.com/users/dmcassel","html_url":"https://github.com/dmcassel","followers_url":"https://api.github.com/users/dmcassel/followers","following_url":"https://api.github.com/users/dmcassel/following{/other_user}","gists_url":"https://api.github.com/users/dmcassel/gists{/gist_id}","starred_url":"https://api.github.com/users/dmcassel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmcassel/subscriptions","organizations_url":"https://api.github.com/users/dmcassel/orgs","repos_url":"https://api.github.com/users/dmcassel/repos","events_url":"https://api.github.com/users/dmcassel/events{/privacy}","received_events_url":"https://api.github.com/users/dmcassel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-11T23:50:31Z","updated_at":"2018-04-11T23:50:31Z","closed_at":null,"author_association":"NONE","body":"In the \"Star Wars data load\" workspace, the first tab has this code:\r\n\r\n```\r\n  // Check for server version greater than 8.0-2, since then\r\n  // xdmp.filesystemDirectory returns an Array\r\n  var mlVersion = xdmp.version().replace( /\\./g, \"\").replace( /-/g, \"\").substring(0,3) > \"802\"\r\n\r\n    xdmp.version().replace( /\\./g, \"\").replace( /-/g, \"\").substring(0,3)\r\n  var jsonArray;\r\n  if (true === mlVersion) {\r\n    jsonArray = jsonDocs.toArray();\r\n  } else {\r\n    jsonArray = jsonDocs;\r\n  }\r\n```\r\n\r\nThe `jsonArray = ` code is backwards -- the `.toArray()` should be in the else clause, as `jsonDocs` is already an array in the `true` case. \r\n\r\nAs a side note, the `mlVersion` test will fail when MarkLogic 10 comes out (we've got time before that happens). "}}
{"actor":{"display_login":"dmcassel"}}