Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-13993

Advanced Search using custom type fails if Category based property has "include SubCategories" option

    Details

      Description

      Description

      Technical Description of the issue: Advanced Search of custom type document fails if Category based property has <control-param name="showSubCategoriesOption">true</control-param> option.

      Customers Description of the problem: If a property that is driven by “Category" based values is used in a custom Advanced Search form for a custom type, with the "include SubCategories" option provided, the query always returns zero results. There are no errors seen in the logs.

      Supporting evidence

      Steps to reproduce
      1. Add a custom type using something like:
      <type name="m1:customDocument">
      <title>Test Custom Document</title>
      <description>New custom document type for testing</description>
      <parent>cm:content</parent>
      <properties>
      <property name="m1:categoryCustomProperty">
      <title>Category Custom Property</title>
      <description>A category based custom property</description>
      <type>d:category</type>
      </property>
      </properties>
      </type>

      2. In share-config-custom.xml create a custom search form for the above custom type, using:
      <!-- m1:customDocument type (new nodes) -->
      <config evaluator="model-type" condition="m1:customDocument">
      <forms>
      <!-- Search form -->
      <form id="search">
      <field-visibility>
      <show id="cm:name" />
      <show id="cm:title" force="true" />
      <show id="cm:description" force="true" />
      <show id="mimetype" />
      <show id="cm:modified" />
      <show id="cm:modifier" />
      <show id="m1:categoryCustomProperty" />
      </field-visibility>
      <appearance>
      <field id="m1:categoryCustomProperty">
      <control>
      <control-param name="compactMode">true</control-param>
      <control-param name="showSubCategoriesOption">true</control-param>
      <control-param name="startLocation">/cm:categoryRoot/cm:generalclassifiable</control-param>
      </control>
      </field>
      </appearance>
      </form>
      </forms>
      </config>

      3. Add the search form for the custom type to Advanced Search using:
      <config replace="true" evaluator="string-compare" condition="AdvancedSearch">
      <advanced-search>
      <forms>
      <form labelId="search.form.label.cm_content" descriptionId="search.form.desc.cm_content">cm:content</form>
      <form labelId="search.form.label.cm_folder" descriptionId="search.form.desc.cm_folder">cm:folder</form>
      <form labelId="SearchCustomDocument" descriptionId="SearchCustomDocuments">m1:customDocument</form>
      </forms>
      </advanced-search>
      </config>

      4. Create a document of the custom type

      5. Open Advanced Search and choose to find the custom type.

      6. In the form enter a valid name that should search for the document.

      7. Comment out from share-config-custom.xml as shown below:
      <!-- <control-param name="showSubCategoriesOption">true</control-param> -->

      8. Repeat steps 5 and 6

      Expected Behaviour
      Document should be found

      Observed Behaviour
      On step 6, document is not found.

      Analysis to date
      Issue was also reproduced on Alfresco 5.0.0.

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  lcolorado Luis Colorado [X] (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 week, 3 days, 5 hours
                    1w 3d 5h

                      Structure Helper Panel