{"action":"created","issue":{"url":"https://api.github.com/repos/opencart/opencart/issues/6471","repository_url":"https://api.github.com/repos/opencart/opencart","labels_url":"https://api.github.com/repos/opencart/opencart/issues/6471/labels{/name}","comments_url":"https://api.github.com/repos/opencart/opencart/issues/6471/comments","events_url":"https://api.github.com/repos/opencart/opencart/issues/6471/events","html_url":"https://github.com/opencart/opencart/issues/6471","id":306224467,"node_id":"MDU6SXNzdWUzMDYyMjQ0Njc=","number":6471,"title":"[v3.0.2.0 - Fix] - catalog\\controller\\startup\\session.php file","user":{"login":"kid1194","id":7622668,"node_id":"MDQ6VXNlcjc2MjI2Njg=","avatar_url":"https://avatars2.githubusercontent.com/u/7622668?v=4","gravatar_id":"","url":"https://api.github.com/users/kid1194","html_url":"https://github.com/kid1194","followers_url":"https://api.github.com/users/kid1194/followers","following_url":"https://api.github.com/users/kid1194/following{/other_user}","gists_url":"https://api.github.com/users/kid1194/gists{/gist_id}","starred_url":"https://api.github.com/users/kid1194/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kid1194/subscriptions","organizations_url":"https://api.github.com/users/kid1194/orgs","repos_url":"https://api.github.com/users/kid1194/repos","events_url":"https://api.github.com/users/kid1194/events{/privacy}","received_events_url":"https://api.github.com/users/kid1194/received_events","type":"User","site_admin":false},"labels":[{"id":315241878,"node_id":"MDU6TGFiZWwzMTUyNDE4Nzg=","url":"https://api.github.com/repos/opencart/opencart/labels/Needs%20testing","name":"Needs testing","color":"e6e6e6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-18T09:10:58Z","updated_at":"2018-07-30T07:06:07Z","closed_at":null,"author_association":"NONE","body":"Sometimes the $this->request->get['api_token'] returns NULL because it doesn't exist. I faced this error in the not_found page. So my solution was:\r\n\r\nTo change this: \r\n$api_query = $this->db->query(\"SELECT DISTINCT * FROM `\" . DB_PREFIX . \"api` `a` LEFT JOIN `\" . DB_PREFIX . \"api_session` `as` ON (a.api_id = as.api_id) LEFT JOIN \" . DB_PREFIX . \"api_ip `ai` ON (a.api_id = ai.api_id) WHERE a.status = '1' AND `as`.`session_id` = '\" . $this->db->escape($this->request->get['api_token']) . \"' AND ai.ip = '\" . $this->db->escape($this->request->server['REMOTE_ADDR']) . \"'\");\r\n\r\nInto this:\r\n$api_token = (isset($this->request->get['api_token'])) ? $this->request->get['api_token'] : 0;\r\n$api_query = $this->db->query(\"SELECT DISTINCT * FROM `\" . DB_PREFIX . \"api` `a` LEFT JOIN `\" . DB_PREFIX . \"api_session` `as` ON (a.api_id = as.api_id) LEFT JOIN \" . DB_PREFIX . \"api_ip `ai` ON (a.api_id = ai.api_id) WHERE a.status = '1' AND `as`.`session_id` = '\" . $this->db->escape($api_token) . \"' AND ai.ip = '\" . $this->db->escape($this->request->server['REMOTE_ADDR']) . \"'\");\r\n\r\nI hope that I was helpful.\r\nBest regards"},"comment":{"url":"https://api.github.com/repos/opencart/opencart/issues/comments/408767224","html_url":"https://github.com/opencart/opencart/issues/6471#issuecomment-408767224","issue_url":"https://api.github.com/repos/opencart/opencart/issues/6471","id":408767224,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODc2NzIyNA==","user":{"login":"cyberformed","id":13065921,"node_id":"MDQ6VXNlcjEzMDY1OTIx","avatar_url":"https://avatars0.githubusercontent.com/u/13065921?v=4","gravatar_id":"","url":"https://api.github.com/users/cyberformed","html_url":"https://github.com/cyberformed","followers_url":"https://api.github.com/users/cyberformed/followers","following_url":"https://api.github.com/users/cyberformed/following{/other_user}","gists_url":"https://api.github.com/users/cyberformed/gists{/gist_id}","starred_url":"https://api.github.com/users/cyberformed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyberformed/subscriptions","organizations_url":"https://api.github.com/users/cyberformed/orgs","repos_url":"https://api.github.com/users/cyberformed/repos","events_url":"https://api.github.com/users/cyberformed/events{/privacy}","received_events_url":"https://api.github.com/users/cyberformed/received_events","type":"User","site_admin":false},"created_at":"2018-07-30T07:06:07Z","updated_at":"2018-07-30T07:06:07Z","author_association":"NONE","body":"https://github.com/kid1194 \r\n\r\nThanks for the solution. It worked for me."}}
{"actor":{"display_login":"cyberformed"}}