fix(push-publishing): don't fail bundle on archived multi-language HTML pages (#36051)#36380
fix(push-publishing): don't fail bundle on archived multi-language HTML pages (#36051)#36380dsilvam wants to merge 1 commit into
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 5m 21s —— View job dotCMS Backend Review Pipeline
Summary: 1 medium finding, no critical or high issues. Review posted at #issuecomment-4853939316. The dotBot false positive (format mismatch) was dismissed — the format string has exactly one |
🤖 dotBot Review (Bedrock)Reviewed 2 file(s); 1 candidate(s) → 1 confirmed, 0 uncertain (unverified, kept for review). Confirmed findings
us.deepseek.r1-v1:0 · Run: #28513782544 · tokens: in: 10616 · out: 2936 · total: 13552 · calls: 4 · est. ~$0.030 |
🔍 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
|
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