Lampwrights Forum

Lampwrights Forum (http://www.lampwrights.com/index.php)
-   vBulletin Wordpress Bridge (http://www.lampwrights.com/forumdisplay.php?f=13)
-   -   Wordpress 3.5 + Vbul Bridge || Comment posting error (http://www.lampwrights.com/showthread.php?t=389)

malcster505 12-13-2012 08:23 AM

Wordpress 3.5 + Vbul Bridge || Comment posting error
 
Hello, first time poster unfortunately. +1 for this plugin; have been using it for a long while.

After the WP 3.5 update there seems to be an issue with posting comments on posts using the bridge. Every other feature seems to be functioning without issue though.

The error given on posting a comment is as follows:

Fatal error: Call to undefined method stdClass::has_cap() in pathtowordpress\wp-includes\comment.php on line 691

Not sure if anyone else has come across this. I haven't as of yet tried to fix it myself, but if I do find a solution any time soon I'll update my post.

Though if anyone else has an idea of the specific cause I'm open ears as always.

Cheers


Edit: There was a change in the wp_allow_comment function in wp-includes/comments.php
After the do_action

Code:

if ( isset($user_id) && $user_id) {
                $userdata = get_userdata($user_id);
                $user = new WP_User($user_id);
                $post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
        }

was changed to:

Code:

        if ( ! empty( $user_id ) ) {
                $user = get_userdata( $user_id );
                $post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
        }

Which is causing the error.

Rushster 12-13-2012 11:54 PM

I am having errors too. Got it working but it now won't recognise the vbulletin user being logged in and always shows the enter email etc box.

Not really sure what to check. I tried to find the code you mention but can't find it in the core WP files.

malcster505 12-14-2012 06:38 AM

Quote:

Originally Posted by Rushster (Post 1348)
I am having errors too. Got it working but it now won't recognise the vbulletin user being logged in and always shows the enter email etc box.

Not really sure what to check. I tried to find the code you mention but can't find it in the core WP files.

Didn't experience the bridge not recognizing a user isn't logged in.

The line I mentioned only deals with comments, and it's in the wp-includes/comments.php file. There's only one "function wp_allow_comment", so using find you can't really miss it. There is also only one do_action inside that function too.

I haven't found the fix yet but I haven't really had time to properly look due to work. I'll be trying to get a proper look in over the weekend. Your best bet for now is to revert your wp installation.

Rushster 12-14-2012 08:47 AM

Can't really revert it, would be way too much work. Basicaly at the stage where the site recgonises the user as logged in but the comment box at the bottom thinks they are not. Still working on it :(

ihstiv 12-14-2012 07:23 PM

I'm getting a blank page with this error after the upgrade to 3.5:

Fatal error: Call to undefined method stdClass::has_prop() in /home/mysite/public_html/wordpress/wp-includes/user.php on line 245

looks like it's related to the changes around $user / $userdata

I'd be grateful for any tips to resolve at least some of this error - I'm not having much luck on my end so far.

awesome plugin, been enjoying for a while now.

Rushster 12-15-2012 03:28 PM

Well I got it working eventually. Disabled the WP admin integration functionality (which I don't use anyway and as far as I know was experimental anyway) and had to mess about with it quite a bit.

If you want to try out my file drop me a PM and I will send you a link to it.

ihstiv 12-15-2012 04:38 PM

Quote:

Originally Posted by Rushster (Post 1353)
Well I got it working eventually. Disabled the WP admin integration functionality (which I don't use anyway and as far as I know was experimental anyway) and had to mess about with it quite a bit.

If you want to try out my file drop me a PM and I will send you a link to it.

Thanks Rushster. I'm taking a look at a new WP plugin called vbsso that looks like it might be more well supported. no disrespect to lampwrights.

scottelkin 12-17-2012 07:59 PM

Quote:

Originally Posted by Rushster (Post 1353)
Well I got it working eventually. Disabled the WP admin integration functionality (which I don't use anyway and as far as I know was experimental anyway) and had to mess about with it quite a bit.

If you want to try out my file drop me a PM and I will send you a link to it.

Can you send me the link? I can't send a PM until I get three posts.

Salva Portillo 12-19-2012 05:45 PM

Quote:

Originally Posted by Rushster (Post 1353)
Well I got it working eventually. Disabled the WP admin integration functionality (which I don't use anyway and as far as I know was experimental anyway) and had to mess about with it quite a bit.

If you want to try out my file drop me a PM and I will send you a link to it.

Hi Rushster. Same for me, could you please PM me? Thanks!

scottelkin 12-19-2012 06:33 PM

I am still waiting...I had to rollback to Wordpress 3.42 in the meantime.

Salva Portillo 12-28-2012 06:39 PM

Quote:

Originally Posted by Rushster (Post 1353)
Well I got it working eventually. Disabled the WP admin integration functionality (which I don't use anyway and as far as I know was experimental anyway) and had to mess about with it quite a bit.

If you want to try out my file drop me a PM and I will send you a link to it.

Hi Rushster, could you please give us a hand?

Jeff 12-31-2012 12:04 PM

Let me know if this fixes the issue for you. In vbbridge.php, find this line in the function get_userdata():

PHP Code:

    if ( !$user_a $vb->db->query_first("SELECT * FROM " TABLE_PREFIX "user WHERE userid = '" intval($user_id) . "'") )
        return 
false

Add this right AFTER that:

PHP Code:

$user = new WP_User



All times are GMT -4. The time now is 07:49 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2024, vBulletin Solutions, Inc.