[buddypress-trac] [BuddyPress Trac] #7337: PHP Fatal error: Uncaught Error: Call to a member function get_do_autolink() on null
buddypress-trac
noreply at wordpress.org
Wed Nov 9 11:46:51 UTC 2016
#7337: PHP Fatal error: Uncaught Error: Call to a member function
get_do_autolink() on null
------------------------------+-----------------------------
Reporter: slaFFik | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Extended Profile | Version:
Severity: normal | Keywords: dev-feedback
------------------------------+-----------------------------
Got this error:
{{{
PHP Fatal error: Uncaught Error: Call to a member function
get_do_autolink() on null in wp-content\plugins\buddypress\bp-xprofile\bp-
xprofile-filters.php:344
}}}
in one of my plugins, when doing this:
{{{
$field_link = xprofile_filter_link_profile_data( $field_value,
$field_data['type'] );
}}}
There is no `$field;` defined, using this function in ajax request.
I've fixed that in a plugin by defining the global with
`xprofile_get_field( $field_id )` in my loop, but shouldn't we consider
checking the `$field` for not being `null` (or better `instanceof
BP_XProfile_Field`) before using its method `get_do_autolink()`?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7337>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list