WordPress.org

Ready to get started?Download WordPress

Forums

Wordbooker
PHP Warnings (27 posts)

  1. justin_k
    Member
    Posted 1 year ago #

    Two unique PHP warnings that are appearing from Wordbooker 2.1.25:

    [07-Jan-2013 09:11:44] WordPress database error Unknown column 'fb_user_id' in 'field list' for query INSERT INTO wp_wordbooker_postcomments (fb_post_id,comment_timestamp,wp_post_id,blog_id,user_id,fb_user_id,fb_target_id) VALUES ("3309143_10101343207408414",1357549904,22703,1,1,3309143,3309143) made by edit_post, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), call_user_func_array, wordbooker_process_post_data, wordbooker_publish, wordbooker_publish_action, wordbooker_fbclient_publishaction, wordbooker_wall_post, wordbooker_store_post_result

    and

    [09-Jan-2013 02:00:26] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1
    , 80
    )' at line 15 for query INSERT INTO wp_wordbooker_errorlogs (
    user_id
    , method
    , error_code
    , error_msg
    , post_id
    , blog_id
    , diag_level
    ) VALUES (
    1
    , 'Looking for addthis.com in http://media.justin-klein.com/post-images/2013/23410-sim-cards.jpg'
    , 1
    , ' '
    ,
    , 1
    , 80
    ) made by do_action_ref_array, call_user_func_array, check_and_publish_future_post, wp_publish_post, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), call_user_func_array, wordbooker_process_post_data, wordbooker_publish, wordbooker_publish_action, wordbooker_fbclient_publishaction, wordbooker_return_images, wordbooker_strip_images, wordbooker_debugger

    http://wordpress.org/extend/plugins/wordbooker/

  2. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    Your Database structure has got out of sync with the code. somehow.

    What schema version is Wordbooker saying its using?

    Did you just upgrade and if so from what version?

  3. justin_k
    Member
    Posted 1 year ago #

    I did just upgrade, first time in about a year. 2.0.9->2.1.25. Admin panel says schema = 5.6.

  4. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    And the second bit of code is because there is no POST_ID for the insert... which should not be happening...

  5. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    OK so did you go to the Options screen after updating but before running a post?

  6. justin_k
    Member
    Posted 1 year ago #

    Yep. Deactivated, deleted old plugin, uploaded new plugin, activated, visited Wordbooker's settings page, looked around & changed a thing or two, then posted.

  7. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    Very odd - One fix would be to delete the wordbooker_postcomments table and then de-activate and re-activate the plugin but that will lose any data in there.

    I'm off to bed now but will try to work out why the DB upgrade seems to have failed as the table is obviously missing columns when it shouldn't be.

    Also not sure why the post_id is missing because it shouldn't be - unless something is screwing up the POST object.

  8. justin_k
    Member
    Posted 1 year ago #

    Easier: I just went ahead and manually changed the structure in phpMyAdmin to match wordbooker.php line 274. There were quite a few problems, I suspect the table-update code might need a look. Specifically:

    fb_post_id was wrong (length 40 instead of 240)
    fb_comment_id was wrong (length 40 instead of 240)
    key timestamp was missing
    FB_USER_ID was missing
    FB_TARGET_ID was missing

  9. justin_k
    Member
    Posted 1 year ago #

    ...And yet more schema issues:

    [11-Jan-2013 06:12:30] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1
    , 80
    )' at line 15 for query INSERT INTO wp_wordbooker_errorlogs (
    user_id
    , method
    , error_code
    , error_msg
    , post_id
    , blog_id
    , diag_level
    ) VALUES (
    1
    , 'Looking for addthis.com in http://media.justin-klein.com/post-images/2013/22315-angkor-wat-03.jpg'
    , 1
    , ' '
    ,
    , 1
    , 80
    ) made by do_action_ref_array, call_user_func_array, check_and_publish_future_post, wp_publish_post, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), call_user_func_array, wordbooker_process_post_data, wordbooker_publish, wordbooker_publish_action, wordbooker_fbclient_publishaction, wordbooker_return_images, wordbooker_strip_images, wordbooker_debugger

  10. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    ... its the same second error as the last time.. For some reason your installation is losing the $POST object .. if you look there is a missing value in that insert... the value that is missing is the postid which I get from the $post object... thus that would suggest that the global $post object has been destroyed. There is a plugin that I know messes with the $post object.

    Can you provide your support information and tell me exactly when this is happening.

  11. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    The table structure issues are odd... I did have a great bit of code that did a schema compare and adjusted things but on some mis-configured MySQL installs it hung.

  12. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    I know wjy tne schema went wrong..

    You deactivated the plugjn with an old schema structure. When you reactivated it it ran the create table script which of course silently failed as the objects were already thrre but then it set the schema version to the latest version. This meant that the update schema code didn't run leavingyou with tthe mess you did.

  13. justin_k
    Member
    Posted 1 year ago #

    >>I know wjy tne schema went wrong..

    ...Isn't that the point though? To deactivate an older version, activate a new version? :P

    >>tell me exactly when this is happening.

    I believe it happens after a post is published.

    >>Can you provide your support information

    Messaged privately to the Wordbooker Facebook profile

  14. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    The need to deactivate between releases was removed at version 2.0 as documented in the user manual - Version 2.0 has, like most other WordPress plugins, no need to be de-activated for upgrading.

    As for the Post object... I knew I'd seen this before:

    http://wordpress.org/support/topic/redefining-the-global-post-object?replies=10

    I'm trying to work out if the bug still remains in their code.

  15. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    IT still looks like revelanssi breaks things.

    Can you upgrade to the latest version of that plugin then...

    open the indexing.php file (in the lib directory).

    and find in the relevanssi_index_doc function

    if (is_array($post)) {
    	$post = get_post($post['ID']);
    }

    and comment out that $post=

    line

  16. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    In fact - can you turn that plugin off totally and see if the problem goes away.. the more I look at the code in it the more it scares me.

    OR there might be a fix..

    find the same function as I mentioned before and remove the comment I told you put in.

    Then at the top of the function you'll see:

    global $wpdb, $post, $relevanssi_variables;

    edit this to:

    global $wpdb, $relevanssi_variables;

  17. justin_k
    Member
    Posted 1 year ago #

    >>Version 2.0 has, like most other WordPress plugins, no need to be de-activated for upgrading.

    ...Right, but nevertheless it does seem like it should be able to *handle* deactivating and reactivating, don't you think? :P In particular, I deactivated it because I was upgrading WordPress. Then after updating wordpress, I uploaded the newer version and activated it. I didn't assume it'd be necessary to reactivate the old version in order to update...

    >>OR there might be a fix..

    Hmm, but are we confident that wouldn't mess up whatever Relevanssi is trying to do? Perhaps we should submit a topic to Mikko again, that this is still an issue introduced by his plugin?

  18. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    The problem is that you disabled it, upgraded WordPress, then replaced Wordbooker without re-activating it first... I can put more codding checks in place but that is what caused it.

    I've raised it with Mikko - just pointing out that replacing a global object with a stored version of itself is not really acceptable. Looking at the code I can't even see why he does it - that code should not need the global post object and he doesn't actually change anything in it as far as I can see.

    The problem is that reproducing it on my system is just about impossible which is why I suggested removing the $post from the list of globals in that code.

  19. justin_k
    Member
    Posted 1 year ago #

    >>Mikko

    Yeah, I hear where you're coming from. Hopefully he gets back and says it's fine to just cut it, but it's always risky to mess too much in other people's code - especially if it isn't "standards-compliant" and is as extensive as his.

    >> I can put more codding checks in place but that is what caused it.

    Forgive me if this is an oversimplification, but wouldn't it be easiest to just check the current structure of the table, the expected structure of the table, and if they don't match...it's a clear sign that something is wrong? Even if all it does is to say "Oops - your schema is out of sync! Please check table (so-and-so)," it'll prevent unexpected issues like this from arising under *any* circumstances.

    >>The problem is that you disabled it, upgraded WordPress, then replaced Wordbooker without re-activating it first...

    I disabled Wordbooker, removed Wordbooker, upgraded WordPress, and some time later, I installed Wordbooker again - the most current version. I never would've thought that I'd need to re-install an outdated version first, in order to subsequently install the current version....

  20. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    That's what the schema verify code did and it was elegant and neat and very reliable but some people seem to have partially broken MySQL databases or are running on servers which are basically running a huge number of databases in one MySQL instance (usually cheap shared hosting) so my code which uses the MySQL Information_Schema hung. So if I want to use it I've got to recode things... which I might do...

  21. justin_k
    Member
    Posted 1 year ago #

    Gotcha.

  22. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    If want you can comment out the line causing the error in wordbooker.php - its in the wordbooker_strip_images function:

    f ($flag==1) {wordbooker_debugger("Looking for ".$strip_domain." in ".$single," ",$post->ID,80) ;}

    But that might just move the message to the next debug if there is a problem.

  23. justin_k
    Member
    Posted 1 year ago #

    I'd rather just hang tight for Mikko's response for now, and get a proper/permanent solution. Wordbooker's functinality seems to be working uninhibited, so it at least superficially looks like it's just a matter of getting rid of error_logs in the interrim.

  24. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    He says that he is doing nothing wrong. Can you try turning off his plugin and seeing if the problem still occurs.

  25. justin_k
    Member
    Posted 1 year ago #

    Hmm...well, I tried re-publishing with Wordbooker in testmode (and Relevnssi still active, just as a baseline test), and the error_log did not appear. It would therefore seem like I need to do an actual publish to test this. I'll give it a try the next time I publish a post, hopefully in a week or so.

  26. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    I suspect that if the post has already been published then relevenssi will ignore the post.

  27. justin_k
    Member
    Posted 1 year ago #

    Ah yeah, that would make sense.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.