dotCMS / dotCMS/core

Content import leaves contentlets locked when relationship field value is invalid and import fails

Open
#36,367 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support Team : Maintenance
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem Statement

When importing content via csv, if a relationship field column contains an invalid value (e.g. HTML text instead of a valid identifier or Lucene query), the contentlet being referenced gets locked during the "Go To Preview" step — and because the import subsequently fails validation, it never reaches the unlock step. The lock persists indefinitely.

ImportUtil.processRelationships() [line ~2717]
└─▶ RelationshipUtil.getRelatedContentFromQuery() [line 59]
└─▶ filterContentlet(language, query, user, true) ← isCheckout hardcoded TRUE
└─▶ contentletAPI.checkout() ← locks the related contentlet

Steps to Reproduce

https://drive.google.com/file/d/1D6pw9zB0DBxacWFv3HV4pA8R67QjJEVH/view?usp=drive_link

Acceptance Criteria

Expected Behavior

Contentlets should be unlocked automatically when:

The import preview/process fails validation, and
The user clicks "Cancel" on the preview/conflicts screen

dotCMS Version

26.06.04-01

Severity

Medium - Some functionality impacted

Links

https://helpdesk.dotcms.com/a/tickets/37916

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ImportUtil.processRelationships() around line 2717 and RelationshipUtil.getRelatedContentFromQuery() around line 59, then trace the preview validation and Cancel flows. Reproduce the CSV import with an invalid relationship value and verify that referenced contentlets are unlocked after validation failure and after Cancel.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, content
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.