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

AdditionNodeWrapper should override getProperty method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 2.2.24
    • None
    • None
    • None

      Description

      The AdditionNodeWrapper overrides the getProperties method, which allows the user to iterate over the additionalProperties of the node. But the getProperty method is not overwritten, so when for a property which is stored at additionalProperties (e.g, when we create a link from a page to another page, there is a @link property stored within the referenced page) it can only be accessed through the getProperties method because the getProperty (super class) doesn't look within the additionalProperties attribute.

      Steps to reproduce

      1. Go to Pages-app
      2. Create a page (lets call it siteOne)
      3. Create another page (lets call it siteTwo)
      4. Now open the siteOne page and within the main area create a link component
      5. Link to the siteTwo page
      6. Register the endpoint definition (just copy the light module)
      7. Install the attached module which as a custom Reference Resolver
      8. Call the endpoint http://localhost:8080/magnoliaAuthor/.rest/delivery/my-endpoint
      9. Check the getProperty method for @link attribute returns false but the node.getProperties("@link") works

      Expected results

      The getProperty method should return true when the attribute @link is checked

      Development notes

      Override the getProperty method so it also checks within the additionalAttributes list

        Acceptance criteria

              canh.nguyen Canh Nguyen
              ccantalapiedra Carlos Cantalapiedra
              DeveloperX
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:
                Work Started:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 3d
                    3d