[buddypress-trac] [BuddyPress] #3480: Upgrade from 1.2.9 to 1.5 breaks profile page, causes permanent redirect to site homepage
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Tue Aug 16 16:23:39 UTC 2011
#3480: Upgrade from 1.2.9 to 1.5 breaks profile page, causes permanent redirect to
site homepage
-----------------------+------------------
Reporter: foxly | Owner:
Type: defect | Status: new
Priority: critical | Milestone: 1.5
Component: Core | Version: 1.5
Severity: critical | Resolution:
Keywords: has-patch |
-----------------------+------------------
Changes (by boonebgorges):
* keywords: => has-patch
Comment:
I spent some time digging into the issue this morning. It's fairly
complicated, but a workable fix is easy. Here's the summary of the
problem, for those interested.
- When you visit a member profile and you haven't overridden
BP_DEFAULT_COMPONENT, $bp->current_component is set to 'activity' (as long
as 'activity' and 'xprofile' are both active)
- In order for this to work correctly, the components must load in the
correct order. In particular, it looks like xprofile has to load before
activity, though I didn't do enough testing to be positive that this is
the pair that really matters.
- On a fresh BP installation, this sorting happens automatically during
the installation process (because of the order in which the components are
listed during the installation wizard).
- However, on an upgrade, the components step in the wizard is skipped,
under the assumption that this information does not need to be filled in
again.
- That means that $bp->active_components gets filled in by some code in
bp-core-loader, which orders the active components array according to the
optional_components array, which is alphabetical. Moreover, the script in
bp-core-loader.php doesn't save the array to bp-active-components, so the
mistake keeps happening (otherwise it would get corrected by the
array_flip on bp-active-components).
So...
My solution is to reintroduce the Components step of the wizard. That also
means doing a bit of logic inside of bp_core_admin_component_options() to
convert bp-deactivated-components (the 1.2.9 setting) into
active_components. This solves the problem, and plus I think it's kinda
nice to be reminded of the components during an upgrade anyway, so it's
not a big UI loss (I'd argue it's a gain).
Please test 3480.01.patch!
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3480#comment:17>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list