{"action":"created","issue":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10057","repository_url":"https://api.github.com/repos/civicrm/civicrm-core","labels_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10057/labels{/name}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10057/comments","events_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10057/events","html_url":"https://github.com/civicrm/civicrm-core/pull/10057","id":217235437,"number":10057,"title":"CRM-20342: Fatal Error on View Membership","user":{"login":"jitendrapurohit","id":5929648,"avatar_url":"https://avatars0.githubusercontent.com/u/5929648?v=3","gravatar_id":"","url":"https://api.github.com/users/jitendrapurohit","html_url":"https://github.com/jitendrapurohit","followers_url":"https://api.github.com/users/jitendrapurohit/followers","following_url":"https://api.github.com/users/jitendrapurohit/following{/other_user}","gists_url":"https://api.github.com/users/jitendrapurohit/gists{/gist_id}","starred_url":"https://api.github.com/users/jitendrapurohit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitendrapurohit/subscriptions","organizations_url":"https://api.github.com/users/jitendrapurohit/orgs","repos_url":"https://api.github.com/users/jitendrapurohit/repos","events_url":"https://api.github.com/users/jitendrapurohit/events{/privacy}","received_events_url":"https://api.github.com/users/jitendrapurohit/received_events","type":"User","site_admin":false},"labels":[{"id":246037889,"url":"https://api.github.com/repos/civicrm/civicrm-core/labels/master","name":"master","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-03-27T12:51:35Z","updated_at":"2017-03-28T05:37:11Z","closed_at":"2017-03-28T05:37:11Z","pull_request":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/10057","html_url":"https://github.com/civicrm/civicrm-core/pull/10057","diff_url":"https://github.com/civicrm/civicrm-core/pull/10057.diff","patch_url":"https://github.com/civicrm/civicrm-core/pull/10057.patch"},"body":"addField() uses getApiEntity() to check the api and eventually breaks into the error on view page. Either we can extend those to support view action as below or proceed with this simple replacement PR.\r\n\r\n    diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php\r\n    index 9969e6b894..ca76c918fd 100644\r\n    --- a/CRM/Core/Form.php\r\n    +++ b/CRM/Core/Form.php\r\n    @@ -1245,7 +1245,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {\r\n         if ($action & (CRM_Core_Action::UPDATE + CRM_Core_Action::ADD)) {\r\n           return 'create';\r\n         }\r\n    -    if ($action & (CRM_Core_Action::BROWSE + CRM_Core_Action::BASIC + CRM_Core_Action::ADVANCED + CRM_Core_Action::PREVIEW)) {\r\n    +    if ($action & (CRM_Core_Action::VIEW + CRM_Core_Action::BROWSE + CRM_Core_Action::BASIC + CRM_Core_Action::ADVANCED + CRM_Core_Action::PREVIEW)) {\r\n           return 'get';\r\n         }\r\n         // If you get this exception try adding more cases above.\n\n---\n\n * [CRM-20342: Fatal Error on View Membership](https://issues.civicrm.org/jira/browse/CRM-20342)"},"comment":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/comments/289668330","html_url":"https://github.com/civicrm/civicrm-core/pull/10057#issuecomment-289668330","issue_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10057","id":289668330,"user":{"login":"jitendrapurohit","id":5929648,"avatar_url":"https://avatars0.githubusercontent.com/u/5929648?v=3","gravatar_id":"","url":"https://api.github.com/users/jitendrapurohit","html_url":"https://github.com/jitendrapurohit","followers_url":"https://api.github.com/users/jitendrapurohit/followers","following_url":"https://api.github.com/users/jitendrapurohit/following{/other_user}","gists_url":"https://api.github.com/users/jitendrapurohit/gists{/gist_id}","starred_url":"https://api.github.com/users/jitendrapurohit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitendrapurohit/subscriptions","organizations_url":"https://api.github.com/users/jitendrapurohit/orgs","repos_url":"https://api.github.com/users/jitendrapurohit/repos","events_url":"https://api.github.com/users/jitendrapurohit/events{/privacy}","received_events_url":"https://api.github.com/users/jitendrapurohit/received_events","type":"User","site_admin":false},"created_at":"2017-03-28T05:37:11Z","updated_at":"2017-03-28T05:37:11Z","body":"raised here - https://github.com/civicrm/civicrm-core/pull/10060. closing this PR."}}
{"actor":{"display_login":"jitendrapurohit"}}