{"action":"created","comment":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments/41442778","id":41442778,"diff_hunk":"@@ -0,0 +1,76 @@\n+<?php\n+/*\n+ +--------------------------------------------------------------------+\n+ | CiviCRM version 4.6                                                |\n+ +--------------------------------------------------------------------+\n+ | Copyright CiviCRM LLC (c) 2004-2015                                |\n+ +--------------------------------------------------------------------+\n+ | This file is a part of CiviCRM.                                    |\n+ |                                                                    |\n+ | CiviCRM is free software; you can copy, modify, and distribute it  |\n+ | under the terms of the GNU Affero General Public License           |\n+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |\n+ |                                                                    |\n+ | CiviCRM is distributed in the hope that it will be useful, but     |\n+ | WITHOUT ANY WARRANTY; without even the implied warranty of         |\n+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |\n+ | See the GNU Affero General Public License for more details.        |\n+ |                                                                    |\n+ | You should have received a copy of the GNU Affero General Public   |\n+ | License and the CiviCRM Licensing Exception along                  |\n+ | with this program; if not, contact CiviCRM LLC                     |\n+ | at info[AT]civicrm[DOT]org. If you have questions about the        |\n+ | GNU Affero General Public License or the licensing of CiviCRM,     |\n+ | see the CiviCRM license FAQ at http://civicrm.org/licensing        |\n+ +--------------------------------------------------------------------+\n+ */\n+\n+require_once 'CiviTest/CiviUnitTestCase.php';\n+\n+/**\n+ * This class is intended to test variable leakage in chained getsingle requests\n+ *\n+ * @package CiviCRM_APIv3\n+ */\n+class api_v3_ChainGetSingleTest extends CiviUnitTestCase {\n+  public $DBResetRequired = FALSE;\n+\n+  /**\n+   * (non-PHPdoc)\n+   * @see CiviUnitTestCase::tearDown()\n+   */\n+  public function tearDown() {\n+    $tablesToTruncate = array(\n+      'civicrm_campaign',\n+      'civicrm_event'\n+    );\n+    $this->quickCleanup($tablesToTruncate, TRUE);\n+  }\n+\n+  public function testCampaignEvent() {\n+    // campaigns are automatically created for each event\n+    $event0 = CRM_Core_DAO::createTestObject('CRM_Event_DAO_Event');\n+    $event1 = CRM_Core_DAO::createTestObject('CRM_Event_DAO_Event');\n+    $event2 = CRM_Core_DAO::createTestObject('CRM_Event_DAO_Event');\n+\n+    // remove campaign association from second event\n+    $event1->campaign_id = 'null';\n+    $event1->save();\n+\n+    $api = $this->callAPIAndDocument('event', 'get', array(","path":"tests/phpunit/api/v3/ChainGetSingleTest.php","position":null,"original_position":60,"commit_id":"ebbf5a8963711f0329413dd9596ced9f36f648e5","original_commit_id":"8c42c3b42658bf880b4669278508779cc2247c61","user":{"login":"eileenmcnaughton","id":336308,"avatar_url":"https://avatars.githubusercontent.com/u/336308?v=3","gravatar_id":"","url":"https://api.github.com/users/eileenmcnaughton","html_url":"https://github.com/eileenmcnaughton","followers_url":"https://api.github.com/users/eileenmcnaughton/followers","following_url":"https://api.github.com/users/eileenmcnaughton/following{/other_user}","gists_url":"https://api.github.com/users/eileenmcnaughton/gists{/gist_id}","starred_url":"https://api.github.com/users/eileenmcnaughton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eileenmcnaughton/subscriptions","organizations_url":"https://api.github.com/users/eileenmcnaughton/orgs","repos_url":"https://api.github.com/users/eileenmcnaughton/repos","events_url":"https://api.github.com/users/eileenmcnaughton/events{/privacy}","received_events_url":"https://api.github.com/users/eileenmcnaughton/received_events","type":"User","site_admin":false},"body":"@GinkgoFJG @saurabhbatra96 was going to take a look - if you are going to fix please confirm so he doesn't duplicate\r\n\r\nI expect this function  https://github.com/civicrm/civicrm-core/blob/81621fee4d9c2e8c6f5272a1c6b38a86186fe185/Civi/API/Subscriber/ChainSubscriber.php#L89-89","created_at":"2015-10-07T20:32:03Z","updated_at":"2015-10-07T20:32:03Z","html_url":"https://github.com/civicrm/civicrm-core/pull/6872#discussion_r41442778","pull_request_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/6872","_links":{"self":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments/41442778"},"html":{"href":"https://github.com/civicrm/civicrm-core/pull/6872#discussion_r41442778"},"pull_request":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/6872"}}},"pull_request":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/6872","id":46595501,"html_url":"https://github.com/civicrm/civicrm-core/pull/6872","diff_url":"https://github.com/civicrm/civicrm-core/pull/6872.diff","patch_url":"https://github.com/civicrm/civicrm-core/pull/6872.patch","issue_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/6872","number":6872,"state":"open","locked":false,"title":"CRM-17327: Provided (failing) unit test to demonstrate the bug.","user":{"login":"GinkgoFJG","id":871819,"avatar_url":"https://avatars.githubusercontent.com/u/871819?v=3","gravatar_id":"","url":"https://api.github.com/users/GinkgoFJG","html_url":"https://github.com/GinkgoFJG","followers_url":"https://api.github.com/users/GinkgoFJG/followers","following_url":"https://api.github.com/users/GinkgoFJG/following{/other_user}","gists_url":"https://api.github.com/users/GinkgoFJG/gists{/gist_id}","starred_url":"https://api.github.com/users/GinkgoFJG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GinkgoFJG/subscriptions","organizations_url":"https://api.github.com/users/GinkgoFJG/orgs","repos_url":"https://api.github.com/users/GinkgoFJG/repos","events_url":"https://api.github.com/users/GinkgoFJG/events{/privacy}","received_events_url":"https://api.github.com/users/GinkgoFJG/received_events","type":"User","site_admin":false},"body":"* [CRM-17327: When chaining a getsingle call, if the getsingle for an entity fails, the API erroneously appends the previous entity's api.\\*.getsingle property to the current entity](https://issues.civicrm.org/jira/browse/CRM-17327)","created_at":"2015-10-02T01:23:59Z","updated_at":"2015-10-07T20:32:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83d70bfbb32d6517fb49ecc710b88a49bb8ad9c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/6872/commits","review_comments_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/6872/comments","review_comment_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/6872/comments","statuses_url":"https://api.github.com/repos/civicrm/civicrm-core/statuses/ebbf5a8963711f0329413dd9596ced9f36f648e5","head":{"label":"GinkgoFJG:CRM-17327","ref":"CRM-17327","sha":"ebbf5a8963711f0329413dd9596ced9f36f648e5","user":{"login":"GinkgoFJG","id":871819,"avatar_url":"https://avatars.githubusercontent.com/u/871819?v=3","gravatar_id":"","url":"https://api.github.com/users/GinkgoFJG","html_url":"https://github.com/GinkgoFJG","followers_url":"https://api.github.com/users/GinkgoFJG/followers","following_url":"https://api.github.com/users/GinkgoFJG/following{/other_user}","gists_url":"https://api.github.com/users/GinkgoFJG/gists{/gist_id}","starred_url":"https://api.github.com/users/GinkgoFJG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GinkgoFJG/subscriptions","organizations_url":"https://api.github.com/users/GinkgoFJG/orgs","repos_url":"https://api.github.com/users/GinkgoFJG/repos","events_url":"https://api.github.com/users/GinkgoFJG/events{/privacy}","received_events_url":"https://api.github.com/users/GinkgoFJG/received_events","type":"User","site_admin":false},"repo":{"id":11407494,"name":"civicrm-core","full_name":"GinkgoFJG/civicrm-core","owner":{"login":"GinkgoFJG","id":871819,"avatar_url":"https://avatars.githubusercontent.com/u/871819?v=3","gravatar_id":"","url":"https://api.github.com/users/GinkgoFJG","html_url":"https://github.com/GinkgoFJG","followers_url":"https://api.github.com/users/GinkgoFJG/followers","following_url":"https://api.github.com/users/GinkgoFJG/following{/other_user}","gists_url":"https://api.github.com/users/GinkgoFJG/gists{/gist_id}","starred_url":"https://api.github.com/users/GinkgoFJG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GinkgoFJG/subscriptions","organizations_url":"https://api.github.com/users/GinkgoFJG/orgs","repos_url":"https://api.github.com/users/GinkgoFJG/repos","events_url":"https://api.github.com/users/GinkgoFJG/events{/privacy}","received_events_url":"https://api.github.com/users/GinkgoFJG/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GinkgoFJG/civicrm-core","description":"CiviCRM (Core Application and Framework)","fork":true,"url":"https://api.github.com/repos/GinkgoFJG/civicrm-core","forks_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/forks","keys_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/teams","hooks_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/hooks","issue_events_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/issues/events{/number}","events_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/events","assignees_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/assignees{/user}","branches_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/branches{/branch}","tags_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/tags","blobs_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/languages","stargazers_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/stargazers","contributors_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/contributors","subscribers_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/subscribers","subscription_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/subscription","commits_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/contents/{+path}","compare_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/merges","archive_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/downloads","issues_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/issues{/number}","pulls_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/labels{/name}","releases_url":"https://api.github.com/repos/GinkgoFJG/civicrm-core/releases{/id}","created_at":"2013-07-14T18:47:17Z","updated_at":"2014-07-16T21:58:10Z","pushed_at":"2015-10-07T15:35:06Z","git_url":"git://github.com/GinkgoFJG/civicrm-core.git","ssh_url":"git@github.com:GinkgoFJG/civicrm-core.git","clone_url":"https://github.com/GinkgoFJG/civicrm-core.git","svn_url":"https://github.com/GinkgoFJG/civicrm-core","homepage":null,"size":94722,"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":"master"}},"base":{"label":"civicrm:4.6","ref":"4.6","sha":"a442d3eb72edea0f2f2452704e49e446965541a3","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":8495499,"name":"civicrm-core","full_name":"civicrm/civicrm-core","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civicrm-core","description":"CiviCRM (Core Application and Framework)","fork":false,"url":"https://api.github.com/repos/civicrm/civicrm-core","forks_url":"https://api.github.com/repos/civicrm/civicrm-core/forks","keys_url":"https://api.github.com/repos/civicrm/civicrm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civicrm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civicrm-core/teams","hooks_url":"https://api.github.com/repos/civicrm/civicrm-core/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civicrm-core/events","assignees_url":"https://api.github.com/repos/civicrm/civicrm-core/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civicrm-core/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civicrm-core/tags","blobs_url":"https://api.github.com/repos/civicrm/civicrm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civicrm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civicrm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civicrm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civicrm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civicrm-core/languages","stargazers_url":"https://api.github.com/repos/civicrm/civicrm-core/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civicrm-core/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civicrm-core/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civicrm-core/subscription","commits_url":"https://api.github.com/repos/civicrm/civicrm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civicrm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civicrm-core/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civicrm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civicrm-core/merges","archive_url":"https://api.github.com/repos/civicrm/civicrm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civicrm-core/downloads","issues_url":"https://api.github.com/repos/civicrm/civicrm-core/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civicrm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civicrm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civicrm-core/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civicrm-core/releases{/id}","created_at":"2013-03-01T06:11:56Z","updated_at":"2015-10-03T18:34:19Z","pushed_at":"2015-10-07T18:53:29Z","git_url":"git://github.com/civicrm/civicrm-core.git","ssh_url":"git@github.com:civicrm/civicrm-core.git","clone_url":"https://github.com/civicrm/civicrm-core.git","svn_url":"https://github.com/civicrm/civicrm-core","homepage":null,"size":148775,"stargazers_count":124,"watchers_count":124,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":328,"mirror_url":null,"open_issues_count":90,"forks":328,"open_issues":90,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/6872"},"html":{"href":"https://github.com/civicrm/civicrm-core/pull/6872"},"issue":{"href":"https://api.github.com/repos/civicrm/civicrm-core/issues/6872"},"comments":{"href":"https://api.github.com/repos/civicrm/civicrm-core/issues/6872/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/6872/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/6872/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/civicrm-core/statuses/ebbf5a8963711f0329413dd9596ced9f36f648e5"}}}}