Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-1627

import operation does not respect :replace=true for properties

    XMLWordPrintableJSON

Details

    Description

      If I want to import some JSON and then update it with a subsequent POST (using the :replace=true flag), the nodes are updated, but not the properties.

      curl -u admin:admin -F":operation=import" -F":contentType=json" -F':content={"columns":

      {"one":"value"}

      , "layout": "dev"}' http://localhost:8080/dashboard

      If I do a subsequent POST with the :replace parameter:

      curl -u admin:admin -F":operation=import" -F":contentType=json" -F':content={"columns":

      {"one":"love"}

      , "layout": "dev"}' -F":replace=true" http://localhost:8080/dashboard

      The columns object is updated, but the layout property is not. I tracked this down to Sling's DefaultContentCreator, whose createProperty method expressly won't overwrite a property if it already exists.

      Attachments

        1. SLING-1627.patch
          6 kB
          Zach A. Thomas
        2. SLING-1627v2.patch
          11 kB
          Zach A. Thomas

        Activity

          People

            enorman Eric Norman
            zathomas Zach A. Thomas
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: