-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[namespace] Move disptacher to namespace #13953
Conversation
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function __construct(\JApplicationCms $app, \JUser $user, \JLanguage $language) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need for these extra properties. $app->getUser()
will return the user object, and $app->getLanguage
will get the language object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are also missing these properties when you create the class in JComponentHelper
so banners is now fatal erroring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getUser() is not available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies I meant getIdentity()
(which comes from https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Cms/Application/IdentityAware.php)
👍 for namespacing - but your modifications are wrong :) |
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
private $app; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I ask why $app is private? What if in component dispatcher (like in BannersDispatcher class) we need to access to app object ? Maybe it should be protected instead of private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would even pass the app as argument to the dispatch function. But don't know why it was decided as a constructor argument, so I left it as it was made in the original PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally because I was going to load language files in the constructor. But @mbabker objected. So there's no good reason. But it probably does belong here anyhow, so extensions doing any other logic can do thing in the constructor
But @joomdonation is right it should have been protected
My last commit is using the user and language from the app and making the app available trough |
👍 |
@@ -24,8 +24,6 @@ class InstallerViewManage extends InstallerViewDefault | |||
|
|||
protected $form; | |||
|
|||
protected $state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we remove the state here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I was testing to install DPCalendar I got an error that $state needs to be public. It is already set up in the base class, so no need to do it here again, that's why I removed it here. It's a bug fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a new property in 4.x. This needs to go back into staging if it's a bug. Or at least put it into a separate PR. Let's keep PR's single responsibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right then that comes from this #12173 let's open up a separate issue for that. Because that's totally unrelated to dispatcher and so let's handle it in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with #13980.
If you can remove this com_installer code i guess you accidently committed this is good to go |
Reverted the change. Will do a pr with the cleanup. |
👍 |
The disptacher functionality introduced with #13687 as namespaced version.