{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/12842","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/12842/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/12842/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/12842/events","html_url":"https://github.com/joomla/joomla-cms/issues/12842","id":188131018,"number":12842,"title":"JLayoutFile - force client - not working properly?","user":{"login":"PhocaCz","id":5381559,"avatar_url":"https://avatars.githubusercontent.com/u/5381559?v=3","gravatar_id":"","url":"https://api.github.com/users/PhocaCz","html_url":"https://github.com/PhocaCz","followers_url":"https://api.github.com/users/PhocaCz/followers","following_url":"https://api.github.com/users/PhocaCz/following{/other_user}","gists_url":"https://api.github.com/users/PhocaCz/gists{/gist_id}","starred_url":"https://api.github.com/users/PhocaCz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhocaCz/subscriptions","organizations_url":"https://api.github.com/users/PhocaCz/orgs","repos_url":"https://api.github.com/users/PhocaCz/repos","events_url":"https://api.github.com/users/PhocaCz/events{/privacy}","received_events_url":"https://api.github.com/users/PhocaCz/received_events","type":"User","site_admin":false},"labels":[{"id":138443932,"url":"https://api.github.com/repos/joomla/joomla-cms/labels/No%20Code%20Attached%20Yet","name":"No Code Attached Yet","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":30,"created_at":"2016-11-08T23:19:57Z","updated_at":"2016-12-05T23:24:45Z","closed_at":null,"body":"### Steps to reproduce the issue\r\n- Initialize JLayoutFile\r\n- Set client to frontend - 'client' => 0 (force frontend layout: https://docs.joomla.org/J3.x:JLayout_Improvements_for_Joomla - Force Client)\r\n- and run this code in administration (administration of component)\r\n`$layout\t= new JLayoutFile('layout_file', null, array('client' => 0));`\r\n\r\nYou get the following path for reading layouts\r\n\r\n- administrator/templates/isis/html/layouts/com_your_component\r\n- components/com_your_component/layouts\r\n- administrator/templates/isis/html/layouts\r\n- layouts\r\n\r\n### Expected result\r\nHard to say, but I would expect:\r\n\r\n- templates/current-frontend-template/html/layouts/com_your_component\r\n- components/com_your_component/layouts\r\n- templates/current-frontend-template/html/layouts\r\n- layouts\r\n\r\nIf I force client - frontend, I would expect, the frontend template will be included, not the administration template\r\n\r\n\r\n\r\n### Actual result\r\nadministrator/templates/isis/html/layouts/com_your_component\r\ncomponents/com_your_component/layouts\r\nadministrator/templates/isis/html/layouts\r\nlayouts\r\n\r\n\r\n\r\n### System information (as much as possible)\r\nPHP5, PHP7, Joomla! 3.6.4\r\n\r\n\r\n### Additional comments\r\nThe Layout code is (cca. line: 587)\r\n\r\n```\r\n// (2) Component template overrides path\r\n\t\t\t$paths[] = JPATH_THEMES . '/' . JFactory::getApplication()->getTemplate() . '/html/layouts/' . $component;\r\n\r\n\t\t\t// (3) Component path\r\n\t\t\tif ($this->options->get('client') == 0)\r\n\t\t\t{\r\n\t\t\t\t$paths[] = JPATH_SITE . '/components/' . $component . '/layouts';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$paths[] = JPATH_ADMINISTRATOR . '/components/' . $component . '/layouts';\r\n\t\t\t}\r\n```\r\n\r\nMaybe the condition if ($this->options->get('client') == 0) should work for template too. If I need to force frontend I need it including the frontend template :idea:\r\n\r\nThank you, Jan"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/265011344","html_url":"https://github.com/joomla/joomla-cms/issues/12842#issuecomment-265011344","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/12842","id":265011344,"user":{"login":"PhocaCz","id":5381559,"avatar_url":"https://avatars.githubusercontent.com/u/5381559?v=3","gravatar_id":"","url":"https://api.github.com/users/PhocaCz","html_url":"https://github.com/PhocaCz","followers_url":"https://api.github.com/users/PhocaCz/followers","following_url":"https://api.github.com/users/PhocaCz/following{/other_user}","gists_url":"https://api.github.com/users/PhocaCz/gists{/gist_id}","starred_url":"https://api.github.com/users/PhocaCz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhocaCz/subscriptions","organizations_url":"https://api.github.com/users/PhocaCz/orgs","repos_url":"https://api.github.com/users/PhocaCz/repos","events_url":"https://api.github.com/users/PhocaCz/events{/privacy}","received_events_url":"https://api.github.com/users/PhocaCz/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T23:24:45Z","updated_at":"2016-12-05T23:24:45Z","body":"@mbabker \r\nThank you, now I understand and yes, \"if someone was crazy enough to redefine\" defines.php, I think this:\r\n\r\n> $jPathThemesFrontend = JPATH_ROOT . DIRECTORY_SEPARATOR . 'templates';\r\n\r\nwill be the slightest problem he/she gets :-)\r\n"}}
{"actor":{"display_login":"PhocaCz"}}