Current Behavior
LatestVersionImplementationPicker picks up custom implementation over core ones. I identified two issues caused by that behavior.
one with xfpage component (/libs/cq/experience-fragments/components/xfpage). It's loading core Page model while inheriting from foundation.
one with PageImageThumbnail when Image dialog is loaded, it's trying to adapt Teaser onto image.
In both case, they trigger LatestVersionImplementationPicker instead of resource based and load our custom model which tries to inject (Self, Via) super type resource model.
Since resource context is missing superType, it triggers LatestVersionImplementationPicker again, injecting the custom implementation into itself, thus preventing methods delegation pattern.
So we end up with the interface methods, returning null.
The consequences are that
for xfpage component, it cannot load htmlPageItems preventing loading styles in xf for FE pipeline setup
Expected behavior/code
I expect styles to be loaded on XF when using FE pipeline, and image dialog to not make a null pointer.
Environment
AEM cloud 2023.9.13665.20230927T063259Z
Core Components version (e.g. 2.0.4)
JRE version 11
Possible Solution
We considered 2 options:
a custom Via provider
a custom ImplementationPicker
I ended up choosing the second approach to tackle the problem at it's root. But ResourceBasedPicker and LatestVersionImplementationPicker are respectively ranked 0 and 1, leaving no space for a custom implementation.
I added a custom implementation that ignores custom models Ranked 1 and since service id is higher, somehow it's being picked before LatestVersion but it's not a very reliable solution.
So i would suggest changing the rank of the LatestVersionImplementation to 10, or add some more configuration options.
Bug Report
Current Behavior LatestVersionImplementationPicker picks up custom implementation over core ones. I identified two issues caused by that behavior.
In both case, they trigger LatestVersionImplementationPicker instead of resource based and load our custom model which tries to inject (Self, Via) super type resource model.
Since resource context is missing superType, it triggers LatestVersionImplementationPicker again, injecting the custom implementation into itself, thus preventing methods delegation pattern. So we end up with the interface methods, returning null.
The consequences are that
Expected behavior/code I expect styles to be loaded on XF when using FE pipeline, and image dialog to not make a null pointer.
Environment
Possible Solution We considered 2 options:
I ended up choosing the second approach to tackle the problem at it's root. But ResourceBasedPicker and LatestVersionImplementationPicker are respectively ranked 0 and 1, leaving no space for a custom implementation. I added a custom implementation that ignores custom models Ranked 1 and since service id is higher, somehow it's being picked before LatestVersion but it's not a very reliable solution.
So i would suggest changing the rank of the LatestVersionImplementation to 10, or add some more configuration options.
But maybe you have better suggestions for me.