fix(push-publishing): don't fail bundle on archived multi-language HTML pages (#36051)#36380
Conversation
…ML pages (#36051) updateTemplateInAllLanguageVersions threw a DotDataException when the only existing versions of an HTML page identifier were archived. On the push publishing receiver, language versions are processed sequentially: once the first version is saved and archived, checking in the second version found only the archived first version and threw, aborting the entire bundle. Template propagation is meaningless for archived pages, so skip it (log + return) instead of throwing, matching the sibling NotFoundInDbException handling. Adds PublisherTest#testPushArchivedMultiLanguageHTMLPage covering an archived English + Spanish HTML page pushed to the receiver. Refs: #36051 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @dsilvam's task in 13m 5s —— View job 🔍 dotCMS Backend Review
✅ No issues found. All four sub-agents reviewed the diff (
Note on process: I'm unable to submit a formal GitHub PR review (approve/request-changes) — that's outside what I'm permitted to do. This comment is the full review output; no Critical/High findings means there's nothing blocking merge from this pass. |
🤖 dotBot Review (Bedrock)Reviewed 3 file(s); 1 candidate(s) → 0 confirmed, 0 uncertain (unverified, kept for review). ✅ No issues found after verification. us.deepseek.r1-v1:0 · Run: #28658856176 · tokens: in: 10839 · out: 3514 · total: 14353 · calls: 4 · est. ~$0.034 |
🔍 dotCMS Backend Review[🟡 Medium]
} else if (contentletByIdentifierAnyLanguageArchived.isArchived()) {
Logger.warn(ESContentletAPIImpl.class, String.format(
"Skipping template propagation: all existing versions of Contentlet"
+ " '%s' are archived.", contentlet.getIdentifier()));
return;
} else {
return; // silent return — no explanation, no log
}💡 Collapse the two returns and guard only the log on if (contentletByIdentifierAnyLanguageArchived.isArchived()) {
Logger.warn(ESContentletAPIImpl.class, String.format(
"Skipping template propagation: all existing versions of Contentlet"
+ " '%s' are archived.", contentlet.getIdentifier()));
}
// Both archived and unrelated-live fallback: nothing to propagate.
return;dotBot finding at line 6829 — dismissed (false positive)
Next steps
|
…hrow behavior (#36051) testCheckInArchivedPageShouldThrowDotDataException asserted the old contract where checking in a new version of an archived HTML page threw a DotDataException from updateTemplateInAllLanguageVersions. The #36051 fix makes that path skip template propagation and return instead of throwing, so the test is renamed to testCheckInArchivedPageSkipsTemplatePropagation and now asserts the check-in succeeds (and still never NPEs). This test exercises the archived incoming-contentlet early-return. Refs: #36051 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Tick the box to add this pull request to the merge queue (same as
|
Proposed Changes
ESContentletAPIImpl.updateTemplateInAllLanguageVersionsso it no longer throwsDotDataException: Contentlet is currently marked as 'Archived'.when the only existing versions of an HTML page identifier are archived. On the push-publishing receiver, language versions of the same page are processed sequentially — once the first version is saved and archived, checking in the second version found only the archived first version and threw, aborting the entire bundle. Template propagation is meaningless for archived pages, so the method now logs a warning and returns (mirroring the siblingNotFoundInDbExceptionpath already swallowed at the call site) instead of throwing.PublisherTest#testPushArchivedMultiLanguageHTMLPagethat push-publishes an archived English + Spanish HTML page and asserts the bundle succeeds and both language versions are archived on the receiver.Fixes #36051
Checklist
Additional Info
Root cause:
updateTemplateInAllLanguageVersionsruns on every HTML-pagecheckin(only does work when the content type has aTEMPLATE_FIELD). It first searches for a non-archived version of the identifier; when none exists it retries withincludeArchived=true. If that finds an archived version it used to throw — but unlikeNotFoundInDbException, theDotDataExceptionwas not caught ininternalCheckin, so it propagated up throughContentHandler.saveContentand failed the whole bundle. This commonly surfaces when push-publishing an entire Site containing archived multi-language pages.The method is
privatewith a single caller (internalCheckin), so removing the throw affects no external callers.🤖 Generated with Claude Code
This PR fixes: #36051