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

Form Option with Datasource throws error | getItems throws null while override #1461

Open ckj0369 opened 3 years ago

ckj0369 commented 3 years ago

Hi Team,

I'm trying to overlay form option.java to get the data in json format using exporter framework. However, everything works as expected with the override and to get items data I've used:

@Override
    public List<OptionItem> getItems() {
        return superSelf.getItems();
    }

This method throws error when option is selected from Datasource ERROR [OptionsImpl.java] Failed to include the datasource at weretail/components/form/options/datasource/countriesdatasource org.apache.sling.api.request.RecursionTooDeepException Same works fine with Local and List.

Also raised here: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/form-option-datasource-error-in-getitems/qaq-p/401455#M87221

ckj0369 commented 3 years ago
ERROR [OptionsImpl.java] Failed to include the datasource at weretail/components/form/options/datasource/countriesdatasource 
org.apache.sling.api.request.RecursionTooDeepException: /content/ckj/testpage/jcr:content/root/options
    at org.apache.sling.engine.impl.request.RequestData.setContent(RequestData.java:571)
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:312)
    at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:211)
    at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:104)
    at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:516)
    at com.adobe.cq.wcm.core.components.internal.models.v1.form.OptionsImpl.populateOptionItemsFromDatasource(OptionsImpl.java:209)
    at com.adobe.cq.wcm.core.components.internal.models.v1.form.OptionsImpl.populateOptionItems(OptionsImpl.java:161)
    at com.adobe.cq.wcm.core.components.internal.models.v1.form.OptionsImpl.getItems(OptionsImpl.java:107)
    at sun.reflect.GeneratedMethodAccessor185.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

Above is the error from the log when we use datasource, any idea ?

bruno-bradach-sn commented 11 months ago

@ckj0369 Were you able to solve this? I'm experiencing the same issue.

Thanks.