{"action":"created","comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/184041769","pull_request_review_id":115155129,"id":184041769,"diff_hunk":"@@ -2781,19 +2781,48 @@ extension AztecPostViewController {\n \n     fileprivate func insert(exportableAsset: ExportableAsset, source: MediaSource, attachment: MediaAttachment? = nil) {\n         var attachment = attachment\n+\n+        var externalMediaLinkObserver: MediaCoordinator.ObserverBlock?\n+        var externalMediaLinkObserverReceipt: UUID?\n+\n         if attachment == nil {\n             switch exportableAsset.assetMediaType {\n             case .image:\n                 attachment = insertImageAttachment()\n             case .video:\n                 attachment = insertVideoAttachmentWithPlaceholder()\n             default:\n-                return\n+                guard let urlAsset = exportableAsset as? NSURL else { break }","path":"WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecPostViewController.swift","position":16,"original_position":16,"commit_id":"8a12f2eb75c7c0eff42cc7f7964dee691a1a7bf0","original_commit_id":"8a12f2eb75c7c0eff42cc7f7964dee691a1a7bf0","user":{"login":"frosty","id":4780,"avatar_url":"https://avatars0.githubusercontent.com/u/4780?v=4","gravatar_id":"","url":"https://api.github.com/users/frosty","html_url":"https://github.com/frosty","followers_url":"https://api.github.com/users/frosty/followers","following_url":"https://api.github.com/users/frosty/following{/other_user}","gists_url":"https://api.github.com/users/frosty/gists{/gist_id}","starred_url":"https://api.github.com/users/frosty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frosty/subscriptions","organizations_url":"https://api.github.com/users/frosty/orgs","repos_url":"https://api.github.com/users/frosty/repos","events_url":"https://api.github.com/users/frosty/events{/privacy}","received_events_url":"https://api.github.com/users/frosty/received_events","type":"User","site_admin":false},"body":"From @SergioEstevao's comment it sounds like some of this may need changing anyway, but whatever we keep here I'd probably recommend we extract it to a method, so this case becomes a single line like the `.image` and `.video` cases.","created_at":"2018-04-25T12:36:58Z","updated_at":"2018-04-25T12:36:58Z","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/9188#discussion_r184041769","pull_request_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/9188","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments/184041769"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/9188#discussion_r184041769"},"pull_request":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/9188"}}},"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/9188","id":183896851,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/9188","diff_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/9188.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/9188.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/9188","number":9188,"state":"open","locked":false,"title":"Aztec : Allow selection of additional doc types via doc picker","user":{"login":"a8c-sab-trial","id":38480191,"avatar_url":"https://avatars3.githubusercontent.com/u/38480191?v=4","gravatar_id":"","url":"https://api.github.com/users/a8c-sab-trial","html_url":"https://github.com/a8c-sab-trial","followers_url":"https://api.github.com/users/a8c-sab-trial/followers","following_url":"https://api.github.com/users/a8c-sab-trial/following{/other_user}","gists_url":"https://api.github.com/users/a8c-sab-trial/gists{/gist_id}","starred_url":"https://api.github.com/users/a8c-sab-trial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a8c-sab-trial/subscriptions","organizations_url":"https://api.github.com/users/a8c-sab-trial/orgs","repos_url":"https://api.github.com/users/a8c-sab-trial/repos","events_url":"https://api.github.com/users/a8c-sab-trial/events{/privacy}","received_events_url":"https://api.github.com/users/a8c-sab-trial/received_events","type":"User","site_admin":false},"body":"Fixes #9131. This PR modifies the `UIDocumentPickerViewController` instance presented by Aztec to accommodate selection of multiple document types, using a similar technique applied to the [Media Library](https://github.com/wordpress-mobile/WordPress-iOS/pull/9161). Additionally, it adds support for inserting selected documents into posts via Aztec.\r\n\r\nTo test (manually): On an iOS 11 device (or Simulator), complete the following sequence against a variety of site types (e.g., self-hosted, free WP-hosted, and paid WP-hosted):\r\n\r\n- Select a Site.\r\n- Navigate to `Publish/Site Pages : Start A Page : + (Add Content) : ... (Present the Document Picker)`\r\n- Observe that the Browse tab presented in the view controller includes a Select bar button item, and that \r\n- Validate that multiple selections are first uploaded to the _Media Library_ and then incorporated into the pending post.\r\n\r\nAlternatively, review the attached screen shots.\r\n<img width=\"487\" alt=\"9131_browse\" src=\"https://user-images.githubusercontent.com/38480191/39219986-f2a288dc-47e2-11e8-8e6d-9df0282e1cd9.png\">\r\n<img width=\"487\" alt=\"9131_selected\" src=\"https://user-images.githubusercontent.com/38480191/39219990-f57e9514-47e2-11e8-8aab-2f61afab6698.png\">\r\n\r\n","created_at":"2018-04-25T00:15:21Z","updated_at":"2018-04-25T12:36:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef5e22d54d29cd55022bad11e1823623fcfcd623","assignee":null,"assignees":[],"requested_reviewers":[{"login":"SergioEstevao","id":651601,"avatar_url":"https://avatars3.githubusercontent.com/u/651601?v=4","gravatar_id":"","url":"https://api.github.com/users/SergioEstevao","html_url":"https://github.com/SergioEstevao","followers_url":"https://api.github.com/users/SergioEstevao/followers","following_url":"https://api.github.com/users/SergioEstevao/following{/other_user}","gists_url":"https://api.github.com/users/SergioEstevao/gists{/gist_id}","starred_url":"https://api.github.com/users/SergioEstevao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergioEstevao/subscriptions","organizations_url":"https://api.github.com/users/SergioEstevao/orgs","repos_url":"https://api.github.com/users/SergioEstevao/repos","events_url":"https://api.github.com/users/SergioEstevao/events{/privacy}","received_events_url":"https://api.github.com/users/SergioEstevao/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/9188/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/9188/comments","review_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/9188/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/8a12f2eb75c7c0eff42cc7f7964dee691a1a7bf0","head":{"label":"a8c-sab-trial:feature/9131-aztec-support-more-file-types","ref":"feature/9131-aztec-support-more-file-types","sha":"8a12f2eb75c7c0eff42cc7f7964dee691a1a7bf0","user":{"login":"a8c-sab-trial","id":38480191,"avatar_url":"https://avatars3.githubusercontent.com/u/38480191?v=4","gravatar_id":"","url":"https://api.github.com/users/a8c-sab-trial","html_url":"https://github.com/a8c-sab-trial","followers_url":"https://api.github.com/users/a8c-sab-trial/followers","following_url":"https://api.github.com/users/a8c-sab-trial/following{/other_user}","gists_url":"https://api.github.com/users/a8c-sab-trial/gists{/gist_id}","starred_url":"https://api.github.com/users/a8c-sab-trial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a8c-sab-trial/subscriptions","organizations_url":"https://api.github.com/users/a8c-sab-trial/orgs","repos_url":"https://api.github.com/users/a8c-sab-trial/repos","events_url":"https://api.github.com/users/a8c-sab-trial/events{/privacy}","received_events_url":"https://api.github.com/users/a8c-sab-trial/received_events","type":"User","site_admin":false},"repo":{"id":130113853,"name":"WordPress-iOS","full_name":"a8c-sab-trial/WordPress-iOS","owner":{"login":"a8c-sab-trial","id":38480191,"avatar_url":"https://avatars3.githubusercontent.com/u/38480191?v=4","gravatar_id":"","url":"https://api.github.com/users/a8c-sab-trial","html_url":"https://github.com/a8c-sab-trial","followers_url":"https://api.github.com/users/a8c-sab-trial/followers","following_url":"https://api.github.com/users/a8c-sab-trial/following{/other_user}","gists_url":"https://api.github.com/users/a8c-sab-trial/gists{/gist_id}","starred_url":"https://api.github.com/users/a8c-sab-trial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a8c-sab-trial/subscriptions","organizations_url":"https://api.github.com/users/a8c-sab-trial/orgs","repos_url":"https://api.github.com/users/a8c-sab-trial/repos","events_url":"https://api.github.com/users/a8c-sab-trial/events{/privacy}","received_events_url":"https://api.github.com/users/a8c-sab-trial/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/a8c-sab-trial/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":true,"url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS","forks_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/a8c-sab-trial/WordPress-iOS/deployments","created_at":"2018-04-18T19:45:52Z","updated_at":"2018-04-24T15:54:44Z","pushed_at":"2018-04-25T00:17:08Z","git_url":"git://github.com/a8c-sab-trial/WordPress-iOS.git","ssh_url":"git@github.com:a8c-sab-trial/WordPress-iOS.git","clone_url":"https://github.com/a8c-sab-trial/WordPress-iOS.git","svn_url":"https://github.com/a8c-sab-trial/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":428338,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"wordpress-mobile:develop","ref":"develop","sha":"db74b4cdcb22496749e01a332f8455435b49c496","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars2.githubusercontent.com/u/1306301?v=4","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":8859285,"name":"WordPress-iOS","full_name":"wordpress-mobile/WordPress-iOS","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars2.githubusercontent.com/u/1306301?v=4","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS","description":"WordPress for iOS - Official repository","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/deployments","created_at":"2013-03-18T16:59:33Z","updated_at":"2018-04-25T07:19:24Z","pushed_at":"2018-04-25T07:19:18Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS","homepage":"http://ios.wordpress.org/","size":428487,"stargazers_count":2255,"watchers_count":2255,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":790,"mirror_url":null,"archived":false,"open_issues_count":517,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":790,"open_issues":517,"watchers":2255,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/9188"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS/pull/9188"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/9188"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/9188/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/9188/comments"},"review_comment":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/9188/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/statuses/8a12f2eb75c7c0eff42cc7f7964dee691a1a7bf0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"frosty"}}