Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
1
-
Quasar
Description
In org.hippoecm.hst.pagecomposer.jaxrs.services.ContainerItemComponentServiceImpl#represent there is:
final HstComponentConfiguration componentReference = componentConfigurations.values().stream() //TODO SS: Optimize loop .filter(x -> x.getCanonicalStoredLocation().equals(componentCanonicalPath)).findFirst() .orElseThrow(() -> new RuntimeException(String.format("Component representation is not found: '%s'", componentCanonicalPath)));
above returns A HstComponentConfiguration that matches the jcr Path of componentItemNode. However, if the componentItemNode is a shared component (eg header banner), you get a random HstComponentConfiguration instance and MOST certainly not the one you clicked in the Channel Mgr.
The above logic is not possible to implement correctly in that way: you cannot find the right HstComponentConfiguration instance from just the node id. Instead, we should create a service similar to org.hippoecm.hst.experiencepage.ExperiencePageService#loadExperiencePageComponentItem only then for loading a SINGLE disconnected from the HstModel HstComponentConfiguration on the fly