{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/6773","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6773/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6773/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6773/events","html_url":"https://github.com/joomla/joomla-cms/pull/6773","id":68348288,"number":6773,"title":"Simply the code in backend controllers","user":{"login":"joomdonation","id":977664,"avatar_url":"https://avatars.githubusercontent.com/u/977664?v=3","gravatar_id":"","url":"https://api.github.com/users/joomdonation","html_url":"https://github.com/joomdonation","followers_url":"https://api.github.com/users/joomdonation/followers","following_url":"https://api.github.com/users/joomdonation/following{/other_user}","gists_url":"https://api.github.com/users/joomdonation/gists{/gist_id}","starred_url":"https://api.github.com/users/joomdonation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomdonation/subscriptions","organizations_url":"https://api.github.com/users/joomdonation/orgs","repos_url":"https://api.github.com/users/joomdonation/repos","events_url":"https://api.github.com/users/joomdonation/events{/privacy}","received_events_url":"https://api.github.com/users/joomdonation/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":9,"created_at":"2015-04-14T11:46:07Z","updated_at":"2015-04-15T12:41:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/6773","html_url":"https://github.com/joomla/joomla-cms/pull/6773","diff_url":"https://github.com/joomla/joomla-cms/pull/6773.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/6773.patch"},"body":"## PR Summary\r\n\r\nIn display method of many backend controllers, we are having this code:\r\n\r\n````php\r\n$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));\r\n$this->setMessage($this->getError(), 'error');\r\n````\r\nThese two lines of code is used to set an error message to controller object and display to end-user if users try to edit a record by typing the link directly on browser.\r\n\r\nThe two lines of code can be replaced with just one line of code:\r\n\r\n````php\r\n$this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error');\r\n````\r\nThis is more logic to me. There is no reason to set error message, then call a command to get the same error message to display.\r\n\r\nI made change to few classes as a sample. If people think that this change is valid, I will do the same changes on other classes.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/93373435","html_url":"https://github.com/joomla/joomla-cms/pull/6773#issuecomment-93373435","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6773","id":93373435,"user":{"login":"nueckman","id":984044,"avatar_url":"https://avatars.githubusercontent.com/u/984044?v=3","gravatar_id":"","url":"https://api.github.com/users/nueckman","html_url":"https://github.com/nueckman","followers_url":"https://api.github.com/users/nueckman/followers","following_url":"https://api.github.com/users/nueckman/following{/other_user}","gists_url":"https://api.github.com/users/nueckman/gists{/gist_id}","starred_url":"https://api.github.com/users/nueckman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nueckman/subscriptions","organizations_url":"https://api.github.com/users/nueckman/orgs","repos_url":"https://api.github.com/users/nueckman/repos","events_url":"https://api.github.com/users/nueckman/events{/privacy}","received_events_url":"https://api.github.com/users/nueckman/received_events","type":"User","site_admin":false},"created_at":"2015-04-15T12:41:19Z","updated_at":"2015-04-15T12:41:19Z","body":"To clarify: I'm not against this PR. But if have to disagree with @Bakual \r\n\r\n> That would only be the case if wtouch the library classes.\r\n\r\nOf course libraries are the main suspects, but core elements like mandatory extensions have to take care of B/C too. Hard example: Let's rename a components view."}}