Skip to content

fix: archiving a form unpublishes it, restore brings it back unpublished - #247

Merged
PhilReinking merged 2 commits into
mainfrom
fix/bits-254-archive-unpublishes
Oct 12, 2026
Merged

PhilReinking merged 2 commits into
mainfrom
fix/bits-254-archive-unpublishes

Conversation

@PhilReinking

Copy link
Copy Markdown
Contributor

Archiving a form now also unpublishes it, so Restore brings it back unpublished and the owner publishes it again on purpose. Before, a restored form went live again at once.

Part of BITS-254

  • Archive clears published_at and soft deletes in one transaction. One single write isn't possible: Laravel's soft delete only writes deleted_at and updated_at.
  • Restore also clears published_at, for forms archived while published before this change.
  • I chose that over a data migration: one line, and no data changes on forms nobody restores.
  • Both responses keep their shape. The API docs for archive and restore say that archiving unpublishes.

Heads-up: a form archived while published before this update comes back unpublished when restored.

Tested: full PHP suite on MariaDB and SQLite. The 3 new checks fail on main. Another team still can't archive or restore.

Not tested: by hand in the browser.

🤖 Generated with Claude Code

PhilReinking and others added 2 commits October 12, 2026 09:35
Archive clears published_at and soft deletes in one transaction.
Restore also clears published_at, so forms archived while still
published before this change come back unpublished too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at 5fff570, CI green.

The 3 new checks fail with main's controllers and pass here, on MariaDB and SQLite. A delete that throws rolls back the unpublish on both databases. Form has no observers or delete events, so nothing else changes. Restore answers is_published: false for a published, a never published and a future date, and force delete still works. The app never sets a future publish date, so clearing it loses no schedule.

@PhilReinking
PhilReinking merged commit 9bd5573 into main Oct 12, 2026
6 checks passed
@PhilReinking
PhilReinking deleted the fix/bits-254-archive-unpublishes branch October 12, 2026 09:33
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