Skip to content

fix(amuleweb): remove copy-pasted preferences code from log page - #74

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/log-page-prefs-copy-paste
Jun 11, 2026
Merged

fix(amuleweb): remove copy-pasted preferences code from log page#74
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/log-page-prefs-copy-paste

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

amuleweb-main-log.php contained a verbatim copy of the preferences page's option-apply PHP block and its init_data() JavaScript helper, left over from copy-pasting the page skeleton. This caused three problems on every Log page view:

  • visiting amuleweb-main-log.php?Submit=Apply&... silently rewrote the daemon preferences with mostly-zero values, since the copied block called amule_set_options() with whatever (usually empty) query parameters were present;
  • the body onLoad called init_data(), which threw a JavaScript TypeError because the Log page has no "mainform" form;
  • an unnecessary amule_get_options() round-trip to the core on every page load.

Remove the whole script block (formCommandSubmit and initvals were also unused prefs leftovers) and the init_data() call from onLoad.

Verified against a running webserver: the Log page renders as before, and loading it with ?Submit=Apply no longer changes any daemon preference.

amuleweb-main-log.php contained a verbatim copy of the preferences
page's option-apply PHP block and its init_data() JavaScript helper,
left over from copy-pasting the page skeleton. This caused three
problems on every Log page view:

- visiting amuleweb-main-log.php?Submit=Apply&... silently rewrote
  the daemon preferences with mostly-zero values, since the copied
  block called amule_set_options() with whatever (usually empty)
  query parameters were present;
- the body onLoad called init_data(), which threw a JavaScript
  TypeError because the Log page has no "mainform" form;
- an unnecessary amule_get_options() round-trip to the core on
  every page load.

Remove the whole script block (formCommandSubmit and initvals were
also unused prefs leftovers) and the init_data() call from onLoad.

Verified against a running webserver: the Log page renders as
before, and loading it with ?Submit=Apply no longer changes any
daemon preference.
@ngosang
ngosang merged commit 86ab302 into amule-org:master Jun 11, 2026
9 checks passed
@ngosang
ngosang deleted the fix/log-page-prefs-copy-paste branch June 11, 2026 08:27
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