Opened 15 years ago
Closed 15 years ago
#1461 closed defect (bug) (fixed)
Not Playing Well With Multisite
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.0 | Priority: | high |
| Severity: | major | Version: | |
| Component: | API - Installation/Upgrade | Keywords: | |
| Cc: | wordpress@…, nacin, gautam.2011@…, nightgunner5@… |
Description
Steps to reproduce:
- 1. Setup a fresh install of Multisite.
- 2. Go and add another site,
/support/or/whatever/ - 3. Upload the bbPress Plugin to the
/wp-content/directory. - 4. Now activate on site in Step 2 only!
- 5. On visiting
themes.phpto activate the Child Theme, told there is only 1 Theme enabled, and a visit to the Network Admin is required. - 6. You expect the
/bbp-twentyten/to appear onhttp://localhost/wp-admin/network/site-themes.php?id=2so you can activate it there, but it doesn't show, yet the bbPress Plugin is active and working away. - 7. So deactivating on site in Step 2, and activating on the main site, and going through Step 5, you get the theme appearing on
http://localhost/wp-admin/network/site-themes.php?id=1unlike you did in Step 6. - 8. And until the theme is activated/enabled somewhere, it'll not show up for said site in Step 2 either.
Now granted, this could (and most likely is) a WordPress (3.1 as it stands) error, which will need to be looked at. But it'd be great if someone else could reproduce the error I'm seeing! :)
Change History (16)
#1
in reply to:
↑ description
@
15 years ago
#2
@
15 years ago
Ok, I've not used or seen the code for the bbPress plugin, so my take on this:
- The plugin registers the theme when the plugin is activated (through the WP API)
- Multisite requires themes be set as Allowed for individual sites
- As the plugin is only activated for Site 2:
- The Network admin (running as the main blog) Is not running the bbPress plugin, thus:
- The Network admin is unaware of the extra theme the plugin is adding.
In this case, For a multisite installation, This sounds like something that the site administrator should copy the default theme to the themes directory..
Either that, Or part of the bbPress plugin should be activated for the main blog (So, Perhaps it should be a Network plugin? ie. activated network wide) in order for the network admin dashboard to be aware of it, and so it can set the administrative options of bbPress on the network (ie. not all network administrators will trust all the individual site owners, and will want to/need to disable certain functions possibly? - file uploads or something?)
#4
@
15 years ago
Since the bundled theme needs to be registered as part of the plugin, it's a bit of a catch 22. In this circumstance, it's a matter of site administrator choice and preference. The UX is a bit wonky, but it's working the only way that it should given the context.
I.E. - If I am the site administrator, I have already installed the bbPress plugin on my network, and hoepfully already activated the bp-twentyten theme to be used. If you are the site user, you can't install plugins on your own. If you activate bbPress and bp-twentyten hasn't been enabled by me, that's me being a bad site administrator.
The alternative would be to circumvent the WordPress Network theme check and force bp-twentyten into the available themes list, but I'm not convinced that's the safest thing to do either.
What Dion proposed in terms of activating the plugin at the Network level just means each site can now have their own forum, which won't do any good until any bbPress compatible theme is activated by the site admin.
Am I following this correctly, and does my response make sense?
#5
follow-up:
↓ 9
@
15 years ago
What Dion proposed in terms of activating the plugin at the Network level just means each site can now have their own forum, which won't do any good until any bbPress compatible theme is activated by the site admin.
If it was activated at the network level, It would allow the bundled theme to be visible in the network theme picker is my thinking. But that might not be the best way to go thanks to then it being enabled for every site like you say.
The question comes down to, Is having Multisite installations specifically add the theme to their theme directory such a bad thing?
(This ticket was mentioned in #wordpress-dev, which is why I've commented on this btw)
#6
@
15 years ago
Happy to have you peeking about. :)
I'll do some more testing in multisite and dream up a solution. It sounds like the behavior changed between 3.0 and 3.1 on how themes are added to the network admin? In 3.0 you could access the network admin from any site, so the network themes would adjust on the fly. It sounds like in 3.1 the themes are in the new network admin, so that glitch is technically now fixed?
#7
@
15 years ago
It sounds like in 3.1 the themes are in the new network admin, so that glitch is technically now fixed?
I tried not to touch the multisite functionality in 3.0, so not 100% on how it worked. However, 3.1 has brought with it the separate network and user dashboards for multisite, So pretty sure that's whats happening here.
#8
@
15 years ago
Yep, Network Activating the plugin will allow you to enable the theme for individual sites, But otherwise, the Network admin is based off the main blog, and inherit's its plugins, even if you try to access /wp-admin/network/ on the subsite it redirects to the main one.
#9
in reply to:
↑ 5
@
15 years ago
Replying to dd32:
(This ticket was mentioned in #wordpress-dev, which is why I've commented on this btw)
That was me, I'll hold my hands up for it! ;)
Reading through what's been said, it looks to me (I could be wrong?) that there is a *possible* problem between register_theme_directory(); and it registering on Site 2 created in Step 2. Registering (and showing) a theme should well, register (and show) the theme in the appropriate place(s) yes/no? -- Is this looking like a bbPress Plugin thing, or a WordPress thing, or a little bit of both?
#10
@
15 years ago
I tried another fresh install, but still encountered the same problem as outlined in the main description above. If this *is* a WordPress 3.1 problem, or something that it could potentially solve, then the quicker it can be tested and (hopefully) patched.
All I can do here is help test, I wouldn't know where to start?!
#11
follow-up:
↓ 12
@
15 years ago
- Cc nacin added
Spoke about this with a few different individuals (johnjamesjacoby, dd32, and markjaquith.) Rough conclusions:
It was indeed our network admin change in 3.1 that broke the ability to do this. We now force the network admin through the main site. We think the benefits here outweigh the cons.
The dirtiest workaround is to activate the plugin on the main site, then allow the theme for the subsite, then deactivate the plugin. That is very janky, and doesn't help registered sites that want to opt into a plugin. (Better solutions coming up, don't worry.)
Theme root registrations are a very narrow use case. We can't think of anything else in the network admin that would be quite as affected. We're okay with breaking this, despite it being more difficult for single-site plugins to support multisite out of the box.
Unfortunately, there's not a hidden thing anywhere in the network admin that allows you to alter or override allowed themes without the theme root actually being registered. Again, that's okay.
The best solution is the plugin actually forcing the theme to be allowed, everywhere. This makes the most sense in the context of registered sites that may wish to opt-in to bbPress, for example. Anyone offering their own bbPress theme can work around this, perhaps with a filter. It should be noted this should probably only even occur when it isn't network activated, unless of course by network activation it's not activating in a network-like mode, but rather so there are individual forums on each site. (I have no idea how that works here. I imagine a network-like mode would simply be the main site, but I digress.)
To do this, we'll want to filter the output of get_allowed_themes(). I can circle back around in a few days if someone doesn't write a patch for this. Anyway, the technique would be to probably just inject it through the allowed_themes filter in get_allowed_themes(). There are other lower level option filters but this is the good one to leverage.
#12
in reply to:
↑ 11
@
15 years ago
Replying to nacin:
It was indeed our network admin change in 3.1 that broke the ability to do this. We now force the network admin through the main site. We think the benefits here outweigh the cons.
Reading that I'd initially disagree, but I'll take your word for it, who am I to question developers on the way things are coded (I couldn't code a barn door if I tried!) So thinking about it, this could span back to a another issue we had in #1358 to do with 3.1, and they may be somewhat related?
The dirtiest workaround is to activate the plugin on the main site, then allow the theme for the subsite, then deactivate the plugin. That is very janky, and doesn't help registered sites that want to opt into a plugin. (Better solutions coming up, don't worry.)
Yeah, dirty alright, imagine explaining that to potential users. :P
Theme root registrations are a very narrow use case. We can't think of anything else in the network admin that would be quite as affected. We're okay with breaking this, despite it being more difficult for single-site plugins to support multisite out of the box.
Maybe a fair enough point that registering the theme root are a very narrow use case, but it was added to WordPress (whenever) for developers to utilise so you could define where to find particular themes. I feel that the option is there, but the developer is going to have to jump over a (small) hurdle to achieve a similar sort of result they were expecting?
Unfortunately, there's not a hidden thing anywhere in the network admin that allows you to alter or override allowed themes without the theme root actually being registered. Again, that's okay.
Maybe that's an enhancement for another version, but kept inside register_theme_directory(); cause it looks (to an outsider) like you're taking a step back in the development of this little area.
The best solution is the plugin actually forcing the theme to be allowed, everywhere. This makes the most sense in the context of registered sites that may wish to opt-in to bbPress, for example. Anyone offering their own bbPress theme can work around this, perhaps with a filter.
Possibly not IMO, but in the case that it'll "sort" the problem then it'll have to be done like that?
It should be noted this should probably only even occur when it isn't network activated, unless of course by network activation it's not activating in a network-like mode, but rather so there are individual forums on each site. (I have no idea how that works here. I imagine a network-like mode would simply be the main site, but I digress.)
When you Network Activate the plugin, it'll give you individual forums on each site, I don't believe we have a network-like mode (although I do like the idea, but you couldn't specify that it had to be the main site either IMO?)
To do this, we'll want to filter the output of get_allowed_themes(). I can circle back around in a few days if someone doesn't write a patch for this. Anyway, the technique would be to probably just inject it through the allowed_themes filter in get_allowed_themes(). There are other lower level option filters but this is the good one to leverage.
I'd have to read up on where to start, but I'll gladly test anything that's uploaded! :)
#13
@
15 years ago
So thinking about it, this could span back to a another issue we had in #1358 to do with 3.1, and they may be somewhat related?
Unrelated, But I've run into that before, And I hope I've already raised a ticket or already fixed it..
Replying to markmcwilliams:
For the above, I obviously meant
/wp-content/plugins/before anyone says anything about me uploading in into the wrong place or that!