Skip to:
Content

bbPress.org

Opened 11 years ago

Closed 11 years ago

#1334 closed defect (bug) (duplicate)

Template issues when activating the child theme from within the plugin

Reported by: elfin Owned by:
Milestone: 2.0 Priority: normal
Severity: normal Version:
Component: API - Installation/Upgrade Keywords:
Cc: elfin@…

Description

default templates do not appear in the template menu for pages

theme is completely lost on the front end as it is trying to locate the theme inside the standard theme directory.

temp fix is to copy the bbp-twentyten directory to the themes directory

Change History (44)

#1 @johnjamesjacoby
11 years ago

Need more info as I can't duplicate this. bbp-twentyten works fine provided it is the currently active theme on your site.

#2 @elfin
11 years ago

  • Cc elfin@… added

After a lot of testing today I'm still no closer to resolving why it is happening.

It does not happen on my webhosting, but is happening on my local server. running on win7 EasyPhp - which works for everything bar this theme issue.

Any tips on how to solve or even debug to find where the issue is would be welcomed.

#3 @johnjamesjacoby
11 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Running it via Windows 7 Ultimate on IIS7 and no issues. Also works on my Mac local, and Linux hosting too.

Going to mark as invalid and recommend you ask in the forums to get more traction and feedback.

If it ends up being an issue with bbPress, go ahead and reopen this ticket.

#4 @elfin
11 years ago

yep will do, I'll also try and trace through things again when I get chance.

#5 @elfin
11 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

reopening as I've identified the issue.

basically windows 7, and possibly before, doesn't like double / in directory paths so I was getting something like:

E:\htdocs\wpcurrent\wp-content\plugins\bbpress//bbp-themes

which was failing and causing issues all round.

Now an easy'ish fix for this is to change wp-loader.php line 125'ish, which is currently:

// Themes directory and url
define( 'BBP_THEMES_DIR',  BBP_DIR.'/bbp-themes' );
define( 'BBP_THEMES_URL',  BBP_URL.'/bbp-themes' );

and change it to this:

// Themes directory and url
define( 'BBP_THEMES_DIR',  BBP_DIR.'bbp-themes' );
define( 'BBP_THEMES_URL',  BBP_URL.'bbp-themes' );

This appears to work for me both locally and on my web host. But will obviously need testing elsewhere.

#6 @markmcwilliams
11 years ago

I have a rough idea what you're talking about, seen it myself on my local install, I'll try and debug the issue (or at least take a look) later on though, time I should be in bed! :) And see about a bit of testing too, might as well try and help somehow? ;)

#7 follow-up: @johnjamesjacoby
11 years ago

Confirmed. Will fix soon. Good eye!

#8 @elfin
11 years ago

excellent! it means I wasn't going mad after all. I had been coming to the conclusion it was a WordPress issue, then I posted on the hackers list and I had a sudden flash of inspiration.

#9 in reply to: ↑ 7 @markmcwilliams
11 years ago

Replying to johnjamesjacoby:

Confirmed. Will fix soon. Good eye!

Glad I wasn't going blind, or seeing things too! :) I'd never got a chance of looking into it or that anyway, but I was going to look into the BuddyPress setup and see what looked different! ;) Guess the same logic/idea would be behind both, with the way they register themes for the job.

#10 follow-up: @elfin
11 years ago

Not quite the same, BuddyPress has a full theme, bbPress has a child theme.

#11 in reply to: ↑ 10 @markmcwilliams
11 years ago

Replying to elfin:

Not quite the same, BuddyPress has a full theme, bbPress has a child theme.

Still has to register a theme/directory to look for though! :)

#12 @markmcwilliams
11 years ago

So I got round to finally playing with this problem, and the only (simple) solution I came up with was to remove the / on all instances of BBP_DIR and/or BBP_URL like elfin said above which does work!

I found #WP9779 which talks about an inconsistency on the very subject!

