[fix] wrong component detection in some Windows servers #7693
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently the automatic component detection in
JLayout
is based in the constantJPATH_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 usingJApplicationHelper
which I think is more reliable.Testing
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.
B/C issues
This is a bug fix that shouldn't cause any B/C issue.