WordPress.org

Ready to get started?Download WordPress

Forums

WP Document Revisions
[resolved] Bulk Imported files have broken permalinks (5 posts)

  1. nyodulf
    Member
    Posted 1 year ago #

    I have successfully imported a bunch of test documents using the cookbook bulk importer, but the documents are not available through the <domain>/documents/<permalink> structure.

    Uploading a new version fixes it, and files uploaded through admin work too.

    How can I get the bulk importer to work properly?

    http://wordpress.org/extend/plugins/wp-document-revisions/

  2. nyodulf
    Member
    Posted 1 year ago #

    Bump!

    In case it wasn't clear, when I said above that "Uploading a new version fixes it", I meant that for any document with a broken permalink, if I upload a new version of the document through the admin, it fixes the link, but obviously that isn't much use with a bulk importer.

    The way the importer is written, it implies that the documents folder for import can be anywhere. Is that the case? In general it would be helpful to have a bit more info on what conditions are required for the bulk importer to work.

  3. nyodulf
    Member
    Posted 1 year ago #

    OK, some more info on this:

    If I set the post status to 'public' in the importer, the result is a bit strange too - the posts don't show up anywhere in the dashboard, but the number of posts under 'All' in the post counter continues to rise by the number of documents found by the importer. Basically, the importer seems to be capable of creating posts in the database to which there is no interface in wordpress - no way to view them and no way to delete them.

    I'd really appreciate some help with this. I have to get this working for a client who has over 300 documents to set up, and obviously doing that manually for each one would take a lot of time. I am simply using the bulk importer as is, only changing the paths apart from that one experiment with the post status.

  4. nyodulf
    Member
    Posted 1 year ago #

    One more try...

    One thing the bulk uploader does not do, which the main plugin does, is hash the file and put it in the uploads/yyyy/MM/ directory, and I think this is the main issue.

    The bulk uploader script uses the following functions on the files it finds:

    • wp_insert_post
    • wp_set_post_terms
    • wp_check_filetype
    • wp_insert_attachment
    • wp_update_post

    None of these will move the file to the correct place and hash it in the same way that the admin interface version does. Functions like filename_rewrite and rewrite_file_url are integrated into the wp_handle_upload process using 'add_filter', but don't get a lookin in the bulk import version, so the plugin can't serve the files properly.

    Any chance of a working version of the bulk importer? I am using this plugin because of the response in this thread: http://wordpress.org/support/topic/can-i-ftp-files-to-the-server-and-get-wp-document-revisions-to-index-them?replies=3 but as far as I can tell it cannot work in its current form.

  5. Ben Balter
    Member
    Plugin Author

    Posted 1 year ago #

    The simplest bulk import would be to move the files into the uploads folder. The bulk importer, as written, does not move files from their original location. This functionality could be added and I would gladly accept a pull request.

    The reason documents can be anywhere at the time of import is because the document upload folder can live anywhere (it does not have to be /wp-content/uploads/). This setting is set on the media page.

    To debug this issue further, please check your PHP error log, which should have more detailed diagnostic information.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic