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
747 stars 753 forks source link

[Image V3] Cannot add callable link (href="tel:..." to image v3 component #2599

Open fbonheurCap opened 1 year ago

fbonheurCap commented 1 year ago

Bug Report

Current Behavior Add a native image v3 component to a page In the Metadata dialog tab set le Link property to "tel:0000000000" View the page as published The href attribute of the image V3 anchor tag is "tel:?wcmmode=disabled" The following error is visible in the logs

16.10.2023 11:54:32.077 *ERROR* [[0:0:0:0:0:0:0:1] [1697450072065] GET /content/ufrfront/edito/home/jcr:content/root/image.m90429.html HTTP/1.1] com.adobe.cq.wcm.core.components.internal.link.LinkUtil abs_path requested
org.apache.commons.httpclient.URIException: abs_path requested
    at org.apache.commons.httpclient.URI.<init>(URI.java:326) [com.day.commons.osgi.wrapper.commons-httpclient:3.1.0.28]
    at com.adobe.cq.wcm.core.components.internal.link.LinkUtil.escape(LinkUtil.java:89) [com.adobe.cq.core.wcm.components.core:2.23.0]
    at com.adobe.cq.wcm.core.components.internal.link.DefaultPathProcessor.sanitize(DefaultPathProcessor.java:141) [com.adobe.cq.core.wcm.components.core:2.23.0]
    at com.adobe.cq.wcm.core.components.internal.link.LinkBuilderImpl.lambda$buildLink$1(LinkBuilderImpl.java:169) [com.adobe.cq.core.wcm.components.core:2.23.0]
    at java.base/java.util.Optional.map(Optional.java:265)
    at com.adobe.cq.wcm.core.components.internal.link.LinkBuilderImpl.buildLink(LinkBuilderImpl.java:168) [com.adobe.cq.core.wcm.components.core:2.23.0]
    at com.adobe.cq.wcm.core.components.internal.link.LinkBuilderImpl.build(LinkBuilderImpl.java:149) [com.adobe.cq.core.wcm.components.core:2.23.0]
    at com.adobe.cq.wcm.core.components.internal.models.v1.ImageImpl.initModel(ImageImpl.java:302) [com.adobe.cq.core.wcm.components.core:2.23.0]
    at com.adobe.cq.wcm.core.components.internal.models.v2.ImageImpl.initModel(ImageImpl.java:153) [com.adobe.cq.core.wcm.components.core:2.23.0]
    at com.adobe.cq.wcm.core.components.internal.models.v3.ImageImpl.initModel(ImageImpl.java:92) [com.adobe.cq.core.wcm.components.core:2.23.0]
    at jdk.internal.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)

Expected behavior/code The href attribute of the image V3 anchor tag is "tel:0000000000?wcmmode=disabled"

Environment

Possible Solution

Additional context / Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.

satzlinger commented 11 months ago

We also experience something similar when a mailto:mail@example.com link is used in the Image. The mailto works on publisher. It seems like the Teaser is also affected https://github.com/adobe/aem-core-wcm-components/issues/2636

jtneves commented 10 months ago

The same issue occurs with core/wcm/components/button/v2/button. The link set as tel:0800600600 works, but the error logs get flooded with this error. This makes it hard to navigate through Cloud instances error logs. The issue is in LinkUtil, any component using it have the issue.

fbonheurCap commented 4 months ago

Any update about this issue ?

fahol-coop commented 2 months ago

This should be fixed globaly in LinkUtil, as mailto: or tel: are valid inputs for href attribute. It doesn't matter if it's a teaser, button or anything else.

What is the reason to block it? image