A criterion is added for each item of the view. But if a attribute is present twice in the view, this will fails with the following error :
A component for the role 'itemPath' is already registered on this ComponentManager. java.lang.IllegalArgumentException: A component for the role 'itemPath' is already registered on this ComponentManager. at org.ametys.runtime.plugin.component.ThreadSafeComponentManager._addComponent(ThreadSafeComponentManager.java:323) at org.ametys.runtime.plugin.component.ThreadSafeComponentManager.addComponent(ThreadSafeComponentManager.java:311) at org.ametys.cms.search.ui.model.ReferenceTableSearchUIModel.addAttributeCriterionComponent(ReferenceTableSearchUIModel.java:356) at org.ametys.cms.search.ui.model.ReferenceTableSearchUIModel.addCriteriaComponents(ReferenceTableSearchUIModel.java:233) at org.ametys.cms.search.ui.model.ReferenceTableSearchUIModel.addCriteriaComponents(ReferenceTableSearchUIModel.java:195) at org.ametys.cms.search.ui.model.ReferenceTableSearchUIModel.getCriteria(ReferenceTableSearchUIModel.java:144)
worse, this will leave the component is a bogus state where every following calls will fails with a similiar error but this time accusing the first item of the view.
This is because the criterion manager is partially initialized but we check the _searchCriteria map to determine if we need to initialize it.