My question isn't with Document Revisions itself but with the bulk import script. I ended up having to make several changes to get it to work with WP 3.5, but there's still something I can't get working right. Files that I upload through the Document Revisions admin screen work just fine, but if I try to download a file imported through the script, I get a 404 error.
I see an error in the WordPress logs showing that the path to the file can't be found. The path looks something like
So it's the double "documents" in the path that's messing up the links.
I then traced to the database looking at the wp_postmeta tables. Files uploaded through the admin screen have the _wp_attached_file value set to "filename.ext" whereas files uploaded through the script have "documents/filename.ext".
I'm guessing somewhere in the plugin, it's inserting the "documents" slug again, which is where the double path comes from. And that's where I'm stuck: It seems that attaching the file through the plugin and doing it through the import script use two different methods but I don't know enough about WordPress to fix it.
Any ideas? Thanks.