-
-
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
Clean up ContentViewCategory #19237
Clean up ContentViewCategory #19237
Conversation
@@ -79,7 +81,8 @@ public function display($tpl = null) | |||
$numLinks = $params->def('num_links', 4); | |||
$this->vote = JPluginHelper::isEnabled('content', 'vote'); | |||
|
|||
JPluginHelper::importPlugin('content'); | |||
PluginHelper::importPlugin('content'); |
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.
Line 82 has a prefix J
. This one does not. Should they be the same and with or without J
?
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.
Without check line 13
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 have tested this item ✅ successfully on 02f1b74 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19237. |
Ouch |
Pull Request for Issue # .
Summary of Changes
This PR makes some clean up to ContentViewCategory classes:
Use namespace classes instead of it's alias
Move $dispatcher = JEventDispatcher::getInstance(); out of the loop, so we get a bit performance improvement
Remove code to set view layout as it is set on parent class code already https://github.com/joomla/joomla-cms/blob/staging/libraries/src/MVC/View/CategoryView.php#L212-L223
Remove some un-used variables (like $id, $pathway), reuse-existing variable (no need for $menu = $menu->getActive() when we have $active variable keep active menu item before)
Testing Instructions
Code review should be enough. For human testing, please create a menu item to display articles from a category (Category Blog layout menu option for example), check and make sure articles still being displayed like before