Skip to content

Bring the stored submissions across, not just the forms - #12

Merged
AllTerrainDeveloper merged 1 commit into
mainfrom
feature/import-entries
Aug 19, 2026
Merged

AllTerrainDeveloper merged 1 commit into
mainfrom
feature/import-entries

Conversation

@AllTerrainDeveloper

Copy link
Copy Markdown
Owner

What

Extends the importer registry so a source can migrate its stored submissions, not only its forms — and implements it for Contact Form 7 (via Flamingo's storage).

  • Forms now record { importer, source } and a source-field-name → field-id map on import, so submissions stay readable afterwards.
  • New optional importer callables entries / import_entries (they come as a pair — offering only one drops both).
  • atf_import_entry() stores a migrated submission: sanitised but deliberately not validated (a retired choice is still what that person said), keeps the original date, and is idempotent — each entry records its source key, so a second run skips what the first brought across.
  • CF7 reader works straight off the posts table, so it still works with CF7/Flamingo deactivated. Spam imports as spam — including the exclude_from_search status a post_status => 'any' query would silently miss.
  • Chunked passes (200 per click) from a new "Stored submissions" section on Forms → Import.
  • New atf_entries_imported action; docs/hooks-reference.md updated in the same change.

Tests

  • 578 PHPUnit ✓ (13 new in importersEntries.php, built against Flamingo's exact storage shape)
  • 251 vitest ✓
  • PHPCS: 0 errors

🤖 Generated with Claude Code

https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp

Importing a form is the half of a migration somebody does immediately;
the years of submissions sitting in Flamingo are the half they think of
a week later. Forms now remember where they came from and how their
fields map, entries import in chunks with their original dates, spam
arrives as spam, and running it twice imports nothing twice.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp
@AllTerrainDeveloper
AllTerrainDeveloper merged commit f40a362 into main Aug 19, 2026
3 checks passed
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