WordPress.org

Ready to get started?Download WordPress

Forums

BuddyPress Docs
URL is missing a slash with IIS (7 posts)

  1. Roquefort
    Member
    Posted 6 months ago #

    Hello,

    I'm currently hosting the latest version of WordPress in IIS 7.5, and I'm having a problem specific to BP Docs. The problem is that when I try to click on an uploaded file, the URL it redirects to is missing a /. See here:

    https://www.test.com/wp-content/uploads/bp-attachments168/New-Microsoft-Excel-Worksheet.xlsx

    See the missing slash between "bp-attachments" and "168"? All of my docs do this.

    Does anyone know of a way to fix this?

    https://wordpress.org/plugins/buddypress-docs/

  2. tbar_uk
    Member
    Posted 5 months ago #

    Getting the same myself WP3.8. May look at trying to change the url via htaccess. Should be possible, rewriting the string to inlcude a trailing /.

    It effectively makes ALL attachments useless at the moment. I think this is a very useful feature so will take a look at the code... I may be some time.

  3. tbar_uk
    Member
    Posted 5 months ago #

    Try the following. In an editor go to line 1934 of the file: templates.php in the includes dir.

    Paste in:

    // BUGFIX: URL without / as attachment link.
          $attachment_url = str_replace("bp-attachments", "bp-attachments/", $attachment_url);

    It goes just before the IF statement... as follows:

    $attachment_filename = basename( $attachment_url );
    	// BUGFIX: URL without / as attachment link.
    	$attachment_url = str_replace("bp-attachments", "bp-attachments/", $attachment_url);
    
    	if ( 'full' === $format ) {
    		$attachment_delete_html = '';

    This will fix the link problem.

  4. tbar_uk
    Member
    Posted 5 months ago #

    While you're there you may want to change the doc to open in another tab on the browser. Update line 1953 to:

    '<li id="doc-attachment-%d"><span class="doc-attachment-mime-icon doc-attachment-mime-%s"></span><a href="%s" title="%s" target="_blank">%s</a>%s</li>',

  5. tbar_uk
    Member
    Posted 5 months ago #

    It appears off the bat to fix it but I haven't ran with the fix for any length of time as yet. Please let me know how you get on with it. If you need any help let me know here.

  6. Roquefort
    Member
    Posted 5 months ago #

    The newest 1.6.0 update to BP-Docs fixed my problem! Just figured I'd post back here and let everyone know.

  7. tbar_uk
    Member
    Posted 5 months ago #

    Thanks Roquefort - great plugin.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.