Skip to content
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

Merged
merged 4 commits into from
Feb 8, 2017

Conversation

laoneo
Copy link
Member

@laoneo laoneo commented Feb 6, 2017

The disptacher functionality introduced with #13687 as namespaced version.

*
* @since __DEPLOY_VERSION__
*/
public function __construct(\JApplicationCms $app, \JUser $user, \JLanguage $language)
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getUser() is not available

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wilsonge
Copy link
Contributor

wilsonge commented Feb 8, 2017

👍 for namespacing - but your modifications are wrong :)

@wilsonge wilsonge added this to the Joomla 4.0 milestone Feb 8, 2017
*
* @since __DEPLOY_VERSION__
*/
private $app;
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

@wilsonge wilsonge Feb 8, 2017

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

@laoneo
Copy link
Member Author

laoneo commented Feb 8, 2017

My last commit is using the user and language from the app and making the app available trough getApplication().

@wilsonge
Copy link
Contributor

wilsonge commented Feb 8, 2017

👍

@@ -24,8 +24,6 @@ class InstallerViewManage extends InstallerViewDefault

protected $form;

protected $state;
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with #13980.

@wilsonge
Copy link
Contributor

wilsonge commented Feb 8, 2017

If you can remove this com_installer code i guess you accidently committed this is good to go

@laoneo
Copy link
Member Author

laoneo commented Feb 8, 2017

Reverted the change. Will do a pr with the cleanup.

@wilsonge wilsonge merged commit a6fab4f into joomla:4.0-dev Feb 8, 2017
@wilsonge
Copy link
Contributor

wilsonge commented Feb 8, 2017

👍

@laoneo laoneo deleted the j4/namespace/dispatcher branch February 8, 2017 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants