{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/3780","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/3780/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/3780/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/3780/events","html_url":"https://github.com/joomla/joomla-cms/pull/3780","id":35729897,"number":3780,"title":"[#32854] Use JLayout to render debug backtrace and add backtrace in isis template error.php","user":{"login":"asika32764","id":1639206,"avatar_url":"https://avatars.githubusercontent.com/u/1639206?v=3","gravatar_id":"","url":"https://api.github.com/users/asika32764","html_url":"https://github.com/asika32764","followers_url":"https://api.github.com/users/asika32764/followers","following_url":"https://api.github.com/users/asika32764/following{/other_user}","gists_url":"https://api.github.com/users/asika32764/gists{/gist_id}","starred_url":"https://api.github.com/users/asika32764/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asika32764/subscriptions","organizations_url":"https://api.github.com/users/asika32764/orgs","repos_url":"https://api.github.com/users/asika32764/repos","events_url":"https://api.github.com/users/asika32764/events{/privacy}","received_events_url":"https://api.github.com/users/asika32764/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-06-14T14:56:41Z","updated_at":"2015-08-21T05:41:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/3780","html_url":"https://github.com/joomla/joomla-cms/pull/3780","diff_url":"https://github.com/joomla/joomla-cms/pull/3780.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/3780.patch"},"body":"This is same as #2626 but direct to `staging` branch.\r\n\r\n## Introduction\r\n\r\nIn current time, we use `setError()`, `getError()` and `JError::raiseError()` in component to send error message.\r\n\r\nHowever, if we use throw `Exception`, the debug plugin will not render backtrace for developer. It only work when we use `JError::raiseError()`.\r\n\r\nIt's because we have this code in: https://github.com/joomla/joomla-cms/blob/master/plugins/system/debug/debug.php#L213\r\n\r\n``` php\r\nif (JDEBUG)\r\n\t\t{\r\n\t\t\tif (JError::getErrors())\r\n\t\t\t{\r\n\t\t\t\t$html[] = $this->display('errors');\r\n\t\t\t}\r\n```\r\n\r\nTo detect whether display errors or not. When we throw an exception, the `JError::getErrors()` will return null that backtrace will not rendered.\r\n\r\n## The Modification\r\n\r\nI added backtrace layout in `layouts/error/backtrace.php` and now, debug plugin & isis template both include this layout. It will help developers know how errors occurred.\r\n\r\n## How to Test\r\n\r\n1. Go to `Global Configuration`, enable the debug mode.\r\n2. Then type `index.php?option=foo` in browser, you will see the error page.\r\n\r\n## Screenshot\r\n![p2013-12-01-3](https://f.cloud.github.com/assets/1639206/1650232/eb7e84cc-5a73-11e3-996e-81446b8b5845.jpg)\r\n\r\n![p-2014-06-14-3](https://cloud.githubusercontent.com/assets/1639206/3278790/fcf7423a-f3d3-11e3-83da-e5b952a5464c.jpg)\r\n\r\n\r\nJTracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32854&start=0"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/133295220","html_url":"https://github.com/joomla/joomla-cms/pull/3780#issuecomment-133295220","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/3780","id":133295220,"user":{"login":"roland-d","id":359377,"avatar_url":"https://avatars.githubusercontent.com/u/359377?v=3","gravatar_id":"","url":"https://api.github.com/users/roland-d","html_url":"https://github.com/roland-d","followers_url":"https://api.github.com/users/roland-d/followers","following_url":"https://api.github.com/users/roland-d/following{/other_user}","gists_url":"https://api.github.com/users/roland-d/gists{/gist_id}","starred_url":"https://api.github.com/users/roland-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roland-d/subscriptions","organizations_url":"https://api.github.com/users/roland-d/orgs","repos_url":"https://api.github.com/users/roland-d/repos","events_url":"https://api.github.com/users/roland-d/events{/privacy}","received_events_url":"https://api.github.com/users/roland-d/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T05:41:23Z","updated_at":"2015-08-21T05:41:23Z","body":"@asika32764 Thank you for your reply. I will try to find someone to take this over."}}