Open tmastalirsch opened 1 year ago
The issue appears to be in the teaser.js editor clientlib - apps/core/wcm/components/teaser/v2/teaser/clientlibs/editor/js/teaser.js
It can be fixed by adding a function:
function getPageTitle(pageData) {
var title = pageData["pageTitle"] || "";
if (title === "") {
title = pageData["jcr:title"];
}
return title;
}
Then you need to update two separate cases where jcr:title was being used directly by the dialog for default titles.
This fixes the default teaser title when inherited from the linked page:
// Line 114
titleTuple.seedTextValue(data["jcr:title"]);
// Changes to
titleTuple.seedTextValue(getPageTitle(data));
This fixes the default page title populated for new CTA Action links
// Line 135
textField.val(data["jcr:title"]);
// Changes to
textField.val(getPageTitle(data));
Bug Report
Current Behavior I found a bug in the implementation of the Teaser Model. Via the dialog I want to specify the title of the linked page. There is a difference between what is in the dialog and what is rendered into the component. In the dialog the jcr:title is specified, in the component the pageTitle.
In the getTitle method the getPageTitle method is also used first. (v1/TeaserImpl, v2/TeaserImpl)
Expected behavior/code The title from the linked page should match the dialog when rendering the component
Environment
Additional context / Screenshots