Commit 6513cf7
authored
fix: close form tag before Restore Database section to fix nested form bug
The Restore Calibre Database form (action=admin.restore_calibre_db) was
nested inside the outer DB Configuration form (action=admin.db_configuration).
HTML doesn't allow nested forms; browsers drop the inner <form> tag during
parsing but keep its children (the CSRF input and submit button) as part of
the outer form. As a result, clicking "Restore Calibre Database (Last
Resort)" always submitted the outer db_configuration form instead - silently
saving the basic config fields and doing nothing else, with no error and no
indication anything was wrong.
Fix: close the outer form right after the Save/Cancel row, before the
Restore section begins, instead of wrapping the whole page in one form. The
settings-container div still visually wraps both sections; only the <form>
boundary changes. No other markup, styling, or route logic touched.
Verified by hand: without the fix, both DevTools Network capture and
container logs show every click POSTing to /admin/dbconfig with only
config_calibre_dir/config_calibre_split_dir fields - /admin/restore_calibre_db
is never hit. With the fix (tested by calling the intended endpoint
directly), the restore runs correctly and rebuilds metadata.db from the
library's OPF files.1 parent 18d6b92 commit 6513cf7
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | | - | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
0 commit comments