Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-12928

Search filters is not taken into account on null field in local extension repository

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.4.1
    • 7.1.4
    • Extension
    • None
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce:

      On a wiki page, paste this code:

      {{groovy}}
      import com.xpn.xwiki.web.Utils;
      import org.xwiki.extension.repository.search.ExtensionQuery;
      
      def localExtensionRepository = Utils.getComponent(org.xwiki.extension.repository.LocalExtensionRepository.class);
      
      def query = new ExtensionQuery();
      
      println "= All extensions ="
      for (def extension : localExtensionRepository.search(query)) {
        println "* " + extension.getName();
      }
      
      println "= Flavors ="
      query.addFilter("category", "flavor", ExtensionQuery.COMPARISON.EQUAL);
      for (def extension : localExtensionRepository.search(query)) {
        println "* " + extension.getName();
      }
      {{/groovy}}
      

      See the results: the filter is not taken into account in the second search. The results are exactly the same.

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            gdelhumeau Guillaume Delhumeau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: