Catchable fatal error when user import failed
slaFFik opened this issue · 1 comments
https://wordpress.org/support/topic/plugin-wont-work-catchable-fatal-error/
I installed the plugin and when I tried to import sample data, I got the error:
Catchable fatal error: Object of class WP_Error could not be converted to string in /home/dh_ebc578/thisismytestsite.xyz/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-profiledata.php on line 127
As this was a similar error as someone else reported, I reached out to Buddypress support and got this response:
I’m guessing that the $this->user_id parameter is the WP_Error object https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-xprofile/classes/class-bp-xprofile-profiledata.php#L127; this might result in the Default Data plugin because it attempted to generate a user, but failed, and didn’t catch its failure before attempting to add profile data for the new user.
We could build some sort of failsafe to prevent this sort of fatal from happening, but I don’t know if we’d want to. In this case, it’s likely that the problem is a result of some incorrect logic or incomplete error checking in BP Default Data, and if we were to silently “fix” the error (by returning false or something) it would hide what could be a more serious bug for the plugin.