Skip to:
Content

BuddyPress.org

Changeset 12792


Ignore:
Timestamp:
11/19/2020 12:48:25 PM (4 years ago)
Author:
imath
Message:

Groups: Avoid a PHP 8.0 deprecated notice about optional function arg.

The BP_Groups_Invitation_Manager->run_acceptance_action() method was wrongly using one optional arguments before a required one. As PHP 8.0 no longer accepts this practice, all arguments of the method will be required.

See #8392 (branch 6.0)

Location:
branches/6.0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/6.0/src/bp-core/classes/class-bp-invitation-manager.php

    r12428 r12792  
    612612     * @return bool True on success, false on failure.
    613613     */
    614     abstract public function run_acceptance_action( $type = 'invite', $r  );
     614    abstract public function run_acceptance_action( $type, $r  );
    615615
    616616    /**
  • branches/6.0/src/bp-groups/classes/class-bp-groups-invitation-manager.php

    r12429 r12792  
    6868     * @return bool True on success, false on failure.
    6969     */
    70     public function run_acceptance_action( $type = 'invite', $r  ) {
     70    public function run_acceptance_action( $type, $r ) {
     71        if ( ! $type || ! in_array( $type, array( 'request', 'invite' ), true ) ) {
     72            return false;
     73        }
     74
    7175        // If the user is already a member (because BP at one point allowed two invitations to
    7276        // slip through), return early.
  • branches/6.0/tests/phpunit/assets/invitations-extensions.php

    r12428 r12792  
    1313    }
    1414
    15     public function run_acceptance_action( $type = 'invite', $r  ) {
     15    public function run_acceptance_action( $type, $r  ) {
    1616        return true;
    1717    }
Note: See TracChangeset for help on using the changeset viewer.