sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bertrand Delacretaz (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SLING-8186) Moved nt:file node disappears when @Delte parameter is used in same request
Date Mon, 07 Jan 2019 11:30:00 GMT

    [ https://issues.apache.org/jira/browse/SLING-8186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16735694#comment-16735694
] 

Bertrand Delacretaz commented on SLING-8186:
--------------------------------------------

I debugged your example and I think the cause is the ambiguity between `test` being part of
the target path and also being the property that you ask to delete.

If I do this instead the move happens correctly:

{code}
 curl -u admin:admin -F "./test/title=Hello World at $(date)" -F './test/file@MoveFrom=/content/file'
-F './other@Delete=true' http://localhost:8080
{code}

As there's no property named `test` in the content, the `ModifyOperation` tries to find a
`test` resource to delete [1], finds it under `/` and deletes it.

[~cziegeler] the code that deletes the `childRsrc` at [1] was introduced in a commit of yours
[2] with apparently unrelated changes (SLING-6723), do you know what its purpose is, or can
we remove it?

[1] https://github.com/apache/sling-org-apache-sling-servlets-post/blob/bfe541c96a1d06d5a07c0541f93dd268af9bf775/src/main/java/org/apache/sling/servlets/post/impl/operations/ModifyOperation.java#L330
[2] https://github.com/apache/sling-org-apache-sling-servlets-post/commit/2b0584555bb20868c23558ab07a27e8e0204891c

> Moved nt:file node disappears when @Delte parameter is used in same request
> ---------------------------------------------------------------------------
>
>                 Key: SLING-8186
>                 URL: https://issues.apache.org/jira/browse/SLING-8186
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>    Affects Versions: Servlets Post 2.3.26
>            Reporter: Burkhard Pauli
>            Priority: Major
>
> If a file is moved to a new location with the @MoveFrom parameter and the request contains
the @Delete parameter at the same time, the file is dropped and never saved to the new location.
> Step to reproduce the issue:
>  # Create a node of type nt:file at the location {{/content/file}}
>  # Execute the following curl command:
>  {{curl -u admin:admin -F './test/title=Hello World' -F './test/file@MoveFrom=/content/file'
-F './test@Delete=true' [http://localhost:4502/content]}}
> Observed behaviour:
>  The file is not saved at the new location at {{/content/test/file}} and it is not available
anymore at the old location {{/content/file}}
> Expected:
>  The file is saved at the new location {{/content/test/file}} as long as other properties
are saved when the request contains the delete operation (like the title property in the example
above).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message