]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/bugs/filecheck_failing_to_find_files.mdwn
oh dear not fixed after all
[ikiwiki.git] / doc / bugs / filecheck_failing_to_find_files.mdwn
index be6cdbb204931a2aa17310b969cf5ad35d34ff43..33975f05c71e45241b908f1b7ea267ff8f66c083 100644 (file)
@@ -10,6 +10,17 @@ It turns out that the filecheck plugin couldn't find the file, because it was me
 >> But if it is given `/path/to/srcdir/foo/bar.gif` instead, then it *can* find the file, and returns the mime-type correctly.
 >> --[[KathrynAndersen]]
 
+>>> Ok, so it's not removal specific, can in fact be triggered by using
+>>> testpagespec (or really anything besides attachment, which passes
+>>> the filename parameter). Nor is it limited to mimetype, all the tests in 
+>>> filecheck have the problem. --[[Joey]] 
+
+>>>> Alas, not fixed.  It seems I was mistaken in some of my assumptions.
+>>>> It still happens when attempting to remove attachments.
+>>>> With your fix, the `IkiWiki::srcfile` function is only called when the filename is not passed in, but it appears that in the case of removing attachments, the filename IS passed in, but it is the relative filename as mentioned above.  Thus, the file is still not found, and the mime-type comes back as unknown.
+>>>> The reason my patch worked is because, rather than checking whether a filename was passed in before applying IkiWiki::srcfile to the filename, it checks whether the file can be found, and if it cannot be found, then it applies IkiWiki::srcfile to the filename.
+>>>> --[[KathrynAndersen]]
+
 The following patch fixes the problem:
 
        diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm