-
Notifications
You must be signed in to change notification settings - Fork 753
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
Categories object not populated when using com.adobe.cq.wcm.core.components.models.ClientLibraries. #1808
Comments
I am seeing the exact same behaviour, this is not working indeed. Was trying something similar as described here: https://github.com/adobe/aem-core-wcm-components/blob/9dd529595b65a8441bd320b602584c2d568b6361/extensions/amp/README.md
|
I see the same issue when the named property is not set in For example, the code posted above works properly for me (insofar as it properly sets the If I change the htl to set the My suspicion is that since both the This might be an issue for Sling, to make sure that an object isn't injected unless the name matches - even if the object type is compatible with something else. This is all just speculation, I didn't step through the entire field injection resolution. That said, changing the public class ClientLibrariesImpl implements ClientLibraries {
// ....
@RequestAttribute(injectionStrategy = InjectionStrategy.OPTIONAL, name = OPTION_RESOURCE_TYPES)
Object resourceTypes;
// ....
@RequestAttribute(injectionStrategy = InjectionStrategy.OPTIONAL, name = OPTION_CATEGORIES)
private Object categories;
// ....
} @gmartinelo, do those changes resolve your issue? |
@ky940819 sorry for the late response. Yes, I see the right object in the model with those changes. Thank you. |
This is still not working! I always see this in the logs - "No categories detected. Please either specify the categories as a CSV string or a set of resource types for looking them up!" even when passing the right category from HTL |
I still see this issue. My environment is as follows |
Bug Report
Current Behavior
The 'categories' property never gets populated with the desired values in the model and it seems to be instanciated with an object of type com.day.cq.i18n.
I'm following this documentation:
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/including-clientlibs.html?lang=en
<sly data-sly-use.clientlibs="${'com.adobe.cq.wcm.core.components.models.ClientLibraries' @ categories='otf.vanilla.homepage', async=true}"> ${clientlibs.jsIncludes @ context="unsafe"} </sly>
The resourceTypes property seems to have the same behavior described previously. Async, defer, crossorigin,media and onload are populated correctly.
Expected behavior/code
Categories object should have the values passed from HTL.
Environment
Additional context / Screenshots
Page.html
ClientLibrariesImpl.java
The text was updated successfully, but these errors were encountered: