bug: plg_quickicon_mokosuitebackup crashes admin dashboard with array_merge error #297

Closed
opened 2026-07-16 17:56:38 +00:00 by jmiller · 1 comment
Owner

Summary

The admin dashboard (mod_quickicon) crashes with an array_merge() TypeError attributed to plg_quickicon_mokosuitebackup.

Root-cause mechanism

Joomla 6.1 administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php (~line 390-407) does:

foreach ($arrays as $response) {        // each plugin's contribution
    if (!is_array($response)) continue;
    foreach ($response as $icon) {      // each icon in the plugin's LIST
        ...
        $icon = array_merge($default, $icon);  // <-- crashes if $icon is not an array
    }
}

So the crash happens when a plugin returns its icons UNWRAPPED (a bare icon dict), because the inner loop then iterates the dict's string VALUES and array_merge() gets a string.

Investigation

The current repo MokoSuiteBackupQuickicon::onGetIcons() wraps the icon correctly: $result[] = [ [ 'link'=>..., ... ] ] — a list containing one icon dict — identical to core plg_quickicon_joomlaupdate (6.1-dev). So the current repo code should NOT trigger this crash, and the file has a single commit (no regression).

Most likely: suite.dev is running a stale build with an older (unwrapped) version, or the error is from a different quickicon plugin. Needs the actual error page (file:line + the offending plugin) to confirm.

Hardening (regardless)

  • Use $event->getContext() (like core) instead of getArgument('context', getArgument(0, '')).
  • Wrap the whole handler in try/catch so a DB hiccup can never bubble into the dashboard render.

Component: admin

## Summary The admin dashboard (mod_quickicon) crashes with an `array_merge()` TypeError attributed to plg_quickicon_mokosuitebackup. ## Root-cause mechanism Joomla 6.1 `administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php` (~line 390-407) does: ```php foreach ($arrays as $response) { // each plugin's contribution if (!is_array($response)) continue; foreach ($response as $icon) { // each icon in the plugin's LIST ... $icon = array_merge($default, $icon); // <-- crashes if $icon is not an array } } ``` So the crash happens when a plugin returns its icons UNWRAPPED (a bare icon dict), because the inner loop then iterates the dict's string VALUES and array_merge() gets a string. ## Investigation The current repo `MokoSuiteBackupQuickicon::onGetIcons()` wraps the icon correctly: `$result[] = [ [ 'link'=>..., ... ] ]` — a list containing one icon dict — identical to core `plg_quickicon_joomlaupdate` (6.1-dev). So the **current repo code should NOT trigger this crash**, and the file has a single commit (no regression). Most likely: suite.dev is running a **stale build** with an older (unwrapped) version, or the error is from a different quickicon plugin. Needs the actual error page (file:line + the offending plugin) to confirm. ## Hardening (regardless) - Use `$event->getContext()` (like core) instead of `getArgument('context', getArgument(0, ''))`. - Wrap the whole handler in try/catch so a DB hiccup can never bubble into the dashboard render. Component: admin
Author
Owner

Branch created: feature/297-bug-plg-quickicon-mokosuitebackup-crashe

git fetch origin
git checkout feature/297-bug-plg-quickicon-mokosuitebackup-crashe
Branch created: [`feature/297-bug-plg-quickicon-mokosuitebackup-crashe`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteBackup/src/branch/feature/297-bug-plg-quickicon-mokosuitebackup-crashe) ```bash git fetch origin git checkout feature/297-bug-plg-quickicon-mokosuitebackup-crashe ```
Sign in to join this conversation.