Opened 2 years ago
Closed 2 years ago
#8910 closed defect (bug) (fixed)
Prevent screen and action files to be loaded more than once into Components class
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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)
Note: See
TracTickets for help on using
tickets.
To avoid potential issues, use
require_onceinstead ofrequirein all Components classlate_includes()methods.Trac ticket: https://buddypress.trac.wordpress.org/ticket/8910