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

[Teaser] TeaserImpl tries to cast Asset to Page #2342

Closed
jckautzmann opened this issue Oct 17, 2022 · 0 comments · Fixed by #2343
Closed

[Teaser] TeaserImpl tries to cast Asset to Page #2342

jckautzmann opened this issue Oct 17, 2022 · 0 comments · Fixed by #2343
Milestone

Comments

@jckautzmann
Copy link
Contributor

With the change that makes the Link Manager public (PR #2196) an incompatibility of the Teaser component to existing content was introduced. This affects Teasers that link to assets.

When configuring the main link with a link to an asset, opening the Teaser dialog throws following errors:

Caused by: java.lang.ClassCastException: class com.day.cq.dam.core.impl.AssetImpl cannot be cast to class com.day.cq.wcm.api.Page (com.day.cq.dam.core.impl.AssetImpl is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @62c3e785; com.day.cq.wcm.api.Page is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @f7b8f27)
    at com.adobe.cq.wcm.core.components.commons.editor.dialog.inherited.PageImageThumbnail.initModel(PageImageThumbnail.java:122)

When configuring the CTA with a link to an asset, rendering the page throws following errors:

Caused by: java.lang.ClassCastException: class com.day.cq.dam.core.impl.AssetImpl cannot be cast to class com.day.cq.wcm.api.Page (com.day.cq.dam.core.impl.AssetImpl is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @62c3e785; com.day.cq.wcm.api.Page is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @f7b8f27)
    at com.adobe.cq.wcm.core.components.internal.models.v1.TeaserImpl$Action.getCtaPage(TeaserImpl.java:513)
    at java.base/java.util.Optional.flatMap(Optional.java:294)
    at com.adobe.cq.wcm.core.components.internal.models.v2.TeaserImpl.getTargetPage(TeaserImpl.java:118)
    at com.adobe.cq.wcm.core.components.internal.models.v2.TeaserImpl.initImage(TeaserImpl.java:79)
    at com.adobe.cq.wcm.core.components.internal.models.v1.TeaserImpl.initModel(TeaserImpl.java:215)
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

Successfully merging a pull request may close this issue.

1 participant