Skip to:
Content

BuddyPress.org

#8910 closed defect (bug) (fixed)

Prevent screen and action files to be loaded more than once into Components class

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 12.0.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch
Cc:

Description

I've noticed bp-component/actions/anyfile.php or bp-component/screens/anyfile.php can be loaded more than once now we've moved to BP Rewrites. The test I made was clicking on the "Add Friend" button from the Members directory, it ended up with a fatal as the bp-members/screens/directory.php was loaded more than once, and as a result the bp_members_screen_index() function defined more than once.

To avoid potential issues, we should use require_once instead of require in all Components class late_includes() methods.

Change History (2)

This ticket was mentioned in PR #112 on buddypress/buddypress by @imath.


18 months ago
#1

  • Keywords has-patch added; needs-patch removed

To avoid potential issues, use require_once instead of require in all Components class late_includes() methods.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8910

#2 @imath
18 months ago

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

In 13495:

Prevent potential issues with late_includes() in Component classes

Use require_once instead of require to load action & screen files.

See #4954
Fixes #8910
Closes https://github.com/buddypress/buddypress/pull/112

Note: See TracTickets for help on using tickets.