joomla-cms
joomla-cms copied to clipboard
[5.2] Remove Toolbar::getInstance() from views
Summary of Changes
Toolbar::getInstance() has been deprecated for quite some time now, but the alternative wasn't really clear yet. This PR replaces all occurences with $this->getDocument()->getToolbar() instead. This leaves the Toolbar::getInstance() in the ToolbarHelper class.
Testing Instructions
Codereview
Link to documentations
Please select:
-
[ ] Documentation link for docs.joomla.org:
-
[X] No documentation changes for docs.joomla.org needed
-
[ ] Pull Request link for manual.joomla.org:
-
[X] No documentation changes for manual.joomla.org needed
What the issue @brianteeman ?
What the issue @brianteeman ?
- obvious errors due to blindly search/replace (picked up by drone)
- stating that no documentation is required.
I checked all files but can't find a search replace issue. if you mean the conversation from Toolbar::getInstance('toolbar'); to $this->getDocument()->getToolbar(); without the parameter toolbar this is ok because the default toolbar is toolbar.
on the side I checked some file for missing removal of the use statement for the toolbar which can be removed if not used, as it has been done for some view.
Sorry no idea as its been 10 weeks but based on my comment it must have been something shown up in drone so maybe retrigger drone and see
@Hackwar Could you please remove the unused use Joomla\CMS\Toolbar\Toolbar; statements?
Done
Done
I flagged some. There are more to remove.
Done
I flagged some. There are more to remove.
No, I thoroughly went through them all at that time and all other instances are still in use.
@Quy the code style checker should also throw an error when there are unused imports. So I guess we are fine here, or?
@laoneo Yes. Please discard my comments.
Thanks!