boonebgorges / buddypress-docs

GNU General Public License v3.0
106 stars 44 forks source link

BP 12.0 compatibility #727

Closed boonebgorges closed 7 months ago

boonebgorges commented 8 months ago

We need to be compatible with BuddyPress 12.0, while still maintaining backward compatibility with older versions of BP.

The main task here is URL concatenation, which needs to use the new Rewrite tools. See https://github.com/boonebgorges/buddypress-group-email-subscription/issues/242 for an overview of this process, along with links to a tool for ensuring compatibility with BP 11.x and lower.

There may also be some necessary changes related to the way that the group extension and component are registered. In some places this may be related to rewrites. BP 12.0 also changes the BP bootstrap in such a way that certain globals aren't available as early, so this could also require changes.

boonebgorges commented 8 months ago

URL concatenation in Docs is confusing because of the long-ago switch from viewing Docs within groups to viewing them on the CPT single pages, where rewrites are already fully supported. It will take me some time to pick everything apart.

boonebgorges commented 8 months ago

There may also be some necessary changes related to the way that the group extension and component are registered. In some places this may be related to rewrites. BP 12.0 also changes the BP bootstrap in such a way that certain globals aren't available as early, so this could also require changes.

As suspected, the way that we set up the 'currrent_view' and 'item_type' globals happens too early. We need to wait for bp_parse_query. This hook only becomes available in BP 1.7.0, so we have to drop support for earlier versions of BuddyPress.

dcavins commented 8 months ago

Thanks for thinking about this, Boone. I was hoping to get to it before you, but you are way ahead of me. BP 1.7 and up should cover the vast majority of active sites. (1.7 "Totonno" was released ten years ago, which is hard to believe.)

boonebgorges commented 8 months ago

I've got a first pass at this so I'm going to merge into the 2.2.x branch for testing as we continue on 2.2.0 development.

boonebgorges commented 7 months ago

I've done another round of testing and I think things are working well on BP < 12 and BP 12+. Seeing as the scheduled BP release is several days away, let's get this out in the world.