adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
737 stars 745 forks source link

Image V3 - authoring dialog popup does not show (for "configure" option) #2666

Closed capSuren closed 8 months ago

capSuren commented 8 months ago

Bug Report

Current Behavior On our project we are seeing an issue with Image core component - v3, that on edit of the component, we do not see the dialog box popup. We can add an image but dialog does not show. The same is also reproduceable on a Wknd site ( https://github.com/adobe/aem-guides-wknd/tree/aem-guides-wknd-3.2.0 )

Steps: Add a new page using Content page template Add an Image component > select "Configure" option, the popup does not display.

Screenshot 2024-02-05 123027

Add an image - drag/drop an asset, but still "configure" option does not show the popup.

Screenshot 2024-02-05 123243

Seeing this error on Console

Screenshot 2024-02-05 124842 Screenshot 2024-02-05 125156
GET [http://localhost:4502/mnt/override/apps/core/wcm/components/image/v3/image/_cq_dialog.html/content/w...](http://localhost:4502/mnt/override/apps/core/wcm/components/image/v3/image/_cq_dialog.html/content/wknd/language-masters/en/suren-1/jcr:content/root/container/image?resourceType=wknd%2Fcomponents%2Fimage&_=1707158869684) 500 (Server Error)

.content.xml

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Component"
    jcr:title="Image"
    sling:resourceSuperType="core/wcm/components/image/v3/image"
    componentGroup="Project - Content"/>

and _cq_editConfig.xml

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    cq:inherit="{Boolean}true"
    jcr:primaryType="cq:EditConfig"/>

Expected behavior/code Author able to view the popup to update the image options.

Environment

Possible Solution

Additional context / Screenshots

capSuren commented 8 months ago

We can close this.

We identified the issue is with our custom code which was interfering with the core components.

The fix: We were using Image component in one of our Teaser component. We removed the defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL

// PREVIOUS: @Model(adaptables = {SlingHttpServletRequest.class}, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL, resourceType = "project/components/teaser", adapters = {Teaser.class})
@Model(adaptables = {SlingHttpServletRequest.class}, resourceType = "project/components/teaser", adapters = {Teaser.class})
@Exporter(name = "jackson", extensions = "json")
public class ProjectTeaserModel extends AbstractComponent implements Teaser {
  ...
  // PREVIOUS: @ValueMapValue
  @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL)
  @Getter
  public String accessibilityText;
  ...
}

And the "Configure" dialog shows up now:

Screenshot 2024-02-06 120655