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

Querying for supertypes does not return subtypes

    XMLWordPrintable

Details

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

    Description

      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] ...
      

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      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