Skip to content

[TASK] Content Drive: Add a FILEASSET base-type → content-type resolution strategy #36279

Description

@zJaaal

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 for BaseContentType.DOTASSET (DotAssetBaseTypeToContentTypeStrategyImpl, which uses DotAssetAPI.tryMatch to pick the best dotAsset content type by mime type). There is no FILEASSET strategy.
  • ContentHelper.tryToSetContentType only sets the contentlet's content type when a strategy exists for the given base type; otherwise it is skipped.
  • MapToContentletPopulator.getContentTypeInode resolves the type solely from structureInode / structureName / contentType — there is no fallback from baseType.
  • Net result: firing the NEW workflow action with only baseType: FILEASSET (no contentType) fails with "The content type or base type, is not set or is invalid."

Latent bug to fix along the way:

  • BaseTypeToContentTypeStrategyResolver.subscribe(...) ignores its baseContentType argument and always does builder.put(BaseContentType.DOTASSET, strategy), so a FILEASSET strategy can't even be registered via subscribe today.

Acceptance Criteria

  • Register a FILEASSET base-type → content-type resolution strategy so that firing the NEW workflow action with baseType: FILEASSET (no explicit contentType) resolves to the appropriate File Asset content type (default/system FileAsset, or best match if multiple FILEASSET content types exist).
  • Fix BaseTypeToContentTypeStrategyResolver.subscribe(...) so it registers the strategy under the passed baseContentType instead of always DOTASSET.
  • Add coverage (unit/integration) for resolving FILEASSET (and a regression test for the subscribe fix).
  • 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

Activity

  1. added theissue type on Jun 23, 2026
  2. changed the title [-][TASK] Add a FILEASSET base-type → content-type resolution strategy[/-] [+][TASK] Content Drive: Add a FILEASSET base-type → content-type resolution strategy[/+] on Jun 23, 2026
  3. nollymar commented on Jun 23, 2026

    @nollymar
    Member

    @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.getContentTypeInode is required

  4. self-assigned this
    on Jun 23, 2026
  5. moved this from New to Current Sprint Backlog in dotCMS - Product Planningon Jun 23, 2026
  6. moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planningon Jun 24, 2026
  7. moved this from In Progress to In Review in dotCMS - Product Planningon Jun 25, 2026
  8. removed their assignment
    on Jun 26, 2026
  9. 7 remaining items

  10. moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planningon Jun 29, 2026
  11. removed their assignment
    on Jun 29, 2026
  12. moved this from In Progress to QA in dotCMS - Product Planningon Jun 29, 2026
  13. self-assigned this
    on Jun 29, 2026
  14. rjvelazco commented on Jun 29, 2026

    @rjvelazco
    Member

    Passed QA

    • dotCMS Docker Image: [dotcms/dotcms:trunk_70fdfb9]

    Video

    video.mov
  15. removed their assignment
    on Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions