Skip to:

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2613 closed defect (bug) (invalid)

Not a bug: bbPress 2.5.4 fails to load bbpress.css and editor.js

Reported by: neosnc's profile Neosnc Owned by:
Milestone: Priority: lowest
Severity: trivial Version: 2.5.4
Component: Tools - Code Improvements Keywords:


On Windows depending on your path, bbPress 2.5.4 fails to load it's css or editor.js. The problem stems from the path being returned with two breaking the $content_dir value for windows.

This is relevant to a recent fix (ticket 2518) updating $content_dir to use WP_CONTENT_DIR. Ticket 2518 corrects for unix style paths but not Windows paths.

I posted about this issue in the forums in May but it looks like it didn't make it into this 2.5.4 version.

Chrome console error shows

GET http://localhost/wp-at/wordpressC:/ProgramFiles/wamp/www/wp-at/wp-content/plugins/bbpress/templates/default/css/bbpress.css?ver=2.5.4-5380 403 (Forbidden) localhost/:28
GET http://localhost/wp-at/wordpressC:/ProgramFiles/wamp/www/wp-at/wp-content/plugins/bbpress/templates/default/js/editor.js?ver=2.5.4-5380 403 (Forbidden)

How to reproduce:
Install WordPress and bbPress on Windows in the Windows Program Files folder.

Line 168 & 237 of template-functions.php added this to correct for double Windows path slashes:
$content_dir = str_replace( '', '/', $content_dir );

Attachments (1)

bbPress_windows_path_fix_template-functions.php.patch (837 bytes) - added by Neosnc 10 years ago.
Windows path fix for bbpress.css and editor.js

Download all attachments as: .zip

Change History (5)

10 years ago

Windows path fix for bbpress.css and editor.js

#1 @netweb
10 years ago

Neosnc, thanks for the ticket and patch though I cannot reproduce your issue.

Per the screenshot here I replicated your environment installing WordPress 3.9.1 and bbPress 2.5.4 C:\ProgramData\wamp\www\wp-at\ using XAMPP and everything appears fine.

How do you have your Apache virtual host configured?

Windows \\ back slashes are already replaced with a / forward slash at #L161 and #L231

Essentially your patch is replacing two forward slashes // with a single forward slash / so I am thinking somewhere in your configuration you have an extra / that is not required.

#2 @Neosnc
10 years ago

  • Keywords close added; has-patch removed
  • Milestone Awaiting Review deleted
  • Priority changed from high to lowest
  • Resolution set to invalid
  • Severity changed from normal to trivial
  • Status changed from new to closed
  • Summary changed from bbPress 2.5.4 fails to load bbpress.css and editor.js to Not a bug: bbPress 2.5.4 fails to load bbpress.css and editor.js

Netweb, ahh it looks like you are correct.

My apache document root was DocumentRoot "C:/Program Files/wamp/www/" and <Directory "C:/Program Files/wamp/www/">

Taking off the trailing slash does work with bbPress.css and editor.js loading correctly. Apache was working to serve pages so I guess I hadn't noticed that it was misconfigured.

Sorry for the false alarm, thanks for taking a look and testing the issue. I'll try to update the ticket to not a bug.

Last edited 10 years ago by Neosnc (previous) (diff)

#3 @netweb
10 years ago

  • Keywords close removed

Cool, glad you are sorted.

p.s. Even though your patch wasn't needed it was perfect in terms of how we like submitted patches formatted :)

#4 @Neosnc
10 years ago

Thank you Netweb! It was interesting and very straight forward to to setup. I hope to contribute more applicably in the future. I'll be using bbPress heavily in my current audio community site project.

Note: See TracTickets for help on using tickets.