bug: Dashboard and Calendar views use deprecated Sidebar::render() #250

Open
opened 2026-06-29 14:32:03 +00:00 by jmiller · 1 comment
Owner

Description

Dashboard\HtmlView.php (line 61) and Calendar\HtmlView.php (line 43) both call \Joomla\CMS\HTML\Sidebar::render() unconditionally. This class is deprecated in Joomla 5+ and will be removed in Joomla 6.

The MokoSuiteCrossHelper::addSubmenu() method already has a progressive approach -- it tries the modern $toolbar->getSubmenu() API first and falls back to Sidebar::addEntry(). However, the two views still call Sidebar::render() to capture the output, which:

  1. Will throw a deprecation notice on Joomla 5
  2. Will fatal error when the class is removed in Joomla 6

No other views in the component (Posts, Services, Templates, Logs, Analytics) use Sidebar::render().

Steps to Reproduce

  1. Open the Dashboard or Calendar view in Joomla 5+ admin
  2. Check PHP error log for deprecation warnings

Expected Behavior

Views should use only the modern toolbar submenu API on Joomla 5+, with no calls to the deprecated Sidebar class.

Fix

Remove $this->sidebar = \Joomla\CMS\HTML\Sidebar::render(); from both views and ensure the submenu helper only uses the modern API. The sidebar property assignment and any template references to $this->sidebar should be removed.

## Description `Dashboard\HtmlView.php` (line 61) and `Calendar\HtmlView.php` (line 43) both call `\Joomla\CMS\HTML\Sidebar::render()` unconditionally. This class is deprecated in Joomla 5+ and will be removed in Joomla 6. The `MokoSuiteCrossHelper::addSubmenu()` method already has a progressive approach -- it tries the modern `$toolbar->getSubmenu()` API first and falls back to `Sidebar::addEntry()`. However, the two views still call `Sidebar::render()` to capture the output, which: 1. Will throw a deprecation notice on Joomla 5 2. Will fatal error when the class is removed in Joomla 6 No other views in the component (Posts, Services, Templates, Logs, Analytics) use `Sidebar::render()`. ## Steps to Reproduce 1. Open the Dashboard or Calendar view in Joomla 5+ admin 2. Check PHP error log for deprecation warnings ## Expected Behavior Views should use only the modern toolbar submenu API on Joomla 5+, with no calls to the deprecated Sidebar class. ## Fix Remove `$this->sidebar = \Joomla\CMS\HTML\Sidebar::render();` from both views and ensure the submenu helper only uses the modern API. The sidebar property assignment and any template references to `$this->sidebar` should be removed.
Author
Owner

Branch created: feature/250-bug-dashboard-and-calendar-views-use-dep

git fetch origin
git checkout feature/250-bug-dashboard-and-calendar-views-use-dep
Branch created: [`feature/250-bug-dashboard-and-calendar-views-use-dep`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteCross/src/branch/feature/250-bug-dashboard-and-calendar-views-use-dep) ```bash git fetch origin git checkout feature/250-bug-dashboard-and-calendar-views-use-dep ```
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteCross#250