Skip Menu |

This queue is for tickets about the Apache-WebDAV CPAN distribution.

Report information
The Basics
Id: 39285
Status: new
Priority: 0/
Queue: Apache-WebDAV

People
Owner: Nobody in particular
Requestors: peter [...] makholm.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.01
Fixed in: (no value)



Subject: DELETE doesn't seem to work on collection trees
The delete method uses File::Find::Rule::Filesys::Virtual to get a list of ressources to delete. For collections this will in general place collections before content. But Apache::WebDAV tries to delete ressources in the order File::Find::Rule::Filesys::Virtual returns them. Which means that i tries to delete collection before the content is deleted, which often fails (at least with Filesys::Virtual::Plain). This bug also breaks COPY as this is implemented by an copy/delete operation.
From: peter [...] makholm.net
On Mon Sep 15 05:38:51 2008, pmakholm wrote: Show quoted text
> This bug also breaks COPY as this is implemented by an copy/delete > operation.
This should have been MOVE instead of COPY. Fixing the delete-method only fixes the DELETE operation. MOVE uses an copy pasted version of the method called delete_resource.
From: peter [...] makholm.net
On Mon Sep 15 05:38:51 2008, pmakholm wrote: Show quoted text
> The delete method uses File::Find::Rule::Filesys::Virtual to get a list > of ressources to delete. For collections this will in general place > collections before content.
Both the delete method and the delete_resource method contains the following code: my @files = grep {$_ !~ m|/\.\.?$|} # Make sure it's not a / . .. map { s|/+|/|g; $_ } # Replace multiple slashes with single File::Find::Rule::Filesys::Virtual->virtual($handler)->in($file), $file; A quick fix is to change both places to add an reverse in front of the grep operator and to change the order of $file and the File::Find::Rule in the third line. I don't know if FFRF::Virtual guarantees a pre-order traversal of the directory tree. If this isn't guaranteed the solution would be to sort the output on the length of the paths.