And on a related sidenote, BP suffers from all this too, so it would fail if installed in a different folder too (suppose I could take a look over it fully, and provide a patch?!) // End Sidenote ;)

Last edited 11 years ago by markmcwilliams (previous) (diff)

#13 @johnjamesjacoby
11 years ago

Fixed in r2596. Please reopen if it reappears.

#14 @johnjamesjacoby
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

#15 follow-up: @markmcwilliams
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I'm finding that unless I copy the /bbp-twentyten/ folder over to /wp-content/themes/ the whole site doesn't display as it should, almost as if the site doesn't have any graphics or CSS attached to it?! While it does register the theme as being there in /bbp-templates/ it's not fully working!

Plus another problem being that I can't use the Custom Page Templates either unless I have the /bbp-twentyten/ folder in /wp-content/themes/ too, it's as if something doesn't function and/or work, but as I said, the theme is still registered ... ???

#16 in reply to: ↑ 15 ; follow-up: @GautamGupta
11 years ago

Replying to markmcwilliams:

I'm finding that unless I copy the /bbp-twentyten/ folder over to /wp-content/themes/ the whole site doesn't display as it should, almost as if the site doesn't have any graphics or CSS attached to it?! While it does register the theme as being there in /bbp-templates/ it's not fully working!

Plus another problem being that I can't use the Custom Page Templates either unless I have the /bbp-twentyten/ folder in /wp-content/themes/ too, it's as if something doesn't function and/or work, but as I said, the theme is still registered ... ???

Can you please check if the CSS is getting included on the page? Anf if it is, then check if the whole plugin folder is chmodded to 755 or not.

#17 @elfin
11 years ago

still not fixed in the latest release for me.

However I'm waiting for #1357 to be resolved first before attempting the debug process on this.

#18 in reply to: ↑ 16 @markmcwilliams
11 years ago

Replying to GautamGupta:

Can you please check if the CSS is getting included on the page? Anf if it is, then check if the whole plugin folder is chmodded to 755 or not.

I have done everything possible to try and resolve this issue myself before reopening the ticket, and it just so happened JJJ closed it before I'd got round to reporting the problem still being there!

So when /twentyten/ which is the default theme is activated, all looks good, except that's not good enough for bbPress, so on activating /bbp-twentyten/ included in the plugin (which does register as I have said before) loses all the styling from /twentyten/ but also doesn't display any of the /bbp-twentyten/ styling either? -- And like I have also stated, the Custom Page Templates don't appear either, and my local install is no different to a live install ... one's online, the other isn't! :)

I'm guessing it's all 100% working for you yes/no?

Replying to elfin:

still not fixed in the latest release for me.

While the issue of the double // has gone, and been fixed, it's very much still an odd set of issues as a number of people (including me) are getting different results than to others, which really doesn't help JJJ at all, I'll have to go digging!

#19 follow-up: @johnjamesjacoby
11 years ago

Can you view the source of your page and report back what the URL is for the bbp-twentyten theme's style.css?

If you could deactivate the plugin, delete the bbpress directory completely, make sure bbp-twentyten is NOT in your themes directory, redownload and reactivate the plugin, in that order, and let me know what the URL for style.css is, that will give us all a clean slate.

#20 in reply to: ↑ 19 @markmcwilliams
11 years ago

Replying to johnjamesjacoby:

Can you view the source of your page and report back what the URL is for the bbp-twentyten theme's style.css?

As it stands currently /bbp-twentyten/ has been removed from the /themes/ directory and the URL that shows for the stylesheet would be http://localhost/wordpress/support/wp-content/themes/bbp-twentyten/style.css which quite clearly isn't right, as it should be running off the file in the plugin right?

If you could deactivate the plugin, delete the bbpress directory completely, make sure bbp-twentyten is NOT in your themes directory, redownload and reactivate the plugin, in that order, and let me know what the URL for style.css is, that will give us all a clean slate.

So if we do it all in that order, I get the same http://localhost/wordpress/support/wp-content/themes/bbp-twentyten/style.css URL for the stylesheet! (Which would therefore explain why it looks like the sites CSS isn't loading, cause that file or directory doesn't exist!)

#21 @elfin
11 years ago

This was the same issue I had before, and I currently see the same results as mark.

#22 follow-up: @johnjamesjacoby
11 years ago

If you previously had the theme moved from 'bbpress/bbp-themes/' into '/themes' active, then it's still looking there for your theme, that you now removed.

Activate normal twentyten, and then reactivate the bbp-twentyten in the correct location (under bbpress/bbp-themes/) and that should fix this.

#23 @elfin
11 years ago

Sorry, but no change. I'll try and dubug like last time and see if I can find where the issue is.

#24 in reply to: ↑ 22 @markmcwilliams
11 years ago

Yup I already did that before, did it back when I deactivated the plugin and whatnot, so like elfin says too I'm seeing absolutely no change with this issue! :( Likewise, I'll have a look and see what I can find, if anything?

#25 @markmcwilliams
11 years ago

Spent a little while with JJJ tonight on IRC, and we have #1358!

#26 @elfin
11 years ago

I see no difference atm between 3.1 and 3.0.1 the theme still isn't correctly picked up - starting my tests soon.

#27 follow-up: @GautamGupta
11 years ago

  • Summary changed from template issues when activating the child theme from within the plugin to Template issues when activating the child theme from within the plugin

When I upgraded to 3.1, the same happened to me - the theme vanished. But why have 2 tickets for this? Shouldn't we close down #1358?

#28 @elfin
11 years ago

I've got absolutely nowhere this time, will try again later on.

#29 in reply to: ↑ 27 @markmcwilliams
11 years ago

Replying to GautamGupta:

But why have 2 tickets for this? Shouldn't we close down #1358?

Part of the main objective of this ticket has actually been fixed, as in the removal of the // in the URL path, it should have also probably said that 3.0.1 was the version JJJ had been using from the start to get the plugin going, and trying it out on 3.1-alpha might encounter problems! -- Anyway, JJJ told me to open a new ticket on the issue, which is exactly what I did!

Replying to elfin:

I see no difference atm between 3.1 and 3.0.1 the theme still isn't correctly picked up

I setup a whole new test site running 3.0.1 last night while talking to JJJ on IRC and we both looked at the site and all was cool, you can look yourself at http://www.wpkid.com/ and I'm going to take a look into how/why it might not be working on 3.1-alpha properly!

#30 @elfin
11 years ago

I also have it working on my test web hosted site. I just don't have it working on my local Win7 installation in 3.1 or 3.0.1

Last time it seemed to be a double slash that was causing the issue, this time I don't see it.

#31 @elfin
11 years ago

Got part of it. bbpress.php line 88;

$this->file           = __FILE__;

returns: E:\htdocs\wpbeta\wp-content\plugins\bbpress\bbpress.php
However:

$this->file =  WP_CONTENT_DIR . '/plugins/bbpress/bbpress.php';

returns: E:\htdocs\wpbeta/wp-content/plugins/bbpress/bbpress.php

Note the difference \wp-content as opposed to /wp-content

This is causing an issue within get_themes (line 439 of wp-includes/theme.php) where WP_CONTENT_DIR is being replaced by a url.

however this alone does not fix things, still investigating.

#32 @markmcwilliams
11 years ago

I mentioned in #1358 about it being a WordPress issue, and how I'd been speaking to Ryan Boren all about it, which led to him making [WP16424] and while I couldn't get my local copy functioning fully (for whatever reason) I setup http://www.wpkid.com/trunk/ -- Not fully running the latest trunk, but does include that change, and also the latest bbPress, which as you'll see functions and works great! :)

#33 @elfin
11 years ago

ahh, now I see. I'll wait until tomorrow and see if that is in the nightlies (no reason why it shouldn't) and I'll test again.

#34 @elfin
11 years ago

The changes to trunk combined with my suggested change above fix the issue for me. Without the change to $this->file I still have the same problem.

Last edited 11 years ago by elfin (previous) (diff)

#35 follow-up: @elfin
11 years ago

I've posted to wp-hackers about the issue to see if it is a bug.

#36 in reply to: ↑ 35 @markmcwilliams
11 years ago

Replying to elfin:

I've posted to wp-hackers about the issue to see if it is a bug.

I can speak to Ryan Boren again if it's still not fixed at the WordPress end, although I spoke to JJJ again last night to tell him I'd been speaking to Ryan and how he'd made [WP16424] which would appear to have sorted the issue when you take it to a live site! (As in my example above, it works great online!)

But I found a reason why it'll not show the site properly on a local environment, and that's due to the stylesheet URL looking for http://localhost/wpdemo/wp-content/C:\xampp\htdocs\wpdemo\wp-content\plugins\bbpress/bbp-themes/bbp-twentyten/style.css which just doesn't exist. The debate against \ or / shouldn't really matter in my opinion, but I'm guessing thats whats causing the problem on Windows, cause JJJ isn't seeing any problems on his local install (thats assuming he's got a 3.1-alpha running, that I didn't ask!) -- Definitely an odd situation!

I'd suggest if you're running it online, reinstall 3.1-alpha trunk so you've not got any old settings that (as JJJ pointed out to me) will not matter to brand new users, so he might not have cleared them from the DB when coding new bits and moving parts of the plugin around! :) Let me know how it goes?

#37 @elfin
11 years ago

already reinstalled, etc etc.

Must admit to only testing locally in 3.1 alpha guess I should recheck locally with 3
.0.1

Yep, the stylesheet URL issue happens because of get_themes (circa line 439 of wp-includes/theme.php) where therer is a string replace using the WP_CONTENT_DIR, which of course doesn't quite work because of the \ / issue.

After spending another few hours on this today, I'm having a break again - will start afresh tomorrow and see what happens.

#38 follow-up: @elfin
11 years ago

suggest this line:

$this->file           = __FILE__;

is replaced by this line:

$this->file	  = WP_PLUGIN_DIR.'/bbpress/bbpress.php';

Should solve it for everyone then.

#39 in reply to: ↑ 38 @markmcwilliams
11 years ago

I replied to the WP-Hackers list on this but it's to do with #1333 and [2566] ;)

And just making that particular change wouldn't be enough, at least not after my test right now, the likes of $this->plugin_dir = plugin_dir_path( $this->file ); and $this->plugin_url = plugin_dir_url ( $this->file ); will need to have $this->file changed I'd imagine otherwise it'd be classing /bbpress/bbpress.php/bbp-themes/ as the theme directory no?

Plus I'll repeat, it works online, just not locally on Windows! :(

Last edited 11 years ago by markmcwilliams (previous) (diff)

#40 follow-up: @elfin
11 years ago

plugin_dir_path strips bbpress.php from the end.

#41 in reply to: ↑ 40 @markmcwilliams
11 years ago

Replying to elfin:

plugin_dir_path strips bbpress.php from the end.

Well it still threw up a couple of errors on my local copy, on making that small change!

#42 follow-up: @elfin
11 years ago

what sort of errors?

#43 in reply to: ↑ 42 @markmcwilliams
11 years ago

Replying to elfin:

what sort of errors?

Hmm OK the errors I was seeing appear to be from something else I did, but unfortunately this still won't get around the stylesheet URL not working properly, or being able to use any of the 3 Custom Page templates on any of my local installs.

#44 @johnjamesjacoby
11 years ago

  • Resolution set to duplicate
  • Status changed from reopened to closed

See #1358.

Note: See TracTickets for help on using tickets.