Skip to content

fix(webserver): remove stale onLoad tree calls in stats_tree.php - #111

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/issues6
Jun 11, 2026
Merged

fix(webserver): remove stale onLoad tree calls in stats_tree.php#111
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:feature/issues6

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

The body onLoad ran showBranch('br_Stats') and swapFolder('fl_Stats'), written in 2008 when the stats tree had a single root node named "Stats". The daemon has emitted multiple top-level branches (Transfer, Connection, Clients, Servers, Shared Files) ever since, so document.getElementById('br_Stats') is null and the handler threw an uncaught TypeError on every page load without doing anything.

Remove the onLoad. The rendered state is unchanged (all branches start expanded, which is what the broken handler already produced) and the per-branch click-to-toggle handlers keep working; verified in headless Chromium that the statistics page now loads with a clean console and that collapsing/expanding a branch still works.

The body onLoad ran showBranch('br_Stats') and swapFolder('fl_Stats'),
written in 2008 when the stats tree had a single root node named
"Stats". The daemon has emitted multiple top-level branches (Transfer,
Connection, Clients, Servers, Shared Files) ever since, so
document.getElementById('br_Stats') is null and the handler threw an
uncaught TypeError on every page load without doing anything.

Remove the onLoad. The rendered state is unchanged (all branches start
expanded, which is what the broken handler already produced) and the
per-branch click-to-toggle handlers keep working; verified in headless
Chromium that the statistics page now loads with a clean console and
that collapsing/expanding a branch still works.
@ngosang
ngosang merged commit b0d9e95 into amule-org:master Jun 11, 2026
6 checks passed
@ngosang
ngosang deleted the feature/issues6 branch June 11, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant