bug: MokoSuiteCrossHelper::addSubmenu() has duplicate 'calendar' key #248

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

Problem

In src/Helper/MokoSuiteCrossHelper.php line 43-46, the $views array has a duplicate 'calendar' key:

$views = [
    'dashboard' => 'COM_MOKOSUITECROSS_SUBMENU_DASHBOARD',
    'posts'     => 'COM_MOKOSUITECROSS_SUBMENU_POSTS',
    'services'  => 'COM_MOKOSUITECROSS_SUBMENU_SERVICES',
    'templates' => 'COM_MOKOSUITECROSS_SUBMENU_TEMPLATES',
    'calendar'  => 'COM_MOKOSUITECROSS_SUBMENU_CALENDAR',   // line 43
    'logs'      => 'COM_MOKOSUITECROSS_SUBMENU_LOGS',
    'calendar'  => 'COM_MOKOSUITECROSS_SUBMENU_CALENDAR',   // line 45 -- DUPLICATE
    'analytics' => 'COM_MOKOSUITECROSS_SUBMENU_ANALYTICS',
];

PHP silently overwrites the first 'calendar' with the second. Both have the same value so there's no functional bug, but it means the submenu ordering is wrong -- calendar appears after logs instead of after templates.

Fix

Remove the duplicate line 45 entry. The correct order should be:
dashboard, posts, services, templates, calendar, analytics, logs

## Problem In `src/Helper/MokoSuiteCrossHelper.php` line 43-46, the `$views` array has a duplicate `'calendar'` key: ```php $views = [ 'dashboard' => 'COM_MOKOSUITECROSS_SUBMENU_DASHBOARD', 'posts' => 'COM_MOKOSUITECROSS_SUBMENU_POSTS', 'services' => 'COM_MOKOSUITECROSS_SUBMENU_SERVICES', 'templates' => 'COM_MOKOSUITECROSS_SUBMENU_TEMPLATES', 'calendar' => 'COM_MOKOSUITECROSS_SUBMENU_CALENDAR', // line 43 'logs' => 'COM_MOKOSUITECROSS_SUBMENU_LOGS', 'calendar' => 'COM_MOKOSUITECROSS_SUBMENU_CALENDAR', // line 45 -- DUPLICATE 'analytics' => 'COM_MOKOSUITECROSS_SUBMENU_ANALYTICS', ]; ``` PHP silently overwrites the first `'calendar'` with the second. Both have the same value so there's no functional bug, but it means the submenu ordering is wrong -- calendar appears after logs instead of after templates. ## Fix Remove the duplicate line 45 entry. The correct order should be: dashboard, posts, services, templates, calendar, analytics, logs
Author
Owner

Branch created: feature/248-bug-mokosuitecrosshelper-addsubmenu-has-

git fetch origin
git checkout feature/248-bug-mokosuitecrosshelper-addsubmenu-has-
Branch created: [`feature/248-bug-mokosuitecrosshelper-addsubmenu-has-`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteCross/src/branch/feature/248-bug-mokosuitecrosshelper-addsubmenu-has-) ```bash git fetch origin git checkout feature/248-bug-mokosuitecrosshelper-addsubmenu-has- ```
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#248