Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

#4397 closed defect (bug) (fixed)

Cannot uninstall "Forums for Groups"

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: 1.7 Priority: normal
Severity: major Version: 1.5
Component: Administration Keywords: has-patch commit
Cc:

Description

While I was testing out bbPress 2.0 integration with BuddyPress, I encountered this bug.

Steps to reproduce:

  1. If you haven't already, install group forums under the "BuddyPress > Forums" admin page.
  2. Now, navigate back to the "BuddyPress > Forums" page and uninstall group forums. This will show the intended behavior.
  3. But now, refresh the "BuddyPress > Forums" admin page. It will show that "Forums for Groups" are still installed.

The problem occurs because BP always tries to autopopulate the 'bb-config-location' meta key here:
http://buddypress.trac.wordpress.org/browser/tags/1.6-RC2/bp-core/bp-core-options.php#L31

Removing that line works, but I'm not sure what unintended consequences will happen.

Attachments (1)

4397.01.patch (1.6 KB) - added by r-a-y 12 years ago.

Download all attachments as: .zip

Change History (17)

#1 @r-a-y
12 years ago

  • Version changed from 1.6-beta to 1.6

#2 @boonebgorges
12 years ago

  • Keywords 2nd-opinion added

The reason for introducing the autopopulated 'bb-config-location' value is explained here: http://buddypress.trac.wordpress.org/ticket/3677

The saga behind the "Uninstall Group Forums" button is here: http://buddypress.trac.wordpress.org/ticket/4004

In #4004, it looks like the decision was made (and the change committed) to change "Uninstall Group Forums" to "Reinstall Group Forums". But then, in r6108, when I was doing some bbPress-related admin cleanup, I accidentally reverted this change.

I'm of the same opinion as I was starting here http://buddypress.trac.wordpress.org/ticket/4004#comment:4, namely that group forum uninstallation is kind of pointless anyway, so we shouldn't go to a lot of trouble to support it.

That said, it does seem strange to simply change the text to 'Reinstall', as the button doesn't do much of anything at all, as it stands. I suppose we could make it delete bb-config.php, but to what end?

#3 @r-a-y
12 years ago

In order for bbPress 2.0 and BuddyPress group integration to work well, it's better to uninstall "Forums for Groups".

Since the 'bb-config-location' value gets autopopulated (which gets used in bp_forums_is_installed_correctly(), which in turn is used in some other display logic), it's hard to disable old bbPress entirely.

Perhaps we should remove bb-config.php when you click on the group forums uninstall button and do a file_exists check in bp_get_default_options()?

---

Update: bp_forums_is_installed_correctly() already does a is_file() check, so perhaps remove the bb-config file when group forums are uninstalled?

Last edited 12 years ago by r-a-y (previous) (diff)

#4 @boonebgorges
12 years ago

  • Keywords dev-feedback 2nd-opinion removed
  • Milestone changed from Awaiting Review to 1.6.1

so perhaps remove the bb-config file when group forums are uninstalled?

I don't have a problem with this, since it's easy enough to regenerate. r-a-y, would you work up a patch? Put class="confirm" on that button, if you wouldn't mind.

#5 @r-a-y
12 years ago

Adding the "confirm" class does not bring up a javascript prompt because bp_core_confirmation_js() is only loaded on "wp_head". Did you want to add this inline JS on "admin_head" as well?

#6 @boonebgorges
12 years ago

D'oh, I thought that was a WP core thing. Um, yeah, I guess load it on admin_head. I just want to make sure that if we're deleting a config file, we give sufficient warning for misclicks.

@r-a-y
12 years ago

#7 @r-a-y
12 years ago

  • Keywords has-patch added; needs-patch removed

Attached patch removes the bb-config.php file when group forums are uninstalled and also hooks bp_core_confirmation_js() to "admin_head" only if we're not in BP maintenance mode.

Let me know if anything needs to be revised!

#8 @DJPaul
12 years ago

I don't want this file deleted with the existing button in 1.6.1. I would rather wait until we finish up the bbPress 2 integration so we can do all that in one go: install/activate bbPress plugin, migrate the content, then tidy up any bbPress 1 stuff (bb-config.php, and the caps/roles).

#9 follow-up: @boonebgorges
12 years ago

I don't want this file deleted with the existing button in 1.6.1.

Why not?

I fear that any other solution is going to be overly complicated (removing default values, etc).

#10 in reply to: ↑ 9 @DJPaul
12 years ago

Replying to boonebgorges:

Why not?

Because that button has been functionally identical since 1.5, so we change it in a major release. Minor releases should be for urgent bug fixes or compatibility fixes.

#11 @boonebgorges
12 years ago

r-a-y, is it indeed the case that this button has been functionally identical since 1.5?

#12 @r-a-y
12 years ago

  • Version changed from 1.6 to 1.5

Just tested in BP 1.5.7 and I can confirm that Paul is right.

I guess for now I can apply my patch locally or just remove bb-config.php manually so I can test bbPress 2.0 integration with BuddyPress Groups.

#13 @boonebgorges
12 years ago

  • Milestone changed from 1.6.1 to 1.7

OK. In light of this, let's push this to 1.7. Thanks for your patience, r-a-y.

#14 @DJPaul
12 years ago

  • Keywords commit added

Are we agreed to go ahead with this patch? Looks good to me.

#15 @boonebgorges
12 years ago

Looks good to me too.

#16 @djpaul
12 years ago

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

(In [6357]) Remove the bb-config.php file when group forums are uninstalled. Fixes #4397, props r-a-y

This change helps tidy up bbPress 1.x remnants when group forums are uninstalled. As this file
is automatically generated when bbPress 1.x group forums are installed, a user can reactivate the
old group forums and we'll rebuild the bb-config.php for them.

Note: See TracTickets for help on using tickets.