Content import leaves contentlets locked when relationship field value is invalid and import fails
Nobody has claimed this yet.
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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