Support » Plugins and Hacks » [Plugin : Wordbooker] Bug reports

[Plugin : Wordbooker] Bug reports

  • If people are having problems with my Wordbooker plugin rather than just voting saying its “broken” can you please post some information and I’ll look into it.

    I know that it doesn’t play well with some other Facebook plugins down to the fact that they are using old and obsolete versions of the Facebook API client libraries which don’t support the methods this plugin uses. Unfortunately there isn’t a lot I can do about that.

Viewing 15 replies - 16 through 30 (of 85 total)
  • Thanks, Steve. I’ll look into it further.

    Immediately after installing and activating the plugin, going to Settings->Wordbooker generates the following error:
    WordPress database error Duplicate column name ‘facebook_id’ for query
    ALTER TABLE wp_wordbook_userdata
    ADD facebook_id VARCHAR( 40 ) NOT NULL ,
    ADD name VARCHAR( 250 ) NOT NULL ,
    ADD status VARCHAR( 1024 ) default NULL ,
    ADD updated INT( 20 ) NOT NULL ,
    ADD url VARCHAR( 250 ) default NULL ,
    ADD pic VARCHAR( 250 ) default NULL ,
    ADD pages VARCHAR( 2048 ) default NULL,
    ADD auths_needed int(1) NOT NULL,
    ADD blog_id bigint(20) NOT NULL
    made by require_once, do_action, call_user_func_array, wordbooker_option_manager, wordbooker_option_notices, wordbooker_upgrade
    WordPress database error Multiple primary key defined for query ALTER TABLE wp_wordbook_userdata ADD PRIMARY KEY ( user_ID ) made by require_once, do_action, call_user_func_array, wordbooker_option_manager, wordbooker_option_notices, wordbooker_upgrade
    WordPress database error Duplicate key name ‘facebook_idx’ for query ALTER TABLE wp_wordbook_userdata ADD INDEX facebook_idx ( facebook_id ) made by require_once, do_action, call_user_func_array, wordbooker_option_manager, wordbooker_option_notices, wordbooker_upgrade

    Sometimes it would seem that the schema version doesn’t get saved on install so when you go to the options screen it thinks its doing an update – but it shouldn’t be a fatal error.

    I think I’ve found the bug and fixed it. 1.7.4 should fix that and a few other minor problems (like it crashing if it finds a totally blank Facebook status!)

    Very frustrating. I can install and setup Wordbook with no problem but Wordbooker can’t get past the “getting an infinite session from Facebook” part. This occurs both locally (WP2.8.5, WinXP, IIS, PHP5+) and remotely (WP2.8.5, Win2003, IIS, PHP5+). At the settings page I’m prompted to enter the session code; whatever I enter returns me to that page. Adding debug code seems to indicate that wordbooker_fbclient_getsession() throws an exception “100 – Invalid parameter” and so subsequently never writes the details to the database to allow me to get any further. The puzzling thing is, as I’ve said, installing Wordbook works and the code around this part looks identical. I’ve made sure that databases created in MySQL for each plugin are deleted between installs. I’m hoping that you might be able to shed some light on this because it’s got me stumped. I’m familiar with (though not expert at) PHP, but not WordPress. I’m hoping after all this that the plugin does what I’m expecting which is that it will be able to post WordPress updates to a fan page wall, something I simply cannot get to work with any other thing I’ve tried.

    And a follow-up: I seem to have got past the Invalid Parameter issue. Why? I haven’t a clue. It’s not as if I’ve changed any code; simply added more debug lines. Anyway, it now returns the value from wordbooker_fbclient_getsession() but cannot extract $secret from the response. $session_key it gets. $secret, however, is blank. Does this make a difference? I don’t know but I do know that the wordbooker_set_userdata() function now fails to do anything. Debugging again and pasting the generated SQL into MySQL query browser returns:

    Field 'facebook_id' doesn't have a value

    And I can see that’s true. The Insert query inserts user_ID , onetime_data , facebook_error , secret , session_key , blog_id but nothing else. facebook_id, I can see, is defined as NOT NULL in the db schema but there’s no default value so it is null at insert time. Question: do you have default values in your schema? Is your MySQL configured to ignore nulls?

    So the call:

    list($result, $error_code, $error_msg) = wordbooker_fbclient_getsession($fbclient, $token);

    is working OK?

    What happens if you do a var_dump($result); ? Does that show empty fields?

    If it does then that implies that the $fbclient->auth_getSession($token) call in wordbooker_fbclient_getsession is failing.

    You’ve not got any other facebook related plugins active have you?

    Yes, that line’s okay to a point. $result returns:

    array(3) { ["session_key"]=> string(34) "a1a1a1a1a1a1a1a1a1a1a1-111111111" ["uid"]=> string(9) "111111111" ["expires"]=> string(1) "0" }

    (*) values altered, obviously.

    As you can see, there’s no $result[‘secret’] value though, which is picked up next in the code.

    The code gets past this point and then calls:

    wordbooker_set_userdata( $onetime_data,$facebook_error, $secret, $session_key);

    In here is where things next go wrong. The INSERT query generated fails; debugging the code to get the query it’s trying to execute and then executing that query directly into MySQL Query Browser pulls up the problem in my last message. The database schema sets NO NULLs for most of the fields in the table and doesn’t have any default values; subsequently, the insert query that’s only populating six fields fails. This makes me wonder how the query ever works for anyone, yet clearly it does.

    I checked my DB and realised that secret is empty (but its not null)

    If you look, all those values are serialised – so if they are not set they are set to “N:” which is what happens when you serialise a null field.

    Have you got strict mode turned on?

    According to :


    having Not NULL string defaulting to an empty string is acceptable.

    Try taking the null check off the various columns and see if it fixes it.

    Trying to get 1.7.5 to work here. When trying to enter the 1 time facebook code, I get the following error:

    WordPress database error: [Field ‘facebook_id’ doesn’t have a default value]
    INSERT INTO wp_wordbook_userdata ( user_ID , onetime_data , facebook_error , secret , session_key , blog_id ) VALUES ( 1 , ‘a:3:{s:11:”onetimecode”;s:6:”L4474H”;s:10:”error_code”;i:100;s:9:”error_msg”;s:17:”Invalid parameter”;}’ , ‘N;’ , ‘N;’ , ‘N;’ , 1 )

    I disabled the plugin and made sure the tables were deleted, then reactivated it so that it would recreate the tables. It did all that fine. Same error every time for me.

    OK – I know what that is – its due to a MySQL setting which enforces nulls on unset fields (by default MySQL will allow you to have empty NOT NULL fields in a row if you don’t attempt to put any data into them – and as you can see my insert isn’t attempting to put anything into facebook_id at this stage.

    Do you have access to the database?

    If so can you issue the following command:

    ALTER TABLE wp_wordbook_userdata CHANGE onetime_data onetime_data LONGTEXT NULL ,
    CHANGE facebook_error facebook_error LONGTEXT  NULL ,
    CHANGE session_key session_key VARCHAR( 80 )  NULL ,
    CHANGE facebook_id facebook_id VARCHAR( 40 )  NULL ,
    CHANGE name name VARCHAR( 250 )  NULL ,
    CHANGE updated updated INT( 20 ) NULL ,
    CHANGE auths_needed auths_needed INT( 1 ) NULL ,
    CHANGE blog_id blog_id BIGINT( 20 ) NULL

    Worked like a charm! Thanks for the quick reply! Love the plugin btw! Just upgraded from an old version.


    I’ll roll those changes up into the next release



    Sadly, as of the latest version, synching comments back to the blog doesn’t appear to be working. I have the same problem occurring on two different servers. 🙁

    Comment synching was always problematical and I know what is causing the problem with the current release, and indeed it might be fixed in the dev release available from the Wordbooker Facebook page.

    Comment handling is due for a complete re-write in 1.8 to handle things like comments on fan walls etc.

Viewing 15 replies - 16 through 30 (of 85 total)
  • The topic ‘[Plugin : Wordbooker] Bug reports’ is closed to new replies.