Opened 3 years ago
Closed 3 years 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 12.0.0 |
| Component: | Core | Version: | |
| Severity: | normal | 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
To avoid potential issues, use
require_onceinstead ofrequirein all Components classlate_includes()methods.Trac ticket: https://buddypress.trac.wordpress.org/ticket/8910