[buddypress-trac] [BuddyPress Trac] #8910: Prevent screen and action files to be loaded more than once into Components class

buddypress-trac noreply at wordpress.org
Tue May 30 20:10:42 UTC 2023


#8910: Prevent screen and action files to be loaded more than once into Components
class
--------------------------+-------------------------
 Reporter:  imath         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  12.0.0
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:  needs-patch
--------------------------+-------------------------
 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.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8910>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list