Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content API/GraphQL: Title Property Inconsistency on Assets #30127

Open
rjvelazco opened this issue Sep 24, 2024 · 1 comment · May be fixed by #30408
Open

Content API/GraphQL: Title Property Inconsistency on Assets #30127

rjvelazco opened this issue Sep 24, 2024 · 1 comment · May be fixed by #30408

Comments

@rjvelazco
Copy link
Contributor

rjvelazco commented Sep 24, 2024

Parent Issue

N/A

Problem Statement

There is an inconsistency between the title field displayed in the dotCMS admin interface and the title retrieved via the content API and GraphQL query. The title is overwritten with the file/asset name.

Steps to Reproduce

  1. Create Contenttype

    • Create a new contenttype called Test.
    • Add a text field called title.
    • Add a binary field.
  2. Create Contentlet

    • Create a new Test contentlet.
    • Add a title value.
    • Upload an asset (image or video).
    • Check the response of the Content API/GraphQL.

Error: The title field will be overwritten with the file/asset name in the Content API/GraphQL response

Acceptance Criteria

The title property should not be overwritten with the file/asset name.

dotCMS Version

master/trunk

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

More Details

This video contentlet has a title field. You can see there is a title field with this value: dotCMS Intro Animation Video. However, if you check the content API, the title is dotcms-v2.mp4.

The same happens if you run this GraphQL query:

query ContentAPI {
  search(query: "+contentType:Video +identifier:c7e0a6457746152fc2fc076ee9f6737e") {
    title
  }
}

However, in Velocity, we are respecting the real title:

<!-- This will print dotCMS Intro Animation Video -->
<span>${contentlet.get(0).title}</span> 

Importance

It's important to respect the real title because we are telling the user that the title is the file/asset name, when it's not. The Lucene Query doesn't work with the title that Content API or GraphQL returns:

"+contentType:Video +Video.title:${contentAPITitle}" // Doesn't work
"+contentType:Video +Video.title:${realTitle}" // Works
@rjvelazco rjvelazco changed the title Content API/GraphQL: title property inconsistency on assets Title: Content API/GraphQL: Title Property Inconsistency on Assets Sep 24, 2024
@rjvelazco rjvelazco changed the title Title: Content API/GraphQL: Title Property Inconsistency on Assets Content API/GraphQL: Title Property Inconsistency on Assets Sep 24, 2024
@valentinogiardino valentinogiardino self-assigned this Oct 18, 2024
valentinogiardino added a commit that referenced this issue Oct 18, 2024
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants