Skip to:
Content

BuddyPress.org

#8936 closed defect (bug) (fixed)

Warning: Attempt to read property in bp-core-buddybar.php

Reported by: corzel's profile corzel Owned by: imath's profile 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 @imath
15 months ago

  • Milestone changed from Awaiting Review to 12.0.0
  • Version changed from 11.2.0 to 1.1

+ bp_core_new_nav_default() should be checked when using the BP Rewrites API.

#2 @imath
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 the buddypress()->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

#4 @imath
15 months ago

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

In 13519:

Make sure bp_core_new_nav_default() is ready for the BP Rewrites API

  • In case plain permalinks are used, use the $GLOBALS['wp']->query_string to set the buddypress()->unfiltered_uri global.
  • Do not edit sub nav links when calling bp_core_new_nav_default() if the URL parser is set to 'rewrites'.
  • Avoid a PHP notice if the new sub nav object misses the slug and/or the link properties.

Props corzel

See #4954
Fixes #8936
Closes https://github.com/buddypress/buddypress/pull/130

Note: See TracTickets for help on using tickets.