• 2 (not all) of my blogs must have some old settings that cause line 2741 to throw an error:

    Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/tomorrow/public_html/wp-content/plugins/wordbooker/wordbooker.php on line 2741

    , '" .mysql_real_escape_string($error_msg) . "'

    If you add a cast to it, it stops the error. But something else must be going on to make php think that $error_msg is an array

    , '" . mysql_real_escape_string( (string ) $error_msg) . "'

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

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author Steve

    (@steveatty)

    Which version are you using?

    I’m replacing all the mysql_ calls in 2.2 to make it future proof but if this is happening I need to work out why?

    Its not actually an error – its just a warning.

    Plugin Author Steve

    (@steveatty)

    When is it happening? Is It happening when you publish a post? I’ve got another user reporting a similar issue.

    Can you post your support information?

    Thread Starter Kchun

    (@kchun)

    Yes. It happens right after I publish a post and Wordbooker tries to post it to Facebook.

    By support information, you mean….?

    Thread Starter Kchun

    (@kchun)

    The weird thing is that I have Wordbooker on maybe 10 of my blogs and only 2 are throwing this error. These are the ones who’ve had Wordbooker longest…could they have some old setting?

    Thread Starter Kchun

    (@kchun)

    What I can’t understand, reading through the code, is what call to the debug routine is passing $error_msg as an array and not a string. That appears to be what is causing the error.

    I’ll go check all the calls to that debug routine and see if any might be accidentally sending it an array and not a string

    Plugin Author Steve

    (@steveatty)

    No – is it dumping anything else – like any of the data? I suspect its to do with the image handling ending up with an array coming into it rather than a string. But I’ve no idea why – I’ve got another user with the same problem:

    http://wordbooker.tty.org.uk/supportforums/topic/new-error-messages-right-after-publishing-new-posts/#post-11761

    The support info is the bit that lists the Wordbooker version and lots of other things along with your active plugins. Do the blogs that it happens on have different plugins to the ones that dont?

    Thread Starter Kchun

    (@kchun)

    Here’s some possibilities

    Line: 1019 unserialize CAN sometimes return an array
    wordbooker_debugger(“Access token was “,unserialize($user_row->access_token),-5,88) ;

    Line 1029 If you trace $ret_code it is unserialize of a value that could well be an array (and thus still be an array)
    wordbooker_debugger(“Return code is “,$ret_code,-5,88) ;

    There are a few other variables that come from unserialize of what may or may not be an array

    Thread Starter Kchun

    (@kchun)

    aha! I looked at support and saw this:

    ERROR : table ‘wp_wordbooker_postcomments’ is missing ! – Please Deactivate and Re-activate the plugin from the Plugin Options Page

    I’ll undo my hacked fix, redo wordbooker and see if that solves the problem.

    Here’s the rest:

    Wordbooker: 2.1.25
    Wordbooker Code Base: 2.1.25 R00 – All Of This Has To End
    Wordbooker ID: 254577506873
    Wordbooker Schema: 5.6
    WordPress: 3.5.1
    Table prefix: wp_
    PHP: 5.2.17
    PHP Memory Limit: 256M
    PHP Memory Usage (MB): 34.5
    JSON Encode: PHP
    JSON Decode: PHP
    Curl Status: Curl is available and can access Facebook – All is OK ( Response Time was : 0.494198083878 seconds )
    Curl Version: 7.24.0
    JSON Version: 1.2.1
    SimpleXML library: 0.1 (provided by PHP)
    HTTP Output Character Encoding: pass
    Internal PHP Character Encoding: UTF-8
    MySQL: 5.5.23-55
    Database character_set_client : utf8
    Database character_set_connection : utf8
    Database character_set_database : utf8
    Database character_set_filesystem : binary
    Database character_set_results : utf8
    Database character_set_server : utf8
    Database character_set_system : utf8
    Database character_sets_dir : /usr/share/mysql/charsets/
    Database collation_connection : utf8_general_ci
    Database collation_database : utf8_unicode_ci
    Database collation_server : utf8_unicode_ci
    Server : Apache
    Active Plugins :
    Akismet ( 2.5.7 )
    Annual Archive ( 1.3 )
    Category Posts Widget ( 3.3 )
    Custom Post Templates ( 1.5 )
    Event Calendar 3 for PHP 5.3 ( 3.1.5 )
    Event Calendar 3 for PHP 5.3 Widget ( 3.1.5 )
    Flexi Pages Widget ( 1.6.11.1 )
    Google Doc Embedder ( 2.5.4 )
    IFRAME Embed For YouTube ( 1.0 )
    Limit Login Attempts ( 1.7.1 )
    List Sub Categories Sidebar Widget ( 1.0 )
    Socialize This ( 2.2.4 )
    TinyMCE Advanced ( 3.5.8 )
    TinyMCE Valid Elements ( 0.3 )
    Form Manager ( 1.6.40 )
    Worpress Video ( 1.0 )
    WordPress Category Archive ( 1.3.0 )
    WP Issuu ( 2.15 )
    Artiss YouTube Embed ( 2.7 )
    Promotion Slider ( 3.3.1 )

    Wordbooker Table Status :
    Table ‘wp_wordbooker_errorlogs’ is present and contains 164 rows
    Table ‘wp_wordbooker_postlogs’ is present and contains 268 rows
    Table ‘wp_wordbooker_userdata’ is present and contains 1 rows
    Table ‘wp_wordbooker_userstatus’ is present and contains 1 rows
    ERROR : table ‘wp_wordbooker_postcomments’ is missing ! – Please Deactivate and Re-activate the plugin from the Plugin Options Page
    Table ‘wp_wordbooker_process_queue’ is present and contains 0 rows
    Table ‘wp_wordbooker_fb_friends’ is present and contains 0 rows
    Table ‘wp_wordbooker_fb_friend_lists’ is present and contains 0 rows

    Plugin Author Steve

    (@steveatty)

    Yes but that code only fires on access token refresh and only happens when token swapping logging is enabled. Also if the unserialize of the access token was failing because it was an array then nothing would be working at all as Wordbooker would never find a valid access token

    When is your error occurring – that will tell us more about where its happening. Wading at random through all the calls to wordbooker_debugger is not going to be efficient.

    Thread Starter Kchun

    (@kchun)

    rats….still throws error
    Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/tomorrow/public_html/wp-content/plugins/wordbooker/wordbooker.php on line 2741

    But the error in status is gone. Let me know if you want me to try anything else before I put the (string) case back into line 2741

    Thread Starter Kchun

    (@kchun)

    After I hit “UPDATE” on the post, it goes to the blank page, prints the above error about line 2741.

    Next I get a headers already sent message so I’m left with the original error, the headers error and an otherwise blank screen.

    However Wordbooker has successfully posted the update to facebook and everything else appears to have worked.

    Plugin Author Steve

    (@steveatty)

    So its happening on the image handing for that post at a guess which is exactly what the other person reports in the thread I linked to.

    As the code is the same on all your blogs can you check to see if any of the plugins OR Wordbooker configuration options are different (specifically the “Check the following Custom Post Meta tags for images ” option ) on the blogs it doesn’t work on.

    If you publish a simple post with no images in it does it do it?

    Thread Starter Kchun

    (@kchun)

    Here’s the diagnostics:

    Post Time Action Message Error Code
    Testing 2013-01-27 15:50:08 Image URL http://maui-tomorrow.org ( org ) not valid –
    Testing 2013-01-27 15:50:08 Calling Wordbooker publishing function –
    Testing 2013-01-27 15:50:08 Commence Publish –
    Testing 2013-01-27 15:50:08 Author of this post is the Post Author –
    Testing 2013-01-27 15:50:08 Options Set – call transition –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_noncename 22b06788b5 –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_publish_default on –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_primary_target FW:489942260654 –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_primary_type 1 –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_primary_active on –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_secondary_target FW:112103508898888 –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_secondary_type 1 –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_extract_length 256 –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_actionlink 300 –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_thumb_only on –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_use_excerpt on –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_attribute Posted a new post on their blog –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_status_update_text : New blog post : %title% – %link% –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_like_button_post 1 –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_publish_page_default on –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_publish_post_default on –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_post_edited yes –
    Testing 2013-01-27 15:50:08 Post option : wordbooker_override_id 1 –
    Testing 2013-01-27 15:50:08 User has been set to : 1 –
    Testing 2013-01-27 15:50:08 Posting as user : 1 –
    Testing 2013-01-27 15:50:08 Calling wordbooker_fbclient_publishaction –
    Testing 2013-01-27 15:50:08 Getting the Excerpt –
    Testing 2013-01-27 15:50:08 Getting the thumnail image –
    Testing 2013-01-27 15:50:08 Getting image from custom meta : –
    Testing 2013-01-27 15:50:08 Setting image array to be just thumb –
    Testing 2013-01-27 15:50:08 Setting image array to be post and thumb images. –
    Testing 2013-01-27 15:50:08 No Post images found so loading blank to keep Facebook happy –
    Testing 2013-01-27 15:50:08 Post Images : http://Maui-Tomorrow.org/wp-content/plugins/wordbooker/includes/wordbooker_blank.jpg
    Testing 2013-01-27 15:50:08 Getting the Excerpt –
    Testing 2013-01-27 15:50:08 Post Titled : Testing –
    Testing 2013-01-27 15:50:08 Post URL : http://Maui-Tomorrow.org/?p=3793
    Testing 2013-01-27 15:50:08 Post Caption : Protecting Maui –
    Testing 2013-01-27 15:50:08 Read Full link being used –
    Testing 2013-01-27 15:50:08 Posting to Fan Wall Maui Tomorrow (Primary) as a Wall Post –
    Testing 2013-01-27 15:50:08 Wall Post to Maui Tomorrow Test Only No Post Made –
    Testing 2013-01-27 15:50:08 Posting to Secondary target (Occupy Maui) not active –

    Thread Starter Kchun

    (@kchun)

    Is it throwing an error because there’s not a valid image?

    Plugin Author Steve

    (@steveatty)

    Did that throw the error?

    Its throwing the error because:

    else { wordbooker_debugger(“Found a match so dump the image”,$single,$post->ID,80); }

    seems to somehow end up with $single as an array

    I’m also confused as to why its telling me that “Image URL http://maui-tomorrow.org ( org ) not valid” That would imply that somewhere you’ve got an image url which contains no image.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘php error at line wordbooker.php on line 2741’ is closed to new replies.