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

Delivery endpoint, filtering by @name not working properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 2.2.7
    • 2.2.6
    • None
    • None

      Steps to reproduce

      1.  Define a basic endpoint like the following:
        class: info.magnolia.rest.delivery.jcr.v2.JcrDeliveryEndpointDefinition
        workspace: website
        bypassWorkspaceAcls: true
        depth: 5
        nodeTypes:
         - mgnl:page
         - mgnl:area
        childNodeTypes:
         - mgnl:component
      1. On the website workspace, create two pages, test and Test.
      2. Perform the rest request
        SELECT t.* FROM [nt:base] AS t WHERE ((t.[jcr:primaryType] = 'mgnl:page') OR (t.[jcr:primaryType] = 'mgnl:area')) AND (LOWER(LOCALNAME(t)) like 'Test') 
      3. Check no results are returned

      Expected results

      Only the Test page is returned

      Actual results

      No results are returned

      Workaround

      N/A

      Development notes

      Performing the request

      SELECT t.* FROM [nt:base] AS t WHERE ((t.[jcr:primaryType] = 'mgnl:page') OR (t.[jcr:primaryType] = 'mgnl:area')) AND (LOWER(LOCALNAME(t)) like 'test')

      also returns incorrect values, instead of returning only the test page, it returns both, Test and test:

      {
          "results": [
              {
                  "@name": "Test",
                  "@path": "/Test",
                  "@id": "093dae11-6506-4a7b-961f-3af35fcb58ac",
                  "@nodeType": "mgnl:page",
                  "title": "Test with capital",
                  "hideInNav": "false",
                  "noCache": "false",
                  "@nodes": []
              },
              {
                  "@name": "test",
                  "@path": "/test",
                  "@id": "ab9f7eb7-450a-41d6-9e99-98dd9b5066b6",
                  "@nodeType": "mgnl:page",
                  "title": "test in lowercase",
                  "hideInNav": "false",
                  "noCache": "false",
                  "@nodes": []
              }
          ]
      }
      

      Full details and example on support ticket 12890.

        Acceptance criteria

              mgeljic Mikaël Geljić
              ccantalapiedra Carlos Cantalapiedra
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD