{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/6395","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6395/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6395/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6395/events","html_url":"https://github.com/joomla/joomla-cms/pull/6395","id":60691303,"number":6395,"title":"Remove attempt to translate messages while in debug mode","user":{"login":"mbabker","id":368545,"avatar_url":"https://avatars.githubusercontent.com/u/368545?v=3","gravatar_id":"","url":"https://api.github.com/users/mbabker","html_url":"https://github.com/mbabker","followers_url":"https://api.github.com/users/mbabker/followers","following_url":"https://api.github.com/users/mbabker/following{/other_user}","gists_url":"https://api.github.com/users/mbabker/gists{/gist_id}","starred_url":"https://api.github.com/users/mbabker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbabker/subscriptions","organizations_url":"https://api.github.com/users/mbabker/orgs","repos_url":"https://api.github.com/users/mbabker/repos","events_url":"https://api.github.com/users/mbabker/events{/privacy}","received_events_url":"https://api.github.com/users/mbabker/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":3,"created_at":"2015-03-11T16:59:18Z","updated_at":"2015-03-12T23:14:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/6395","html_url":"https://github.com/joomla/joomla-cms/pull/6395","diff_url":"https://github.com/joomla/joomla-cms/pull/6395.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/6395.patch"},"body":"In `JLanguage::parse()` exists a condition to enter a recursive loop involving an improperly formatted override INI file.  In the application bootup, the first call to `JLanguage::getInstance()` is the call that builds the language object that is eventually stored to `JFactory`.  Within JLanguage's constructor, we scan for an override INI file and attempt to load it.  While in debug mode, if the file has any errors, we attempt to display a translated message (since this is not the `en-GB.ini` file), which calls `JText::sprintf()`, and from within that message we call `JFactory::getLanguage()`.  Since the JLanguage object is not yet set, JFactory attempts to create it, and we have now entered our recursive loop.\r\n\r\nI propose to just remove the call to `JText::sprintf()` and always throw a hardcoded English message always instead.  As JLanguage is our language parser, I feel it is incorrect that it attempts to create translated error messages, especially in a section of code that is supposed to be scanning for errors, and demonstrated by this use case this can cause a site to error out.\r\n\r\nBelow is a sample stack trace I was provided by a user troubleshooting this issue which demonstrates the recursive loop being entered into.\r\n\r\n```sh\r\nCall Stack\r\n#    Time    Memory    Function    Location\r\n1    0.0019    145848    {main}( )    ..\\index.php:0\r\n2    0.1031    2110856    JApplicationCms->execute( )    ..\\index.php:40\r\n3    0.1031    2111064    JApplicationSite->doExecute( )    ..\\cms.php:251\r\n4    0.1031    2111344    JApplicationSite->initialiseApp( )    ..\\site.php:209\r\n5    0.1467    3369104    JApplicationCms->initialiseApp( )    ..\\site.php:649\r\n6    0.1468    3356472    JLanguage::getInstance( )    ..\\cms.php:557\r\n7    0.1468    3357712    JLanguage->__construct( )    ..\\language.php:301\r\n8    0.1504    3358992    JLanguage->parse( )    ..\\language.php:200\r\n9    0.1541    3408640    JText::sprintf( )    ..\\language.php:896\r\n10    0.1541    3408680    JFactory::getLanguage( )    ..\\text.php:253\r\n11    0.1542    3408720    JFactory::createLanguage( )    ..\\factory.php:195\r\n12    0.1542    3408720    JLanguage::getInstance( )    ..\\factory.php:706\r\n13    0.1542    3409752    JLanguage->__construct( )    ..\\language.php:301\r\n14    0.1582    3410512    JLanguage->parse( )    ..\\language.php:200\r\n15    0.1604    3423128    JText::sprintf( )    ..\\language.php:896\r\n16    0.1604    3423128    JFactory::getLanguage( )    ..\\text.php:253\r\n17    0.1604    3423128    JFactory::createLanguage( )    ..\\factory.php:195\r\n18    0.1605    3423128    JLanguage::getInstance( )    ..\\factory.php:706\r\n19    0.1605    3424160    JLanguage->__construct( )    ..\\language.php:301\r\n20    0.1644    3424920    JLanguage->parse( )    ..\\language.php:200\r\n21    0.1666    3437536    JText::sprintf( )    ..\\language.php:896\r\n22    0.1666    3437536    JFactory::getLanguage( )    ..\\text.php:253\r\n23    0.1666    3437536    JFactory::createLanguage( )    ..\\factory.php:195\r\n24    0.1666    3437536    JLanguage::getInstance( )    ..\\factory.php:706\r\n25    0.1666    3438568    JLanguage->__construct( )    ..\\language.php:301\r\n```"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/78683929","html_url":"https://github.com/joomla/joomla-cms/pull/6395#issuecomment-78683929","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6395","id":78683929,"user":{"login":"zero-24","id":2596554,"avatar_url":"https://avatars.githubusercontent.com/u/2596554?v=3","gravatar_id":"","url":"https://api.github.com/users/zero-24","html_url":"https://github.com/zero-24","followers_url":"https://api.github.com/users/zero-24/followers","following_url":"https://api.github.com/users/zero-24/following{/other_user}","gists_url":"https://api.github.com/users/zero-24/gists{/gist_id}","starred_url":"https://api.github.com/users/zero-24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zero-24/subscriptions","organizations_url":"https://api.github.com/users/zero-24/orgs","repos_url":"https://api.github.com/users/zero-24/repos","events_url":"https://api.github.com/users/zero-24/events{/privacy}","received_events_url":"https://api.github.com/users/zero-24/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T23:14:55Z","updated_at":"2015-03-12T23:14:55Z","body":"RTC based on testing. Thanks!<hr /><sub>This comment was created with the <a href=\"https://github.com/joomla/jissues\">J!Tracker Application</a> at <a href=\"http://issues.joomla.org/tracker/joomla-cms/6395\">issues.joomla.org/joomla-cms/6395</a>.</sub>"}}