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

HTMLPageAsset, Events and Vanity URLs override Contentlet.getTitle #18177

Closed
wezell opened this issue Mar 24, 2020 · 2 comments
Closed

HTMLPageAsset, Events and Vanity URLs override Contentlet.getTitle #18177

wezell opened this issue Mar 24, 2020 · 2 comments

Comments

@wezell
Copy link
Contributor

wezell commented Mar 24, 2020

dotCMS expects that every contentlet has a title. There is specific logic in the Contentlet object to generate a title if there is not one set, which will ultimately fall back to the content.id as the title if nothing else is found. This is important from a ui and overall content perspective.

Issues arise when content of different base types overrides the Contentlet.getTitle() method. With content of these types, it is possible to create a content object that returns null or "" when .getTitle() is called which can cause issues in the UI. We need to ensure that content of all types relies on the logic of Contentlet.getTitle().

To see the issue:

  1. Create a new PageAssetType called "testing"
  2. Uncheck "required" for the title field
  3. in the browser, add a new page of type "testing" and leave the title blank.
  4. go to the browser and try to open the folder where your new page is. You will get a JS error, as the js is expecting a title.
wezell added a commit that referenced this issue Mar 24, 2020
@wezell wezell added this to the Bug Sprint milestone Mar 24, 2020
@jdotcms jdotcms self-assigned this Mar 24, 2020
jdotcms added a commit that referenced this issue Mar 26, 2020
jdotcms added a commit that referenced this issue Mar 26, 2020
…e logic has been moved to the getTitle and the ContentletAPI.getName is just calling content.getTitle instead
jdotcms added a commit that referenced this issue Mar 30, 2020
jdotcms added a commit that referenced this issue Mar 31, 2020
@jdotcms
Copy link
Contributor

jdotcms commented Apr 3, 2020

PR

jdotcms added a commit that referenced this issue Apr 3, 2020
jdotcms added a commit that referenced this issue Apr 3, 2020
fmontes pushed a commit that referenced this issue Apr 6, 2020
…itle

* #18177 fix for the jsp when the title is not being set, used the identifier instead

* #18177 now the title is a non overridable field, in addition all title logic has been moved to the getTitle and the ContentletAPI.getName is just calling content.getTitle instead

* #18177 fixes to handle the title set on the checkin, if the title  has not been set, it is not calculated

* #18177 removing unnecessary unit test

* #18177 review feedback done

* #18177 adding comments
@bryanboza
Copy link
Member

Fixed, unable to reproduce after the changes, tested on master // Postgres // FF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants