Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-12534

ReferencingContentsWithSameValuesSearchUIModel is broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.9.2, 4.10.0
    • 4.9.1
    • None
    • None
    • 4.9.2
    • Oui

      Steps to reproduce

      1. Having an attribute in content type defined like this:
        • type = content (reference-table)
        • widget = edition.select-referencetable-content
        • widget-params = allowSearchOnContentsWithSameReferencing=true
      2. 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.
      3. 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.

            cbayle Caroline Bayle
            bmaurel Bérénice Maurel
            Caroline Bayle Caroline Bayle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: