{"action":"created","comment":{"url":"https://api.github.com/repos/wearefine/fae/pulls/comments/67936788","id":67936788,"diff_hunk":"@@ -121,7 +121,21 @@ Fae.form.ajax = {\n \n         // remotipart returns data inside textarea, let's grab it from there\n         if ($html.is('textarea')) {\n-          $html = $( $html.val() );\n+          if ( $html.length > 1 ) {\n+            var $textarea;\n+\n+            for (var i = 0; i < $html.length; i++ ) {\n+              if ( $($html[i]).is('textarea') ) {","path":"app/assets/javascripts/fae/form/_ajax.js","position":9,"original_position":9,"commit_id":"230918a2f8504ae6f8dbfa39c39a1c95f522d69c","original_commit_id":"230918a2f8504ae6f8dbfa39c39a1c95f522d69c","user":{"login":"tshedor","id":865897,"avatar_url":"https://avatars.githubusercontent.com/u/865897?v=3","gravatar_id":"","url":"https://api.github.com/users/tshedor","html_url":"https://github.com/tshedor","followers_url":"https://api.github.com/users/tshedor/followers","following_url":"https://api.github.com/users/tshedor/following{/other_user}","gists_url":"https://api.github.com/users/tshedor/gists{/gist_id}","starred_url":"https://api.github.com/users/tshedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tshedor/subscriptions","organizations_url":"https://api.github.com/users/tshedor/orgs","repos_url":"https://api.github.com/users/tshedor/repos","events_url":"https://api.github.com/users/tshedor/events{/privacy}","received_events_url":"https://api.github.com/users/tshedor/received_events","type":"User","site_admin":false},"body":"Interesting, did not know that. So then what if L128 returns another Array?\r\n\r\nOther notes: if `$textarea` is not reassigned in this loop, L135 will throw an error (`.text()`) and there should be a changelog item added for this.","created_at":"2016-06-21T19:35:04Z","updated_at":"2016-06-21T19:35:04Z","html_url":"https://github.com/wearefine/fae/pull/130#discussion_r67936788","pull_request_url":"https://api.github.com/repos/wearefine/fae/pulls/130","_links":{"self":{"href":"https://api.github.com/repos/wearefine/fae/pulls/comments/67936788"},"html":{"href":"https://github.com/wearefine/fae/pull/130#discussion_r67936788"},"pull_request":{"href":"https://api.github.com/repos/wearefine/fae/pulls/130"}}},"pull_request":{"url":"https://api.github.com/repos/wearefine/fae/pulls/130","id":74670061,"html_url":"https://github.com/wearefine/fae/pull/130","diff_url":"https://github.com/wearefine/fae/pull/130.diff","patch_url":"https://github.com/wearefine/fae/pull/130.patch","issue_url":"https://api.github.com/repos/wearefine/fae/issues/130","number":130,"state":"open","locked":false,"title":"conditionally handle the data response from remotipart...","user":{"login":"kyleshevlin","id":4333144,"avatar_url":"https://avatars.githubusercontent.com/u/4333144?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleshevlin","html_url":"https://github.com/kyleshevlin","followers_url":"https://api.github.com/users/kyleshevlin/followers","following_url":"https://api.github.com/users/kyleshevlin/following{/other_user}","gists_url":"https://api.github.com/users/kyleshevlin/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleshevlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleshevlin/subscriptions","organizations_url":"https://api.github.com/users/kyleshevlin/orgs","repos_url":"https://api.github.com/users/kyleshevlin/repos","events_url":"https://api.github.com/users/kyleshevlin/events{/privacy}","received_events_url":"https://api.github.com/users/kyleshevlin/received_events","type":"User","site_admin":false},"body":"... to ensure proper parsing.\r\n\r\nThe data in the response was returning an array: [ <style></style>, <textarea/> ] and thus line 124 would pass but 125 would fail. This would prevent the rest of the functionality from firing.\r\n\r\nBy checking if the response had a length greater than 1, I was able to loop to find the textarea object and then parse it to send the proper data for rendering to the page.","created_at":"2016-06-21T19:22:16Z","updated_at":"2016-06-21T19:35:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb4c53f850cb01ae42b913cf927eebc5f0789df9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wearefine/fae/pulls/130/commits","review_comments_url":"https://api.github.com/repos/wearefine/fae/pulls/130/comments","review_comment_url":"https://api.github.com/repos/wearefine/fae/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wearefine/fae/issues/130/comments","statuses_url":"https://api.github.com/repos/wearefine/fae/statuses/230918a2f8504ae6f8dbfa39c39a1c95f522d69c","head":{"label":"wearefine:fix_for_remotipart_response_handling","ref":"fix_for_remotipart_response_handling","sha":"230918a2f8504ae6f8dbfa39c39a1c95f522d69c","user":{"login":"wearefine","id":7430597,"avatar_url":"https://avatars.githubusercontent.com/u/7430597?v=3","gravatar_id":"","url":"https://api.github.com/users/wearefine","html_url":"https://github.com/wearefine","followers_url":"https://api.github.com/users/wearefine/followers","following_url":"https://api.github.com/users/wearefine/following{/other_user}","gists_url":"https://api.github.com/users/wearefine/gists{/gist_id}","starred_url":"https://api.github.com/users/wearefine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wearefine/subscriptions","organizations_url":"https://api.github.com/users/wearefine/orgs","repos_url":"https://api.github.com/users/wearefine/repos","events_url":"https://api.github.com/users/wearefine/events{/privacy}","received_events_url":"https://api.github.com/users/wearefine/received_events","type":"Organization","site_admin":false},"repo":{"id":32231726,"name":"fae","full_name":"wearefine/fae","owner":{"login":"wearefine","id":7430597,"avatar_url":"https://avatars.githubusercontent.com/u/7430597?v=3","gravatar_id":"","url":"https://api.github.com/users/wearefine","html_url":"https://github.com/wearefine","followers_url":"https://api.github.com/users/wearefine/followers","following_url":"https://api.github.com/users/wearefine/following{/other_user}","gists_url":"https://api.github.com/users/wearefine/gists{/gist_id}","starred_url":"https://api.github.com/users/wearefine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wearefine/subscriptions","organizations_url":"https://api.github.com/users/wearefine/orgs","repos_url":"https://api.github.com/users/wearefine/repos","events_url":"https://api.github.com/users/wearefine/events{/privacy}","received_events_url":"https://api.github.com/users/wearefine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wearefine/fae","description":"A flexible CMS for Rails","fork":false,"url":"https://api.github.com/repos/wearefine/fae","forks_url":"https://api.github.com/repos/wearefine/fae/forks","keys_url":"https://api.github.com/repos/wearefine/fae/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wearefine/fae/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wearefine/fae/teams","hooks_url":"https://api.github.com/repos/wearefine/fae/hooks","issue_events_url":"https://api.github.com/repos/wearefine/fae/issues/events{/number}","events_url":"https://api.github.com/repos/wearefine/fae/events","assignees_url":"https://api.github.com/repos/wearefine/fae/assignees{/user}","branches_url":"https://api.github.com/repos/wearefine/fae/branches{/branch}","tags_url":"https://api.github.com/repos/wearefine/fae/tags","blobs_url":"https://api.github.com/repos/wearefine/fae/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wearefine/fae/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wearefine/fae/git/refs{/sha}","trees_url":"https://api.github.com/repos/wearefine/fae/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wearefine/fae/statuses/{sha}","languages_url":"https://api.github.com/repos/wearefine/fae/languages","stargazers_url":"https://api.github.com/repos/wearefine/fae/stargazers","contributors_url":"https://api.github.com/repos/wearefine/fae/contributors","subscribers_url":"https://api.github.com/repos/wearefine/fae/subscribers","subscription_url":"https://api.github.com/repos/wearefine/fae/subscription","commits_url":"https://api.github.com/repos/wearefine/fae/commits{/sha}","git_commits_url":"https://api.github.com/repos/wearefine/fae/git/commits{/sha}","comments_url":"https://api.github.com/repos/wearefine/fae/comments{/number}","issue_comment_url":"https://api.github.com/repos/wearefine/fae/issues/comments{/number}","contents_url":"https://api.github.com/repos/wearefine/fae/contents/{+path}","compare_url":"https://api.github.com/repos/wearefine/fae/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wearefine/fae/merges","archive_url":"https://api.github.com/repos/wearefine/fae/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wearefine/fae/downloads","issues_url":"https://api.github.com/repos/wearefine/fae/issues{/number}","pulls_url":"https://api.github.com/repos/wearefine/fae/pulls{/number}","milestones_url":"https://api.github.com/repos/wearefine/fae/milestones{/number}","notifications_url":"https://api.github.com/repos/wearefine/fae/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wearefine/fae/labels{/name}","releases_url":"https://api.github.com/repos/wearefine/fae/releases{/id}","deployments_url":"https://api.github.com/repos/wearefine/fae/deployments","created_at":"2015-03-14T20:58:43Z","updated_at":"2016-05-23T14:42:57Z","pushed_at":"2016-06-21T19:22:16Z","git_url":"git://github.com/wearefine/fae.git","ssh_url":"git@github.com:wearefine/fae.git","clone_url":"https://github.com/wearefine/fae.git","svn_url":"https://github.com/wearefine/fae","homepage":"","size":4597,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":10,"default_branch":"master"}},"base":{"label":"wearefine:master","ref":"master","sha":"bcadefcdf52fd97aa78d1cb9e81ea55c24468734","user":{"login":"wearefine","id":7430597,"avatar_url":"https://avatars.githubusercontent.com/u/7430597?v=3","gravatar_id":"","url":"https://api.github.com/users/wearefine","html_url":"https://github.com/wearefine","followers_url":"https://api.github.com/users/wearefine/followers","following_url":"https://api.github.com/users/wearefine/following{/other_user}","gists_url":"https://api.github.com/users/wearefine/gists{/gist_id}","starred_url":"https://api.github.com/users/wearefine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wearefine/subscriptions","organizations_url":"https://api.github.com/users/wearefine/orgs","repos_url":"https://api.github.com/users/wearefine/repos","events_url":"https://api.github.com/users/wearefine/events{/privacy}","received_events_url":"https://api.github.com/users/wearefine/received_events","type":"Organization","site_admin":false},"repo":{"id":32231726,"name":"fae","full_name":"wearefine/fae","owner":{"login":"wearefine","id":7430597,"avatar_url":"https://avatars.githubusercontent.com/u/7430597?v=3","gravatar_id":"","url":"https://api.github.com/users/wearefine","html_url":"https://github.com/wearefine","followers_url":"https://api.github.com/users/wearefine/followers","following_url":"https://api.github.com/users/wearefine/following{/other_user}","gists_url":"https://api.github.com/users/wearefine/gists{/gist_id}","starred_url":"https://api.github.com/users/wearefine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wearefine/subscriptions","organizations_url":"https://api.github.com/users/wearefine/orgs","repos_url":"https://api.github.com/users/wearefine/repos","events_url":"https://api.github.com/users/wearefine/events{/privacy}","received_events_url":"https://api.github.com/users/wearefine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wearefine/fae","description":"A flexible CMS for Rails","fork":false,"url":"https://api.github.com/repos/wearefine/fae","forks_url":"https://api.github.com/repos/wearefine/fae/forks","keys_url":"https://api.github.com/repos/wearefine/fae/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wearefine/fae/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wearefine/fae/teams","hooks_url":"https://api.github.com/repos/wearefine/fae/hooks","issue_events_url":"https://api.github.com/repos/wearefine/fae/issues/events{/number}","events_url":"https://api.github.com/repos/wearefine/fae/events","assignees_url":"https://api.github.com/repos/wearefine/fae/assignees{/user}","branches_url":"https://api.github.com/repos/wearefine/fae/branches{/branch}","tags_url":"https://api.github.com/repos/wearefine/fae/tags","blobs_url":"https://api.github.com/repos/wearefine/fae/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wearefine/fae/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wearefine/fae/git/refs{/sha}","trees_url":"https://api.github.com/repos/wearefine/fae/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wearefine/fae/statuses/{sha}","languages_url":"https://api.github.com/repos/wearefine/fae/languages","stargazers_url":"https://api.github.com/repos/wearefine/fae/stargazers","contributors_url":"https://api.github.com/repos/wearefine/fae/contributors","subscribers_url":"https://api.github.com/repos/wearefine/fae/subscribers","subscription_url":"https://api.github.com/repos/wearefine/fae/subscription","commits_url":"https://api.github.com/repos/wearefine/fae/commits{/sha}","git_commits_url":"https://api.github.com/repos/wearefine/fae/git/commits{/sha}","comments_url":"https://api.github.com/repos/wearefine/fae/comments{/number}","issue_comment_url":"https://api.github.com/repos/wearefine/fae/issues/comments{/number}","contents_url":"https://api.github.com/repos/wearefine/fae/contents/{+path}","compare_url":"https://api.github.com/repos/wearefine/fae/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wearefine/fae/merges","archive_url":"https://api.github.com/repos/wearefine/fae/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wearefine/fae/downloads","issues_url":"https://api.github.com/repos/wearefine/fae/issues{/number}","pulls_url":"https://api.github.com/repos/wearefine/fae/pulls{/number}","milestones_url":"https://api.github.com/repos/wearefine/fae/milestones{/number}","notifications_url":"https://api.github.com/repos/wearefine/fae/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wearefine/fae/labels{/name}","releases_url":"https://api.github.com/repos/wearefine/fae/releases{/id}","deployments_url":"https://api.github.com/repos/wearefine/fae/deployments","created_at":"2015-03-14T20:58:43Z","updated_at":"2016-05-23T14:42:57Z","pushed_at":"2016-06-21T19:22:16Z","git_url":"git://github.com/wearefine/fae.git","ssh_url":"git@github.com:wearefine/fae.git","clone_url":"https://github.com/wearefine/fae.git","svn_url":"https://github.com/wearefine/fae","homepage":"","size":4597,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wearefine/fae/pulls/130"},"html":{"href":"https://github.com/wearefine/fae/pull/130"},"issue":{"href":"https://api.github.com/repos/wearefine/fae/issues/130"},"comments":{"href":"https://api.github.com/repos/wearefine/fae/issues/130/comments"},"review_comments":{"href":"https://api.github.com/repos/wearefine/fae/pulls/130/comments"},"review_comment":{"href":"https://api.github.com/repos/wearefine/fae/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wearefine/fae/pulls/130/commits"},"statuses":{"href":"https://api.github.com/repos/wearefine/fae/statuses/230918a2f8504ae6f8dbfa39c39a1c95f522d69c"}}}}
{"actor":{"display_login":"tshedor"}}