-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.2] Load the namespace from the cached manifest #44737
[5.2] Load the namespace from the cached manifest #44737
Conversation
I have tested this item ✅ successfully on 98907ee This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44737. |
1 similar comment
I have tested this item ✅ successfully on 98907ee This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44737. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44737. |
I am sorry to say, but this should not be merged.
It is design flaw. Can just remove that as useles property :) If we need this feature it should be proper API that will cover all extension. |
I am not sure why it is needed but it is one field more in the queue that is already running and it sets a propery that is also there. So if this is not needed then we should remove the property and not let it NULL. |
that's the point an empty variable doesn't make sense and in this I need it so I thought it was simply for forgotten. |
Sorry, I was aware that we do not use it in core at the moment, but didn't think carefully enough about few extra bytes on each request for nothing which @Fedik point out. For this, I agree with @Fedik This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44737. |
Ok, then please tell me a better solution to get a namespace of any extension. |
In theory we should not need to know the namespace, however I agree in some cases it is usefull. If I would need it I would just do some little helper for myself that read it directly from XML, as it done in https://github.com/joomla/joomla-cms/blob/5.2-dev/libraries/namespacemap.php Or maybe as part of |
ok then I see we have a function what exactly does your suggestion but you don't want it because creating a completely new (everyone at it's own) is better? Sorry but that doesn't make sense for me. Even if you are right that the namespace in theory is not needed, but only if you are in the joomla context, is a bit different if you do strange things like prefixing 3rd party libraries. To solve my issue I think I would only need a helperFactory in the component but to be honest that's something which is even worse ;-) |
Well, that is not me who designed it ;) I think someone just forgot to remove the $namspace property of ComponentRecored when JNamespacePsr4Map was writen. |
I'm ok with deprecating this variable for the future if we have a better way but at the moment I see no other way coming to town right? |
I'm siding with Harald on this one and thus merged it. Thank you! If you think this is wrong, lets please open a PR to deprecate this attribute. |
What a horrible mistake you guys just did. In patch release. |
Please guys, revert this pr. It brings us back to the ages where single classes will be instantiated. @Fedik is completely right, this needs to be removed and everything should go through the service provider. |
…44755) This reverts commit ca1a8e6. Co-authored-by: Allon Moritz <[email protected]>
I've re-added the 5.2.4 milestone. We've added this to the 5.2-dev branch for 5.2.4, and fixed it with #44755 |
Summary of Changes
Set the namespace in componentHelper::getComponent() result.
Testing Instructions
Use an namespace extension, execute
var_dump(componentHelper::getComponent('com_xxx')
;Actual result BEFORE applying this Pull Request
$namespace is always null
Expected result AFTER applying this Pull Request
$namespace is filled if extension has an namespace
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed