Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#7307 closed defect (bug) (fixed)

Loading deprecated code

Reported by: DJPaul Owned by: boonebgorges
Milestone: 2.8.1 Priority: high
Severity: normal Version: 2.7
Component: Core Keywords: has-patch
Cc:

Description

In 2.7 with #6839, we stopped loading bp-core/deprecated/* for new installs. It's only meant to load for existing sites (updates).

A forum report at https://buddypress.org/support/topic/call-to-undefined-function-bp_blogs_get_subdomain_base/#post-260338 detailed an old theme (Kleo) calling a 2.1-deprecated. I don't know yet why the deprecated files are not being loaded on an existing site (maybe they are and the root cause is something else), but we need to check on that behaviour.

As a result of looking at that, we still have at least a few functions in those deprecated files still being loaded. For example, grep for bp_blogs_subdomain_base and bp_blogs_get_subdomain_base. There may be others.

Attachments (1)

7307.01.patch (2.5 KB) - added by r-a-y 3 years ago.

Download all attachments as: .zip

Change History (16)

#1 follow-up: @DJPaul
3 years ago

I want to revert r11105 for 2.7 branch and leave the ticket open to investigate, correct, and fix things in trunk for 2.8. Thoughts?

#2 in reply to: ↑ 1 @boonebgorges
3 years ago

Replying to DJPaul:

I want to revert r11105 for 2.7 branch and leave the ticket open to investigate, correct, and fix things in trunk for 2.8. Thoughts?

This seems wise to me.

This ticket was mentioned in Slack in #buddypress by djpaul. View the logs.


3 years ago

#4 @djpaul
3 years ago

In 11214:

Core: partial revert of r11105 to restore pre-2.7 deprecated code loading behaviour.

This needs more work, so we'll revisit for BP 2.8.

See #7307

#5 @johnjamesjacoby
3 years ago

In 11232:

Loader: Make sure deprecated code is loaded unless explicitly ignored.

See: #7307, #7323, #7322. For 2.7 branch.

#6 @johnjamesjacoby
3 years ago

In 11233:

Loader: Make sure deprecated code is ignored unless explicitly defined to be included.

Also deprecate the BP_IGNORE_DEPRECATED constant, since this is now an option. (We'll still obey it if it's set later.)

See: #7307, #7323, #7322. For trunk.

#7 @johnjamesjacoby
3 years ago

  • Keywords needs-patch added
  • Version set to 2.7

#8 @johnjamesjacoby
3 years ago

In 11236:

Deprecation: Move the bp_get_option() check down into a place where the function is actually available.

Unbreaks trunk from r11233. See #7307.

#9 @DJPaul
3 years ago

  • Milestone changed from 2.8 to Future Release

#10 @r-a-y
3 years ago

  • Milestone changed from Future Release to 2.8.1
  • Priority changed from normal to high

Just got a user report about deprecated code not being loaded due to deprecated functions being called from the Blogs component:
https://buddypress.org/support/topic/v2-8-undefined-function-in-mu-when-creating-site/

To duplicate, set up a new subdomain multisite install on a fresh BuddyPress instance. Next, navigate to example.com/blogs/create/ and you'll see the fatal error since we no longer load deprecated code on new BP installs.

This is important to fix, so I'm moving this to the 2.8.1 milestone.

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

#11 @DJPaul
3 years ago

I am pretty sure we totally unhooked this logic back in 2.7.x

@r-a-y
3 years ago

#12 @r-a-y
3 years ago

  • Keywords has-patch added; needs-patch removed

01.patch fixes the deprecated blog function call and also loads up the deprecated BuddyBar code if a BP install has chosen to force-enable the BuddyBar, but is not loading deprecated code via the BP_IGNORE_DEPRECATED constant or a filter.

We have to do the latter since we still reference the BuddyBar in core.

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

This ticket was mentioned in Slack in #buddypress by boone. View the logs.


3 years ago

#14 @boonebgorges
3 years ago

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

In 11442:

Ensure that deprecated code is available when required.

  • Avoid calling a deprecated bp-blogs function when a non-deprecated version is available.
  • Ensure that legacy BuddyBar code is loaded when the BuddyBar is forced on.

Props r-a-y.
Fixes #7307.

#15 @boonebgorges
3 years ago

In 11443:

Ensure that deprecated code is available when required.

  • Avoid calling a deprecated bp-blogs function when a non-deprecated version is available.
  • Ensure that legacy BuddyBar code is loaded when the BuddyBar is forced on.

Ports [11442] to the 2.8 branch.

Props r-a-y.
Fixes #7307.

Note: See TracTickets for help on using tickets.