Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

#8625 closed defect (bug) (fixed)

Legacy widgets disappear in BuddyPress 10.0 even if the theme is using a legacy widget in a sidebar

Reported by: r-a-y's profile r-a-y Owned by: imath's profile imath
Milestone: 10.1.0 Priority: normal
Severity: normal Version: 10.0.0
Component: Core Keywords: has-patch commit
Cc:

Description

Congrats on BuddyPress 10!

We just updated one of our sites to BP 10 and noticed that all the older BuddyPress widgets disappeared from our site after upgrading. This was a little surprising given that the site had about four legacy BuddyPress widgets on the homepage.

It's easy enough to install the Classic Widgets plugin or use a filter to bring them back, but perhaps the bp_core_retain_legacy_widgets() function should check the current theme's sidebar to see if any legacy BuddyPress widgets are active. If there is a legacy widget, we keep loading the legacy widgets?

Or maybe add a documentation note in the release post or codex?

Attachments (3)

8625.01.patch (2.0 KB) - added by r-a-y 3 years ago.
8625.02.patch (2.0 KB) - added by imath 3 years ago.
8625-03.patch (1.9 KB) - added by imath 3 years ago.

Download all attachments as: .zip

Change History (12)

#1 @vapvarun
3 years ago

just added for ref: https://bpdevel.wordpress.com/2022/01/16/legacy-widgets-in-buddypress-10-0-0/
adding ref in codex will also be good

#2 @r-a-y
3 years ago

01.patch takes a more, conservative approach and unregisters any legacy widget that is not active in any of the current theme's widget sidebars.

What does everyone think?

@r-a-y
3 years ago

@imath
3 years ago

#3 @imath
3 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 10.1.0

Hi @r-a-y

Thanks for your report. Too bad we were not able to predict this scenario. Correct me if I'm wrong: to see the issue happen, this means you are using the new Widgets Block Editor, otherwise BP Legacy Widgets would have been loaded.

So, if you are using the new Widgets Block Editor, you can now use the BP Widget Blocks we introduced in 9.0.0, simply by migrating the legacy ones.

The goal of deprecating BP Legacy Widgets is to avoid people who actually migrated to suffer from a bad user experience, see #8594 for more infos about this.

That being said, I agree we shouldn't be that rough. We can be nicer without loading all BP legacy Widgets like your patch is doing. So a good compromise to me, is to carry on loading BP Legacy widgets that have been added to a sidebar (in other words: active).

But I think we need to carry on the deprecation process. Please test the 8625.02.patch to confirm you can still load the BP legacy Widgets that are actives.

About improving our documentation, I totally agree. We'll work on this during the next 4 to 6 months.

Last edited 3 years ago by imath (previous) (diff)

#4 @r-a-y
3 years ago

Correct me if I'm wrong: to see the issue happen, this means you are using the new Widgets Block Editor, otherwise BP Legacy Widgets would have been loaded.

That's correct; block widgets are enabled on the site, but other legacy widgets still work.

So, if you are using the new Widgets Block Editor, you can now use the BP Widget Blocks we introduced in 9.0.0, simply by migrating the legacy ones.

That's true but not many sites will be doing this immediately, especially sites without a dedicated developer or staff. It's great that we offer the ability to convert the older BP legacy widgets over to our newer block widgets though, so +1 there!

But I think we need to carry on the deprecation process. Please test the 8625.02.patch to confirm you can still load the BP legacy Widgets that are actives.

02.patch works, but I'm a little concerned with the usage of error_log(). WordPress Core doesn't use error_log() (apart from the wpdb class and some external libraries) and they are not using it to mark their legacy widgets as deprecated either. I think we can remove the error_log() line and follow whatever WordPress does if they ever decide to get rid of legacy widgets in the future.

#5 @imath
3 years ago

  • Keywords needs-refresh added; dev-feedback has-patch removed

Thanks for your feedback, you're right about error_log(), I guess I wanted so hard to avoid a string change, I made a wrong choice. I'll update the patch using a regular deprecated function.

@imath
3 years ago

#6 @imath
3 years ago

  • Keywords has-patch commit added; needs-refresh removed

Well, I finally think it's too early to throw a deprecation notice. 03.patch is simply removing the error_log() part.

#7 @r-a-y
3 years ago

Looks good, imath! Feel free to commit whenever you are ready.

#8 @imath
3 years ago

In 13228:

Carry on loading a legacy widget if it's active in a sidebar

Props r-a-y, vapvarun

See #8625 (trunk)

#9 @imath
3 years ago

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

In 13229:

Carry on loading a legacy widget if it's active in a sidebar

Props r-a-y, vapvarun

Fixes #8625 (branch 10.0)

Note: See TracTickets for help on using tickets.