First to Site
Release 3.9

Project Attachment Visibility and orphanRemoval Fixes

Attachments on orphan-parent orders now stay visible; projectOrders orphanRemoval dropped to prevent accidental cascade deletions

Overview

Two admin-portal project data-integrity fixes that ship together in v3.9.0. One is about visibility (Doctrine filter was hiding historical uploads), the other is about persistence (ORM cascade was deleting rows that shouldn't go).

Attachment Visibility on Orphan-Parent Orders

Files uploaded to a project's orders stay on disk and in the document table indefinitely. A document's parent order can be soft-deleted or archived; the document itself remains. ProjectVisibilityFilter was over-eagerly hiding those documents when the parent order collection no longer contained them, which meant historical uploads disappeared from the project view.

Fix: the filter no longer conditions document visibility on parent-order membership. Documents remain accessible via the project's documents tab even when their parent order has been orphaned.

Why this matters: clients expected to see every file they had ever uploaded to the project, regardless of what happened to the order that carried it. The regression had been in place long enough that multiple clients flagged missing documents.

projectOrders orphanRemoval dropped

Project::$projectOrders previously had orphanRemoval: true. When the collection reference changed in a form save - which can happen when EasyAdmin rebuilds the collection during validation or when a different flush path touches the entity - Doctrine would cascade-delete order rows that weren't actually intended for removal.

Fix: the orphanRemoval flag is gone. Order rows only delete when explicitly removed. The trade-off is that truly-orphaned orders need manual cleanup (rare), but the upside is preventing silent data loss on every project save.

  • Mark Wang flagged both on Trello; PR #821 covers the orphanRemoval fix.