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

[SearchModel] Reference table : Impossible to have a contentTypes field

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.2.13, 4.3.0
    • 4.2.2, 4.3.0
    • None
    • None
    • 4.3 RC2

      In a content, I have a field linked to a reference table. It's on an abstract level (like Mention in the ODF for example).
      I add a custom search model on this field like this :

      <cms:widget-params>
          <cms:param name="allowSearch">true</cms:param>
          <cms:param name="modelId">search-ui.my-search-model</cms:param>
      </cms:widget-params>

      And my file my-search-model.xml is like this :

      <?xml version="1.0" encoding="UTF-8"?>
      <SearchModel>
          <content-types>
              <content-type id="odf-enumeration.Mention"/>
          </content-types>
          
          <simple-search-criteria>
              <criteria field-ref="title">
                  <test-operator>like</test-operator>
              </criteria>
              
              <criteria system-ref="contentTypes" multiple="true">
                  <widget-params>
                      <param name="excludeReferenceTable">false</param>
                  </widget-params>
              </criteria>
          </simple-search-criteria>
          
          <columns>
              <default>
                  <column system-ref="contentTypes">
                      <label>Type</label>
                  </column>
                  
                  <column metadata-ref="title">
                      <renderer>Ametys.plugins.cms.search.SearchGridHelper.renderTitle</renderer>
                      <label>Libellé</label>
                  </column>
              </default>
          </columns>
      </SearchModel>

      But the field excludeReferenceTable in the enumerationConfig is forced to true and is not configurable.

          [CMS-9974] [SearchModel] Reference table : Impossible to have a contentTypes field

          But here it is not a Dynamic SearchModel, it is a StaticSearchModel

          Simon Prieul (Inactive) added a comment - But here it is not a Dynamic SearchModel, it is a StaticSearchModel

          Je pense que la solution c'est de rendre le org.ametys.cms.search.ui.model.DynamicWrappedSearchUIModel plus malin et de positionner excludeReferenceTable à false si la recherche porte sur des tables de références.

          Laurence Aumeunier added a comment - Je pense que la solution c'est de rendre le org.ametys.cms.search.ui.model.DynamicWrappedSearchUIModel plus malin et de positionner excludeReferenceTable à false si la recherche porte sur des tables de références.

          For laurence

          With CMS-8941, you changed the documentation and implementation of some configuration of SelectContentTypes:

          • excludeReferenceTable
          • excludeAbstract
          • excludeMixin
          • includeMixinOnly
          • includeSupertype
          • strictContentTypes
          • contentTypes

          After this ticket, those configuration parameters are under an object enumerationConfig

          As a result, the XML configuration proposed by bmaurel :

          <widget-params>
              <param name="excludeReferenceTable">false</param>
          </widget-params>

          is incorrect

           

          How can she achieve what she wants to do (if possible), or what can we fix within this ticket to allow her to configure her widget l ?

          Simon Prieul (Inactive) added a comment - For laurence With CMS-8941 , you changed the documentation and implementation of some configuration of SelectContentTypes: excludeReferenceTable excludeAbstract excludeMixin includeMixinOnly includeSupertype strictContentTypes contentTypes After this ticket, those configuration parameters are under an object enumerationConfig As a result, the XML configuration proposed by bmaurel : <widget-params> <param name= "excludeReferenceTable" > false </param> </widget-params> is incorrect   How can she achieve what she wants to do (if possible), or what can we fix within this ticket to allow her to configure her widget l ?

          What are your questions ?

          Bérénice Maurel added a comment - What are your questions ?

          And unfortunately, the configuration of the enumerator is not modifiable, it is hardcoded in org.ametys.cms.search.ui.model.DynamicWrappedSearchUIModel._addContentTypeEnumeratorComponent()

          I don't know what I can do

          Simon Prieul (Inactive) added a comment - And unfortunately, the configuration of the enumerator is not modifiable, it is hardcoded in org.ametys.cms.search.ui.model.DynamicWrappedSearchUIModel._addContentTypeEnumeratorComponent() I don't know what I can do

          It seems that it is on purpose, see CMS-8941

          Ask laurence for more information

          Simon Prieul (Inactive) added a comment - It seems that it is on purpose, see CMS-8941 Ask laurence for more information

          Be careful, the search model you give does not work for the moment due to another bug: CMS-10299

          Simon Prieul (Inactive) added a comment - Be careful, the search model you give does not work for the moment due to another bug: CMS-10299

            bmaurel Bérénice Maurel
            bmaurel Bérénice Maurel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: