Discussion:
Debugging some strange error
Daniel
2013-11-29 00:23:43 UTC
Permalink
Hi guys,

Just wondering, how many of you been in a position where you know that
there a bug in your plugin/theme, you know what condition that it will
happen but you are unable to work out why?

Right now I'm debugging a theme that I've picked up from someone else,
that also integrate into phpBB.

The wordpress comment feature will work fine IF:
- User is logged into both wordpress and phpbb (it will happen when a
user logs into phpBB then go to the blog)
- There are matching accounts on both database
- There are no comments with the user ID 0.in the wp_comment table

The issue start when someone makes a comment when they are not logged
in (both wordpress and phpBB). The error that get outputted is

/home/xxx/public_html/wp-content/themes/phpBB/includes/wp_phpbb_bridge_core.php
on line 915: Creating default object from empty value.

Would anyone have any ideas on how I can go about debugging it? Also
please note that most of it wasn't written by me so there may be
something that been missed and I have not been able to pick up on it.

The file in question:
https://github.com/Danielx64/WP-phpbb-bridge/blob/master/phpBB-WordPress-bridge/Bridge-phpBB-WordPress/wordpress/wp-content/themes/phpBB/includes/wp_phpbb_bridge_core.php#L915

As per before, credit will be given for anyone who can help me nut
this one out :)

Regards,
Daniel
Ryan McCue
2013-11-29 00:27:11 UTC
Permalink
Post by Daniel
/home/xxx/public_html/wp-content/themes/phpBB/includes/wp_phpbb_bridge_core.php
on line 915: Creating default object from empty value.
Would anyone have any ideas on how I can go about debugging it? Also
please note that most of it wasn't written by me so there may be
something that been missed and I have not been able to pick up on it.
At this point in the code, $wp_poster_id is either 0 or falsey
(false/null), *not* an object. You're setting properties on it and
assuming it's an object, which is casting the falsey value to an object
and giving you that notice.

Try: $wp_poster_data = new WP_User;

Also, questions like this are probably better asked on Stack Overflow. :)
--
Ryan McCue
<http://ryanmccue.info/>
Daniel
2013-11-29 00:50:54 UTC
Permalink
Hi Ryan,

Thank-you for letting me know about that, I will give it a try and let
you know how it goes :) I was going to go to Stack Overflow but I
wasn't sure when it the right time to go over there.

Regards,
Daniel
Post by Ryan McCue
Post by Daniel
/home/xxx/public_html/wp-content/themes/phpBB/includes/wp_phpbb_bridge_core.php
on line 915: Creating default object from empty value.
Would anyone have any ideas on how I can go about debugging it? Also
please note that most of it wasn't written by me so there may be
something that been missed and I have not been able to pick up on it.
At this point in the code, $wp_poster_id is either 0 or falsey
(false/null), *not* an object. You're setting properties on it and
assuming it's an object, which is casting the falsey value to an object
and giving you that notice.
Try: $wp_poster_data = new WP_User;
Also, questions like this are probably better asked on Stack Overflow. :)
--
Ryan McCue
<http://ryanmccue.info/>
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Continue reading on narkive:
Loading...