Opened 15 months ago
Closed 15 months ago
#8936 closed defect (bug) (fixed)
Warning: Attempt to read property in bp-core-buddybar.php
Reported by: | corzel | Owned by: | imath |
---|---|---|---|
Milestone: | 12.0.0 | Priority: | high |
Severity: | major | Version: | 1.1 |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
BuddyPress 11.2.0, WordPress 6.2.2, BP Theme Legacy, PHP 8.1.18
Warning: Attempt to read property "link" on null in /*/public_html/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php on line 370
Warning: Attempt to read property "slug" on null in /*/public_html/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php on line 370
Change History (4)
#1
@
15 months ago
- Milestone changed from Awaiting Review to 12.0.0
- Version changed from 11.2.0 to 1.1
#2
@
15 months ago
- Priority changed from normal to high
- Severity changed from normal to major
This bug revealed a more severe issue with the BP Rewrites API when plain permalinks are used. In this case we absolutely need to set the buddypress()->unfiltered_uri
global according to the $GLOBALS['wp']->query_string
instead of the $GLOBALS['wp']->request
, otherwise bp_core_new_nav_default()
redirects all sub navs to the default one.
This ticket was mentioned in PR #130 on buddypress/buddypress by @imath.
15 months ago
#3
- Keywords has-patch added
- In case plain permalinks are used, use the
$GLOBALS['wp']->query_string
to set thebuddypress()->unfiltered_uri
global. - No need to edit sub nav links when calling
bp_core_new_nav_default()
if the URL parser is set to'rewrites'
(default one since 12.0.0). - Finally reply to the original issue raised by the contributor making sure to avoid a notice if the new subnav object misses the slug and/or the link properties.
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8936
+
bp_core_new_nav_default()
should be checked when using the BP Rewrites API.