WordPress.org

Ready to get started?Download WordPress

Forums

Document Repository
[resolved] ob_start(); - admin doc search - XDomainRequest (6 posts)

  1. sime0n
    Member
    Posted 1 year ago #

    I turned on WP_DEBUG and got a Doc Repo ob_clean() error:
    Notice: ob_clean() [ref.outcontrol]: failed to delete buffer. No buffer to delete in /home/user/example.com/wp-content/plugins/document-repository/document-repository.php on line 297

    I searched and found this: http://stackoverflow.com/questions/3521612/php-force-an-image-download-from-above-directory-root

    I added ob_start(); to line 297, just before ob_clean() in document-repository.php and all's well, no error.

    --

    I posted previously about duplicate entries. As it happened, I got a request to make the doc repo admin searchable, so searched, found, and installed the MetaSearchTo plugin, and used Yoast's SEO plugin to assign a focus keyword (the slug) to each doc, worked well, until it didn't. The MetaSearchTo plugin zonked out with the latest WP update, creating the aforementioned duplicate entires. I replaced MetaSearchTo with Relevanssi, works fine. However, it's enough of a work around I figured I'd mention it as a feature request here in case you felt it worth integrating, fwiw.

    --

    This has more to do with WooCommerce I think, I'm in discussion with their devs currently, but when WooCommerce is active, it blocks doc repo downloads in IE with a XDomainRequest error. Stop Spammer Registrations does the same thing, though that's more understandable, and easier to deactivate without replacing whole sections of the site. I wanted to post about it here so you know it's happening, and in case you've run into this and know of a fix. I'll update this thread once WooCommerce is through testing.

    http://wordpress.org/extend/plugins/document-repository/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    Are you using the development version?

    The current released version is not compatible with WP 3.5.

  3. sime0n
    Member
    Posted 1 year ago #

    I am, and actually think I may have just figured out how to prevent the XDomainRequest error in IE while WooCommerce is running. Adding: header( 'Cache-Control: must-revalidate' ); to document-repository.php prevents the XDomainRequest error for me. So in all I've changed the code to look like this:

    ob_start();
    ob_clean();
    header( 'Content-Description: File Transfer' );
    header( 'Content-Type: ' . $mime_type );
    header( "Content-Disposition: attachment; filename={$filename}" );
    header( 'Content-Transfer-Encoding: binary' );
    header( 'Cache-Control: must-revalidate' );
  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    That completely blew the download on me in Chrome (as in the tab dies).

  5. sime0n
    Member
    Posted 1 year ago #

    I eventually discovered the ie8 xdomainrequest error was caused by supercache trying to serve a static page rather than handoff the url to the pdf. All good now. I really appreciate the plugin. Thanks!

  6. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    Thanks for letting me know :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic