{"action":"created","comment":{"url":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/comments/49977345","id":49977345,"diff_hunk":"@@ -129,29 +129,36 @@ public function blockSubmit($form, FormStateInterface $form_state) {\n    * {@inheritdoc}\n    */\n   public function build() {\n-    if ($this->configuration['sharethis_path'] == 'external') {\n-      $mpath = $this->configuration['sharethis_path_external'];\n-    }\n-    else {\n-      $current_path = \\Drupal::url('<current>');\n-      $mpath = ($this->configuration['sharethis_path'] == 'global') ? '<front>' : $current_path;\n-    }\n-    $request = \\Drupal::request();\n-    $route_match = \\Drupal::routeMatch();\n-    $title = \\Drupal::service('title_resolver')->getTitle($request, $route_match->getRouteObject());\n-    $title = is_object($title) ? $title->getUntranslatedString() : $title;\n-    $mtitle = ($this->configuration['sharethis_path'] == 'current') ? $title : \\Drupal::config('system.site')->get('name');\n-    $markup = $this->sharethisManager->widgetContents(array('m_path' => $mpath, 'm_title' => $mtitle));\n-    return [\n-      '#theme' => 'sharethis_block',\n-      '#content' => $markup,\n-      '#attached' => array(\n-        'library' => array(\n-          'sharethis/sharethispickerexternalbuttonsws',\n-          'sharethis/sharethispickerexternalbuttons',\n+    if ($this->sharethisSettings->get('location') === 'block') {\n+      if ($this->configuration['sharethis_path'] == 'external') {\n+        $mpath = $this->configuration['sharethis_path_external'];\n+      }\n+      else {\n+        $current_path = \\Drupal::url('<current>');","path":"src/Plugin/Block/SharethisWidgetBlock.php","position":29,"original_position":29,"commit_id":"21a6da912844f6f9d0d0f213d13f6e0436901f25","original_commit_id":"21a6da912844f6f9d0d0f213d13f6e0436901f25","user":{"login":"naveenvalecha","id":2075378,"avatar_url":"https://avatars.githubusercontent.com/u/2075378?v=3","gravatar_id":"","url":"https://api.github.com/users/naveenvalecha","html_url":"https://github.com/naveenvalecha","followers_url":"https://api.github.com/users/naveenvalecha/followers","following_url":"https://api.github.com/users/naveenvalecha/following{/other_user}","gists_url":"https://api.github.com/users/naveenvalecha/gists{/gist_id}","starred_url":"https://api.github.com/users/naveenvalecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naveenvalecha/subscriptions","organizations_url":"https://api.github.com/users/naveenvalecha/orgs","repos_url":"https://api.github.com/users/naveenvalecha/repos","events_url":"https://api.github.com/users/naveenvalecha/events{/privacy}","received_events_url":"https://api.github.com/users/naveenvalecha/received_events","type":"User","site_admin":false},"body":"inject the URL class here instead of calling global \\Drupal functions.","created_at":"2016-01-18T09:43:44Z","updated_at":"2016-01-18T09:43:44Z","html_url":"https://github.com/fly2abhishek/sharethis/pull/24#discussion_r49977345","pull_request_url":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/comments/49977345"},"html":{"href":"https://github.com/fly2abhishek/sharethis/pull/24#discussion_r49977345"},"pull_request":{"href":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/24","id":56319169,"html_url":"https://github.com/fly2abhishek/sharethis/pull/24","diff_url":"https://github.com/fly2abhishek/sharethis/pull/24.diff","patch_url":"https://github.com/fly2abhishek/sharethis/pull/24.patch","issue_url":"https://api.github.com/repos/fly2abhishek/sharethis/issues/24","number":24,"state":"open","locked":false,"title":"Sharethis block displayed as per value of location","user":{"login":"neetumorwani","id":3287488,"avatar_url":"https://avatars.githubusercontent.com/u/3287488?v=3","gravatar_id":"","url":"https://api.github.com/users/neetumorwani","html_url":"https://github.com/neetumorwani","followers_url":"https://api.github.com/users/neetumorwani/followers","following_url":"https://api.github.com/users/neetumorwani/following{/other_user}","gists_url":"https://api.github.com/users/neetumorwani/gists{/gist_id}","starred_url":"https://api.github.com/users/neetumorwani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neetumorwani/subscriptions","organizations_url":"https://api.github.com/users/neetumorwani/orgs","repos_url":"https://api.github.com/users/neetumorwani/repos","events_url":"https://api.github.com/users/neetumorwani/events{/privacy}","received_events_url":"https://api.github.com/users/neetumorwani/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-18T09:38:23Z","updated_at":"2016-01-18T09:43:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f5e9c73f5c236751a29d2b58c542dbb28d19bbd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/24/commits","review_comments_url":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/24/comments","review_comment_url":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fly2abhishek/sharethis/issues/24/comments","statuses_url":"https://api.github.com/repos/fly2abhishek/sharethis/statuses/21a6da912844f6f9d0d0f213d13f6e0436901f25","head":{"label":"neetumorwani:8.x-1.x","ref":"8.x-1.x","sha":"21a6da912844f6f9d0d0f213d13f6e0436901f25","user":{"login":"neetumorwani","id":3287488,"avatar_url":"https://avatars.githubusercontent.com/u/3287488?v=3","gravatar_id":"","url":"https://api.github.com/users/neetumorwani","html_url":"https://github.com/neetumorwani","followers_url":"https://api.github.com/users/neetumorwani/followers","following_url":"https://api.github.com/users/neetumorwani/following{/other_user}","gists_url":"https://api.github.com/users/neetumorwani/gists{/gist_id}","starred_url":"https://api.github.com/users/neetumorwani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neetumorwani/subscriptions","organizations_url":"https://api.github.com/users/neetumorwani/orgs","repos_url":"https://api.github.com/users/neetumorwani/repos","events_url":"https://api.github.com/users/neetumorwani/events{/privacy}","received_events_url":"https://api.github.com/users/neetumorwani/received_events","type":"User","site_admin":false},"repo":{"id":48351368,"name":"sharethis","full_name":"neetumorwani/sharethis","owner":{"login":"neetumorwani","id":3287488,"avatar_url":"https://avatars.githubusercontent.com/u/3287488?v=3","gravatar_id":"","url":"https://api.github.com/users/neetumorwani","html_url":"https://github.com/neetumorwani","followers_url":"https://api.github.com/users/neetumorwani/followers","following_url":"https://api.github.com/users/neetumorwani/following{/other_user}","gists_url":"https://api.github.com/users/neetumorwani/gists{/gist_id}","starred_url":"https://api.github.com/users/neetumorwani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neetumorwani/subscriptions","organizations_url":"https://api.github.com/users/neetumorwani/orgs","repos_url":"https://api.github.com/users/neetumorwani/repos","events_url":"https://api.github.com/users/neetumorwani/events{/privacy}","received_events_url":"https://api.github.com/users/neetumorwani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/neetumorwani/sharethis","description":"","fork":true,"url":"https://api.github.com/repos/neetumorwani/sharethis","forks_url":"https://api.github.com/repos/neetumorwani/sharethis/forks","keys_url":"https://api.github.com/repos/neetumorwani/sharethis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neetumorwani/sharethis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neetumorwani/sharethis/teams","hooks_url":"https://api.github.com/repos/neetumorwani/sharethis/hooks","issue_events_url":"https://api.github.com/repos/neetumorwani/sharethis/issues/events{/number}","events_url":"https://api.github.com/repos/neetumorwani/sharethis/events","assignees_url":"https://api.github.com/repos/neetumorwani/sharethis/assignees{/user}","branches_url":"https://api.github.com/repos/neetumorwani/sharethis/branches{/branch}","tags_url":"https://api.github.com/repos/neetumorwani/sharethis/tags","blobs_url":"https://api.github.com/repos/neetumorwani/sharethis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neetumorwani/sharethis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neetumorwani/sharethis/git/refs{/sha}","trees_url":"https://api.github.com/repos/neetumorwani/sharethis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neetumorwani/sharethis/statuses/{sha}","languages_url":"https://api.github.com/repos/neetumorwani/sharethis/languages","stargazers_url":"https://api.github.com/repos/neetumorwani/sharethis/stargazers","contributors_url":"https://api.github.com/repos/neetumorwani/sharethis/contributors","subscribers_url":"https://api.github.com/repos/neetumorwani/sharethis/subscribers","subscription_url":"https://api.github.com/repos/neetumorwani/sharethis/subscription","commits_url":"https://api.github.com/repos/neetumorwani/sharethis/commits{/sha}","git_commits_url":"https://api.github.com/repos/neetumorwani/sharethis/git/commits{/sha}","comments_url":"https://api.github.com/repos/neetumorwani/sharethis/comments{/number}","issue_comment_url":"https://api.github.com/repos/neetumorwani/sharethis/issues/comments{/number}","contents_url":"https://api.github.com/repos/neetumorwani/sharethis/contents/{+path}","compare_url":"https://api.github.com/repos/neetumorwani/sharethis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neetumorwani/sharethis/merges","archive_url":"https://api.github.com/repos/neetumorwani/sharethis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neetumorwani/sharethis/downloads","issues_url":"https://api.github.com/repos/neetumorwani/sharethis/issues{/number}","pulls_url":"https://api.github.com/repos/neetumorwani/sharethis/pulls{/number}","milestones_url":"https://api.github.com/repos/neetumorwani/sharethis/milestones{/number}","notifications_url":"https://api.github.com/repos/neetumorwani/sharethis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neetumorwani/sharethis/labels{/name}","releases_url":"https://api.github.com/repos/neetumorwani/sharethis/releases{/id}","created_at":"2015-12-21T04:52:18Z","updated_at":"2016-01-11T06:32:55Z","pushed_at":"2016-01-18T09:37:28Z","git_url":"git://github.com/neetumorwani/sharethis.git","ssh_url":"git@github.com:neetumorwani/sharethis.git","clone_url":"https://github.com/neetumorwani/sharethis.git","svn_url":"https://github.com/neetumorwani/sharethis","homepage":null,"size":272,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"8.x-1.x"}},"base":{"label":"fly2abhishek:8.x-1.x","ref":"8.x-1.x","sha":"95874aea0bf26023b355a554ca56152a7e4c04c6","user":{"login":"fly2abhishek","id":1158190,"avatar_url":"https://avatars.githubusercontent.com/u/1158190?v=3","gravatar_id":"","url":"https://api.github.com/users/fly2abhishek","html_url":"https://github.com/fly2abhishek","followers_url":"https://api.github.com/users/fly2abhishek/followers","following_url":"https://api.github.com/users/fly2abhishek/following{/other_user}","gists_url":"https://api.github.com/users/fly2abhishek/gists{/gist_id}","starred_url":"https://api.github.com/users/fly2abhishek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fly2abhishek/subscriptions","organizations_url":"https://api.github.com/users/fly2abhishek/orgs","repos_url":"https://api.github.com/users/fly2abhishek/repos","events_url":"https://api.github.com/users/fly2abhishek/events{/privacy}","received_events_url":"https://api.github.com/users/fly2abhishek/received_events","type":"User","site_admin":false},"repo":{"id":48101810,"name":"sharethis","full_name":"fly2abhishek/sharethis","owner":{"login":"fly2abhishek","id":1158190,"avatar_url":"https://avatars.githubusercontent.com/u/1158190?v=3","gravatar_id":"","url":"https://api.github.com/users/fly2abhishek","html_url":"https://github.com/fly2abhishek","followers_url":"https://api.github.com/users/fly2abhishek/followers","following_url":"https://api.github.com/users/fly2abhishek/following{/other_user}","gists_url":"https://api.github.com/users/fly2abhishek/gists{/gist_id}","starred_url":"https://api.github.com/users/fly2abhishek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fly2abhishek/subscriptions","organizations_url":"https://api.github.com/users/fly2abhishek/orgs","repos_url":"https://api.github.com/users/fly2abhishek/repos","events_url":"https://api.github.com/users/fly2abhishek/events{/privacy}","received_events_url":"https://api.github.com/users/fly2abhishek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fly2abhishek/sharethis","description":"","fork":false,"url":"https://api.github.com/repos/fly2abhishek/sharethis","forks_url":"https://api.github.com/repos/fly2abhishek/sharethis/forks","keys_url":"https://api.github.com/repos/fly2abhishek/sharethis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fly2abhishek/sharethis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fly2abhishek/sharethis/teams","hooks_url":"https://api.github.com/repos/fly2abhishek/sharethis/hooks","issue_events_url":"https://api.github.com/repos/fly2abhishek/sharethis/issues/events{/number}","events_url":"https://api.github.com/repos/fly2abhishek/sharethis/events","assignees_url":"https://api.github.com/repos/fly2abhishek/sharethis/assignees{/user}","branches_url":"https://api.github.com/repos/fly2abhishek/sharethis/branches{/branch}","tags_url":"https://api.github.com/repos/fly2abhishek/sharethis/tags","blobs_url":"https://api.github.com/repos/fly2abhishek/sharethis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fly2abhishek/sharethis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fly2abhishek/sharethis/git/refs{/sha}","trees_url":"https://api.github.com/repos/fly2abhishek/sharethis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fly2abhishek/sharethis/statuses/{sha}","languages_url":"https://api.github.com/repos/fly2abhishek/sharethis/languages","stargazers_url":"https://api.github.com/repos/fly2abhishek/sharethis/stargazers","contributors_url":"https://api.github.com/repos/fly2abhishek/sharethis/contributors","subscribers_url":"https://api.github.com/repos/fly2abhishek/sharethis/subscribers","subscription_url":"https://api.github.com/repos/fly2abhishek/sharethis/subscription","commits_url":"https://api.github.com/repos/fly2abhishek/sharethis/commits{/sha}","git_commits_url":"https://api.github.com/repos/fly2abhishek/sharethis/git/commits{/sha}","comments_url":"https://api.github.com/repos/fly2abhishek/sharethis/comments{/number}","issue_comment_url":"https://api.github.com/repos/fly2abhishek/sharethis/issues/comments{/number}","contents_url":"https://api.github.com/repos/fly2abhishek/sharethis/contents/{+path}","compare_url":"https://api.github.com/repos/fly2abhishek/sharethis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fly2abhishek/sharethis/merges","archive_url":"https://api.github.com/repos/fly2abhishek/sharethis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fly2abhishek/sharethis/downloads","issues_url":"https://api.github.com/repos/fly2abhishek/sharethis/issues{/number}","pulls_url":"https://api.github.com/repos/fly2abhishek/sharethis/pulls{/number}","milestones_url":"https://api.github.com/repos/fly2abhishek/sharethis/milestones{/number}","notifications_url":"https://api.github.com/repos/fly2abhishek/sharethis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fly2abhishek/sharethis/labels{/name}","releases_url":"https://api.github.com/repos/fly2abhishek/sharethis/releases{/id}","created_at":"2015-12-16T09:52:09Z","updated_at":"2016-01-11T06:46:06Z","pushed_at":"2016-01-18T09:38:23Z","git_url":"git://github.com/fly2abhishek/sharethis.git","ssh_url":"git@github.com:fly2abhishek/sharethis.git","clone_url":"https://github.com/fly2abhishek/sharethis.git","svn_url":"https://github.com/fly2abhishek/sharethis","homepage":null,"size":267,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"8.x-1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/24"},"html":{"href":"https://github.com/fly2abhishek/sharethis/pull/24"},"issue":{"href":"https://api.github.com/repos/fly2abhishek/sharethis/issues/24"},"comments":{"href":"https://api.github.com/repos/fly2abhishek/sharethis/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fly2abhishek/sharethis/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/fly2abhishek/sharethis/statuses/21a6da912844f6f9d0d0f213d13f6e0436901f25"}}}}