Fix dashboard buttons posting to the wrong URL
CI / Deploy / PHP 8.4 (push) Successful in 1m4s
CI / Deploy / PHP 8.5 (push) Successful in 1m5s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped

Forms with a field named "action" (play, pause) shadow the form.action
property, so the fragment request went to /admin/[object HTMLInputElement].
Read the attribute instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-12 22:42:03 +01:00
1 parent ce2627d03a
commit 77d0bfb547
1 file changed
+2 -1
+2 -1
View File
@@ -2721,7 +2721,8 @@
if (submitter) { if (submitter) {
submitter.disabled = true; submitter.disabled = true;
} }
Fragments.request(form.action, { method: 'POST', body: new FormData(form) }) // getAttribute: forms with a field named "action" (play/pause buttons) shadow the form.action property.
Fragments.request(form.getAttribute('action'), { method: 'POST', body: new FormData(form) })
.then(function (doc) { return handle(doc, source); }) .then(function (doc) { return handle(doc, source); })
.catch(function () { .catch(function () {
form.removeAttribute('aria-busy'); form.removeAttribute('aria-busy');