Repository navigation
fix: archiving a form unpublishes it, restore brings it back unpublished - #247
Merged
Merged
Conversation
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
commented
Oct 12, 2026
PhilReinking
left a comment
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
published_atand soft deletes in one transaction. One single write isn't possible: Laravel's soft delete only writesdeleted_atandupdated_at.published_at, for forms archived while published before this change.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