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

Image caption default from DAM dialog option conflicting with Teaser dialog #2742

Open
HitmanInWis opened this issue May 1, 2024 · 0 comments

Comments

@HitmanInWis
Copy link

Bug Report

Bug as of: 2.24.7-SNAPSHOT

On the Teaser dialog, if you have an Asset selected that has a Title (Caption) from the DAM, clicking the checkbox for "Get title from linked page" on the Text tab will disable the Title field (correct) and set the value to the Asset Title (incorrect) rather than linked page title. This bug impacts only the dialog displaying the wrong value - when the Teaser is rendered on the page, the title is correctly used from the linked page, not the Asset.

The issue is in the Image editor clientlib: apps/core/wcm/components/image/v3/image/clientlibs/editor/js/image.js

Line 82:

            captionTuple = new CheckboxTextfieldTuple(dialogContent, 'coral-checkbox[name="./titleValueFromDAM"]', 'input[name="./jcr:title"]');

The selector of input[name="./jcr:title"] is too generic, and thus on the Teaser dialog it captures the teaser title field when creating the checkbox tuple, and thus seeds the input box with the Image title from the DAM.

A potential solution is to add granite:class="cmp-image__editor--caption" to the image dialog field for Caption, and then update the JS code to:

            captionTuple = new CheckboxTextfieldTuple(dialogContent, 'coral-checkbox[name="./titleValueFromDAM"]', 'input.cmp-image__editor--caption');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant