Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8345

Decorating searchResultSuppliers does not work as expected.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Neutral
    • None
    • None
    • None
    • None

    Description

      Because of MAGNOLIA-8343 I have decorated the pages and dam apps to use our own searchresultsupplier. However I run into some issues with that.

      Using our own definition caused a strange error in the logs:

      java.lang.IllegalArgumentException: object is not an instance of declaring class

      caused by

      nl.vpro.magnolia.periscope.JcrSearchResultSupplierDefinition$ByteBuddy$5BDXAzX5.getSubAppName(Unknown Source) ~[?:?]

      Investigation showed that somehow the that the definition is of the type info.magnolia.periscope.search.jcr.JcrSearchResultSupplierDefinition and not the interface info.magnolia.periscope.search.SearchResultSupplierDefinition so calls passed through fail since our version does not extend from that it fails.

      First workaround attempt was to extend from info.magnolia.periscope.search.jcr.JcrSearchResultSupplierDefinition however that is not possible since it returns not the interface but a instance of JcrSearchResultSupplierStrategy and if you try to extend from that as well, you land in a rabbithole of package protected and private methods.

      Final workaround was to fully copy the searchresultsupplier definition and fill in all null values with actual values as to avoid calls to the original definition.

       

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              rico.jansen Rico Jansen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Bug DoR
                  Task DoD