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 | Owned by: | 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)
Change History (12)
#2
@
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?
#3
@
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.
#4
@
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
@
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.
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