Skip to content

Commit

Permalink
Temporary fix for MID-2317 (empty Configuration section in Resource W…
Browse files Browse the repository at this point in the history
…izard for newly created resources)
  • Loading branch information
mederly committed Apr 21, 2015
1 parent c2bc8a1 commit 4e34ffd
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -384,10 +384,14 @@ private List<ContainerWrapper> createResourceContainerWrapper(PrismObject<Connec
ConnectorType connectorType = connector.asObjectable();
PrismSchema schema = ConnectorTypeUtil.parseConnectorSchema(connectorType, connector.getPrismContext());
PrismContainerDefinition definition = ConnectorTypeUtil.findConfigurationContainerDefintion(connectorType, schema);

ContainerStatus status = container != null ? ContainerStatus.MODIFYING : ContainerStatus.ADDING;
if (container == null) {
container = definition.instantiate();
// brutal hack - the definition has (errorneously) set maxOccurs = unbounded. But there can be only one configuration container.
// See MID-2317 and related issues
PrismContainerDefinition definitionFixed = definition.clone();
definitionFixed.setMaxOccurs(1);
container = definitionFixed.instantiate();
}

return createContainerWrapper(container, new ItemPath(ResourceType.F_CONNECTOR_CONFIGURATION), pageBase);
Expand Down

0 comments on commit 4e34ffd

Please sign in to comment.