-
Bug
-
Resolution: Invalid
-
Major
-
2.9.19
-
None
FileCompositeMetadata.java
public boolean isCompositeMetadata(String metadataName) throws RepositoryException { Configuration metadataConfig = _configuration.getChild(metadataName, false); if (metadataConfig == null) { return false; } return metadataConfig.getChildren().length > 0; }
"File" implementation of CompositeMetadata doens't handle child CompositeMetadata well.
If it encounters an empty metadata tag, it will assume it's not composite : an empty composite metadata is not possible.
This leads to errors in constructs such as generation's SitemapInputData :
SitemapInputData.java
if (!metadataHolder.isCompositeMetadata(name) && !metadataHolder.isBinaryMetadata(name)) { String[] metadata = metadataHolder.getMetadataAsStringArray(name); if (metadata.length == 1) { attrs.addAttribute("", name, name, "CDATA", metadata[0]); } }
This generates an exception as the empty metadata is assumed not to be composite but has no text value, and getMetadataAsXXX methods doesn't accept empty XML tags.