Opened 18 months ago
Closed 18 months ago
#8910 closed defect (bug) (fixed)
Prevent screen and action files to be loaded more than once into Components class
Reported by: | imath | Owned by: | 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.
To avoid potential issues, use
require_once
instead ofrequire
in all Components classlate_includes()
methods.Trac ticket: https://buddypress.trac.wordpress.org/ticket/8910