Opened 3 years ago
Closed 3 years ago
#8936 closed defect (bug) (fixed)
Warning: Attempt to read property in bp-core-buddybar.php
| Reported by: | corzel | Owned by: | imath |
|---|---|---|---|
| Priority: | high | Milestone: | 12.0.0 |
| Component: | Core | Version: | 1.1 |
| Severity: | major | 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)
#2
@
3 years ago
- Priority normal → high
- Severity normal → 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.
3 years ago
#3
- Keywords has-patch added
- In case plain permalinks are used, use the
$GLOBALS['wp']->query_stringto set thebuddypress()->unfiltered_uriglobal. - 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
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
+
bp_core_new_nav_default()should be checked when using the BP Rewrites API.