Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
Description
Currently, the following HST setup results in a warning
+ hst:hst + hst:configurations + common + corporate - hst:inheritsfrom = ../common + hst:sitemenus + hst:workspace + hst:sitemenus + subsite - hst:inheritsfrom = ../corporate
The warning is :
log.warn("Skipping inheritfrom property for configuration node '{}' because this node is already inherit. Not allowed to inherit again", inheritConfig.getValueProvider().getPath());
Supporting however the above setup should be fairly trivial (add some unit tests though that guarantee the order of inheritance)
in org.hippoecm.hst.configuration.cache.CompositeConfigurationNodes#CompositeConfigurationNodes we now have:
for (String inheritPath : inherits) { if (!inheritPath.startsWith("../")) { log.warn("hst:inheritsfrom property must start with ../ but this is not the case for '{}'. We skip this inherit", configurationRootNode.getValueProvider().getPath()); continue; } String hstConfigsInheritedRelPath = inheritPath.substring(3); String absHstConfigsInheritedPath = configurationsNode.getValueProvider().getPath() + "/" + hstConfigsInheritedRelPath; // regardless whether absHstConfigsInheritedPath exists or not, add it to the compositeConfigurationDependencyPaths : If it gets // added later on, it does impact this CompositeConfigurationNodes compositeConfigurationDependenyPaths.add(absHstConfigsInheritedPath); compositeConfigurationDependenyPaths.addAll(createDependencyPaths(absHstConfigsInheritedPath, relPaths, false)); HstNode inheritConfig = configurationsNode.getNode(hstConfigsInheritedRelPath); if (inheritConfig != null && isValidInheritedNode(inheritConfig)) { orderedRootConfigurationNodeInheritanceList.add(inheritConfig); if (inheritConfig.getValueProvider().hasProperty(HstNodeTypes.GENERAL_PROPERTY_INHERITS_FROM)) { log.warn("Skipping inheritfrom property for configuration node '{}' because this node is already inherit. Not allowed to inherit again", inheritConfig.getValueProvider().getPath()); } } else { log.error("Relative inherit path '{}' for node '{}' does not point to a node of type '{}' or does not exist. Fix this path.", new String[]{inheritPath, configurationRootNode.getValueProvider().getPath(), NODETYPE_HST_CONFIGURATION}); } }
in the part with
if (inheritConfig.getValueProvider().hasProperty(HstNodeTypes.GENERAL_PROPERTY_INHERITS_FROM)) {
we should just use the inherited config inherits from property again as an extra 'inheritPath'
Attachments
Issue Links
- relates to
-
HSTTWO-3385 (Re)enable inheritance of hst:workspace elements to facilitate proper channel inheritance
- Closed
-
HSTTWO-3435 Support to cherry pick which hst configuration main config node to inherit
- Closed