Steps to reproduce
- Having an attribute in content type defined like this:
- type = content (reference-table)
- widget = edition.select-referencetable-content
- widget-params = allowSearchOnContentsWithSameReferencing=true
- Open a content with this type and try to click on the glasses to display the search tool with the referencing contents with the same values.
- I get the following error:
Cannot invoke "org.ametys.runtime.model.ViewItemAccessor.getViewItems()" because "criteria" is null java.lang.NullPointerException: Cannot invoke "org.ametys.runtime.model.ViewItemAccessor.getViewItems()" because "criteria" is null at org.ametys.cms.search.ui.model.impl.DefaultSearchUIModel._getAdvancedCriteriaListInfo(DefaultSearchUIModel.java:420) at org.ametys.cms.search.ui.model.impl.DefaultSearchUIModel.toJSON(DefaultSearchUIModel.java:404) at org.ametys.cms.search.model.SearchModelHelper.getSearchModelConfiguration(SearchModelHelper.java:115) [...]
I tried to update the code to replace org.ametys.cms.content.referencetable.search.ReferencingContentsWithSameValuesSearchUIModel.getAdvancedCriteria(Map<String, Object>){{ return value as {{new View(), but it failed on something else:
org.ametys.runtime.model.exception.UndefinedItemPathException: Unable to retrieve the model item at path 'title'. This path is not defined by the model.
at org.ametys.runtime.model.ModelHelper.getModelItem(ModelHelper.java:116)
at org.ametys.cms.search.content.ContentSearchHelper._getReferenceFromFieldPath(ContentSearchHelper.java:333)
at org.ametys.cms.search.content.ContentSearchHelper.getReferenceFromFieldPath(ContentSearchHelper.java:324)
at org.ametys.cms.search.content.ContentSearchHelper.getSortDefinition(ContentSearchHelper.java:153)
at org.ametys.cms.search.content.ContentSearchHelper.transformContentSearcherSorts(ContentSearchHelper.java:123)
at org.ametys.cms.search.content.ContentSearcherFactory$SearchModelContentSearcher._searcher(ContentSearcherFactory.java:277)
at org.ametys.cms.search.content.ContentSearcherFactory$SearchModelContentSearcher.searchWithFacets(ContentSearcherFactory.java:269)
at org.ametys.cms.search.cocoon.SearchAction.doSearch(SearchAction.java:203)
at org.ametys.cms.search.cocoon.SearchAction.act(SearchAction.java:134)
[...]
Also the search tool is opened, the yellow banner seems to be correct but the title criteria is filled with the first reference values.