Skip to content

fix(zmi): POST for Advanced-tab Update/Rebuild forms (#188)#190

Merged
jensens merged 1 commit into
mainfrom
fix/advanced-tab-post-forms-188
Jun 29, 2026
Merged

fix(zmi): POST for Advanced-tab Update/Rebuild forms (#188)#190
jensens merged 1 commit into
mainfrom
fix/advanced-tab-post-forms-188

Conversation

@jensens

@jensens jensens commented Jun 29, 2026

Copy link
Copy Markdown
Member

Problem

The Update Catalog and Clear and Rebuild buttons on the PG Catalog Tool's Advanced ZMI tab submit via GET — the forms in catalogAdvanced.dtml have no method (HTML defaults to GET). With Zope's :method publishing, the action runs as a GET whose URL stays in the address bar, so a reload / Back / Forward / prefetch / link-scanner silently re-triggers it.

For Clear and Rebuild that is destructive. Observed on a ~20k-object production site: a browser reload while the long rebuild was in flight kicked off a second full clear+rebuild (catalog count dropped back toward zero and started climbing again). The onclick confirm() is a UX guard only — it does not run on reload.

Fix

Add method="post" to both forms. The handlers (manage_catalogReindex / manage_catalogRebuild) already RESPONSE.redirect(...) back to manage_catalogAdvanced, so this is a clean Post/Redirect/Get flow. This also makes the Advanced tab consistent with catalogSlowQueries.dtml, which already POSTs.

Tests

tests/test_advanced_tab_forms.py (3): both state-changing forms use method="post", and no form in the template defaults to GET.

Closes #188

🤖 Generated with Claude Code

The Update Catalog and Clear and Rebuild buttons in catalogAdvanced.dtml
had no form method, so they submitted via GET. The (destructive) action
then stayed in the URL bar and a reload / Back / prefetch silently
re-ran it — observed on production as a second full clear+rebuild kicked
off by a browser reload mid-rebuild. Add method="post" to both forms;
the handlers already redirect, giving a clean Post/Redirect/Get flow.

Closes #188

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jensens
jensens merged commit 622fc71 into main Jun 29, 2026
5 checks passed
@jensens
jensens deleted the fix/advanced-tab-post-forms-188 branch June 29, 2026 21:28
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.

Advanced-tab 'Clear and Rebuild' / 'Update Catalog' use GET forms (no method=) — destructive catalog action re-runs on browser reload

1 participant