Repository navigation
[TASK] Content Drive: Add a FILEASSET base-type → content-type resolution strategy #36279
Copy link
Copy link
Closed
Copy link
Description
Description
Content Drive's upload flow (PR #36243, issue #35575) lets the user choose Asset vs File before uploading. Semantically these are base types, but the frontend currently sends the content type variable (dotAsset / FileAsset) because base-type → content-type resolution only works for DOTASSET on the backend.
Where it breaks for FILEASSET:
BaseTypeToContentTypeStrategyResolver(dotCMS/src/main/java/com/dotcms/contenttype/business/BaseTypeToContentTypeStrategyResolver.java) registers a strategy only forBaseContentType.DOTASSET(DotAssetBaseTypeToContentTypeStrategyImpl, which usesDotAssetAPI.tryMatchto pick the best dotAsset content type by mime type). There is noFILEASSETstrategy.ContentHelper.tryToSetContentTypeonly sets the contentlet's content type when a strategy exists for the given base type; otherwise it is skipped.MapToContentletPopulator.getContentTypeInoderesolves the type solely fromstructureInode/structureName/contentType— there is no fallback frombaseType.- Net result: firing the
NEWworkflow action with onlybaseType: FILEASSET(nocontentType) fails with "The content type or base type, is not set or is invalid."
Latent bug to fix along the way:
BaseTypeToContentTypeStrategyResolver.subscribe(...)ignores itsbaseContentTypeargument and always doesbuilder.put(BaseContentType.DOTASSET, strategy), so aFILEASSETstrategy can't even be registered viasubscribetoday.
Acceptance Criteria
- Register a
FILEASSETbase-type → content-type resolution strategy so that firing theNEWworkflow action withbaseType: FILEASSET(no explicitcontentType) resolves to the appropriate File Asset content type (default/systemFileAsset, or best match if multipleFILEASSETcontent types exist). - Fix
BaseTypeToContentTypeStrategyResolver.subscribe(...)so it registers the strategy under the passedbaseContentTypeinstead of alwaysDOTASSET. - Add coverage (unit/integration) for resolving
FILEASSET(and a regression test for thesubscribefix). - Once this lands, the Content Drive frontend ([TASK] Content Drive: Upload button — Asset vs File type selection #35575) can send the base type for both Asset and File instead of the content type, matching what the upload dialog actually asks.
Priority
Medium
Additional Context
- Parent epic: [EPIC] Content Drive: Upload #35436
- Follow-up from PR feat(content-drive): prompt Asset vs File on upload (#35575) #36243 / issue [TASK] Content Drive: Upload button — Asset vs File type selection #35575 (frontend ships sending content type as the working approach; this task enables the cleaner base-type approach).
- Reference for the working DOTASSET strategy:
DotAssetBaseTypeToContentTypeStrategyImpl+DotAssetAPIImpl.tryMatch.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
[-][TASK] Add a FILEASSET base-type → content-type resolution strategy[/-][+][TASK] Content Drive: Add a FILEASSET base-type → content-type resolution strategy[/+]nollymar commentedon Jun 23, 2026
@zJaaal , I agree with the proposal, as long as the acceptance criteria are considered, aka: tests must be implemented. Also, I don't think the suggested change in the
MapToContentletPopulator.getContentTypeInodeis requiredgithub-actions commentedon Jun 25, 2026
PRs linked to this issue
7 remaining items
rjvelazco commentedon Jun 29, 2026
Passed QA
dotcms/dotcms:trunk_70fdfb9]Video
video.mov
fix(content-drive): upload-button flow drops the file in Chrome (dotC…