fix(push-publishing): archived Site no longer deleted on receiver (#36034)#36174
Conversation
…6034) When pushing an archived Site with a non-Remove operation, the receiver was unconditionally calling HostAPI.delete() after archive(), ignoring the isPushedContentArchived flag. Added a guard so delete() is only called for explicit Remove/Push Remove operations, matching the existing pattern used for regular content in the same method. Refs: #36034 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
❌ Codex Review failed —
|
|
Claude finished @dsilvam's task in 3m 36s —— View job dotCMS Backend Review
All four specialized sub-agents (Security, Database, Java Standards, REST API) returned no issues. The backend review comment has been updated accordingly.
|
| \n✅ **dotCMS Backend Review**: no issues found. |
🤖 Bedrock Review —
|
HostAPI.delete() requires the site to be archived first. Both new test finally blocks were incorrectly calling unarchive() before delete(), causing the cleanup to fail and leaving leaked sites in the DB which broke the count assertions in the pre-existing tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Proposed Changes
HostAPI.delete()inContentHandler.archiveOrDeleteContent()behind!isPushedContentArchivedso that pushing an archived Site with a non-Remove operation archives it on the receiver instead of deleting it.HostBundlerHandlerTestcovering both the fixed path (PUBLISH + archived → site preserved) and the regression path (UNPUBLISH + archived → site deleted).Root Cause
In
ContentHandler.archiveOrDeleteContent(), the Host/Site branch (lines 1277–1282) ignored theisPushedContentArchivedparameter and unconditionally calledarchive()thendelete(). The regular-contentelsebranch already guardeddestroy()behind!isPushedContentArchivedcorrectly — the Host branch simply lacked the same guard.Checklist
Additional Info
Fixes #36034. When a Site is archived on the sender and pushed with any non-Remove / Push Remove action, the receiver now sets the Site to archived state instead of deleting it and all its content. The explicit Remove/Push Remove path is unaffected.
Screenshots
N/A — backend-only change
This PR fixes: #36034