Uploaded image for project: 'Magnolia REST Framework'
  1. Magnolia REST Framework
  2. MGNLREST-166

Querying for supertypes does not return subtypes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.1.1
    • 2.0.2
    • None
    • Yes
    • Saigon 141, Saigon 142, Saigon 143, Saigon 144
    • 8

      Given this configuration

      class: info.magnolia.rest.delivery.jcr.v2.JcrDeliveryEndpointDefinition
      workspace: website
      bypassWorkspaceAcls: true
      

      Making this request returns an empty result which is wrong.

      curl -X GET 'http://<host>/.rest/delivery/test'
      

      The expectation is a list of pages because "mgnl:page" is subtype of "mgnl:content".

      The currently generated query is

      SELECT t.* FROM [nt:base] AS t WHERE t.[jcr:primaryType] = 'mgnl:content' ...
      

      To solve this issue, we may consider selecting from configured node types and using JOINs.

      SELECT t.* FROM [mgnl:content] INNER JOIN [otherNodeType] ...
      

        Acceptance criteria

              hieu.nguyen Hieu Nguyen Duc
              hieu.nguyen Hieu Nguyen Duc
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - 4d
                    4d
                    Remaining:
                    Time Spent - 3.75d Remaining Estimate - 0.25d
                    0.25d
                    Logged:
                    Time Spent - 3.75d Remaining Estimate - 0.25d
                    3.75d