[buddypress-trac] [BuddyPress Trac] #8760: PHP 8.1 fatal / PHP <8 notice+warning: Trying to get property 'ancestors' of non-object (was: PHP 8.1 fatal / PHP <8 notice: Trying to get property 'ancestors' of non-object)

buddypress-trac noreply at wordpress.org
Wed Nov 9 00:17:01 UTC 2022


#8760: PHP 8.1 fatal / PHP <8 notice+warning: Trying to get property 'ancestors'
of non-object
--------------------------+------------------------------
 Reporter:  dd32          |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Core          |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Old description:

> The current PHP Notice is being triggered on BuddyPress.org, and is a
> Fatal error in PHP 8.1:
> {{{
> E_NOTICE: Trying to get property 'ancestors' of non-object in {file}
>
> PHP 8.1 Fatal error: Uncaught Error: in_array(): Argument #2 ($haystack)
> must be of type array, null given
> in {file}
>
> Source: GET https://buddypress.org/users/dd32/
>
> File: wp-content/plugins/buddypress/bp-core/bp-core-filters.php
> Line: 202
> }}}
>
> See PR.

New description:

 The current PHP Notice is being triggered on BuddyPress.org, and is a
 Fatal error in PHP 8.1:
 {{{
 E_NOTICE: Trying to get property 'ancestors' of non-object in {file}
 E_WARNING: in_array() expects parameter 2 to be array, null given in
 {file}

 PHP 8.1 Fatal error: Uncaught Error: in_array(): Argument #2 ($haystack)
 must be of type array, null given
 in {file}

 Source: GET https://buddypress.org/users/dd32/

 File: wp-content/plugins/buddypress/bp-core/bp-core-filters.php
 Line: 202
 }}}

 See PR.

--

Comment (by dd32):

 Just noting that this is a `E_WARNING` in PHP <8 too, I just missed the
 fact that it's changed from E_NOTICE+E_WARNING to E_NOTICE+E_ERROR in the
 sea of notices I was looking at :)

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8760#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list