fix(imports): remove dirty-tracking from wizard forms to prevent false leave-site prompt

The import wizard forms had data-standard-detail-form which activated the
unsaved-changes tracker. Selecting a file marked the form dirty, and since
the action policy was not enabled on this page, the beforeunload handler
could not be suppressed during submit — causing a spurious browser dialog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 09:14:38 +01:00
parent 292865b0f7
commit 92e0a9f4e9

View File

@@ -89,7 +89,7 @@ $renderErrorTable = static function (array $rows): void {
</a>
</blockquote>
<?php endif; ?>
<form id="imports-upload-form" method="post" enctype="multipart/form-data" data-standard-detail-form="1">
<form id="imports-upload-form" method="post" enctype="multipart/form-data">
<input type="hidden" name="<?php e($csrfKey); ?>" value="<?php e($csrfToken); ?>">
<input type="hidden" name="stage" value="analyze">
<input type="hidden" name="type" value="<?php e($selectedType); ?>">
@@ -104,7 +104,7 @@ $renderErrorTable = static function (array $rows): void {
</form>
</div>
<?php elseif ($step === 'mapping'): ?>
<form id="imports-mapping-form" method="post" data-standard-detail-form="1">
<form id="imports-mapping-form" method="post">
<input type="hidden" name="<?php e($csrfKey); ?>" value="<?php e($csrfToken); ?>">
<input type="hidden" name="stage" value="preview">
<input type="hidden" name="type" value="<?php e($selectedType); ?>">
@@ -179,7 +179,7 @@ $renderErrorTable = static function (array $rows): void {
<h3><?php e(t('Row issues')); ?></h3>
<?php $renderErrorTable(is_array($preview['errors'] ?? null) ? $preview['errors'] : []); ?>
<hr>
<form id="imports-commit-form" method="post" data-standard-detail-form="1">
<form id="imports-commit-form" method="post">
<input type="hidden" name="<?php e($csrfKey); ?>" value="<?php e($csrfToken); ?>">
<input type="hidden" name="stage" value="commit">
<input type="hidden" name="type" value="<?php e($selectedType); ?>">