User tests: Successful: Unsuccessful:
Currently the automatic component detection in JLayout
is based in the constant JPATH_COMPONENT
and in explode the path that it contains with:
$parts = explode('/', JPATH_COMPONENT);
But actually Windows paths can be something like:
C:\Xamp\htdocs\joomla-cms\components\com_content
So the explode will return the full path instead of the expected com_content
and then the component won't be found enqueuing a system message with something like:
WARNING: Error component not found: com_content
Instead of applying a patch based in fixing detection based in JPATH_COMPONENT
I have opted for using JApplicationHelper
which I think is more reliable.
You need a windows machine for it. I'm not even sure this happens in all the Windows systems (linux user here). Any layout rendered should show the error message.
This is a bug fix that shouldn't cause any B/C issue.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
JPATH_COMPONENT is defined at https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/component/helper.php#L344. As we can see, the separator between the path and the component name is / character, so the original code is valid and there is no bug like @phproberto said.
However, this change is still OK. +1 for getting it merged.
@joomdonation it defined there only if (!defined('JPATH_COMPONENT'))
Category | ⇒ | Layout Libraries |
Yes the issue is when is defined using things like __DIR__
or other settings by third part extensions. Anyway I think is better to relay in one single core method and avoid depending on JPATH_COMPONENT
.
I cannot test on Windows,
but after patch it still works as expected, and as fix looks valid I set test ok
Status | Pending | ⇒ | Ready to Commit |
RTC. Thanks @phproberto @Fedik and @joomdonation
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-08-16 15:19:15 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
Milestone |
Added: |
I'm unable to replicate any issues on Windows (local with XAMPP) but i can confirm that both ways return the same value so i can count me as successfull test.
A dirty test
Add the following code to the index.php of your template
and confirm that you have a output like
com_content/com_content