Support » Plugin: Wordbooker » Wordbooker breaks All-in-One Event Calendar

  • Resolved gwc_wd


    After updating to the most recent version of WordBooker, Ai1EC started failing with errors logged:

    Completely disable Wordbooker in Settings allows the Ai1EC to process.
    Re-enabling WordBooker allows the WB’s functions to work just fine without disabling Ai1.

    I’m actually quite fine with manually turning it on and off since I personally add all events or trigger WB postings to Facebook, but this would be a problem for admins with more normal usage.

    Two things:

    1. I’m not asserting that the conflict is a Wordbooker bug, nor am I asserting it’s an All-inOne Event Calendar bug.

    I’m just providing information that with the previous version of Wordbooker this problem did not exist.

    2. I am not using the most current version of Ai1, but version 1.5. The issue may go away with the newest Calendar code, v1.7. I won’t know because I’m not updating the calendar plugin due to the newer version’s non-standard directory implementation and the donation of shell script file to my WordPress install. I’m not alone in this, so it may or may not be an issue Wordbooker wants to look at.

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


    What errors was it reporting? just telling me a line without indicating the actual error is pretty much useless.

    And as the developers of the calendar plugin do now allow people to download old versions of their code I am unable to investigate the issue.

    Plugin Author Steve


    OK I found the 1.5 version – downloaded it and I have reproduced the error which is:

    PHP Fatal error:  Uncaught exception 'Ai1ec_Event_Not_Found' with message 'Event with ID '5388' could not be retrieved from the database.' in /webstuff/wordbooker/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php:356
    Stack trace:
    #0 /webstuff/wordbooker/wp-content/plugins/all-in-one-event-calendar/app/helper/class-ai1ec-events-helper.php(63): Ai1ec_Event->__construct(5388, false)
    #1 /webstuff/wordbooker/wp-content/plugins/all-in-one-event-calendar/app/controller/class-ai1ec-events-controller.php(491): Ai1ec_Events_Helper::get_event(5388)
    #2 [internal function]: Ai1ec_Events_Controller->event_content('<div class='wp_...')
    #3 /webstuff/wordbooker/wp-includes/plugin.php(170): call_user_func_array(Array, Array)
    #4 /webstuff/wordbooker/wp-content/plugins/wordbooker/wordbooker.php(1424): apply_filters('the_content', 'a new evnt')
    #5 /webstuff/wordbooker/wp-content/plugins/wordbooker/wordbooker.php(2467): wordbooker_return_images('a new evnt', 5388, 0)
    #6 /webstuff/wordbooker/wp-content/plugins/wordbooker/w in /webstuff/wordbooker/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php on line 356

    So basically my plugin is calling apply_filters (from within the wordbooker_return_images function) and that call is tripping up Ai1ec because I guess its not actually done its work yet. But Ai1ec really should not trip a PHP fatal error.

    Line 63 of class-ai1ec-events-helper.php is this:

    throw new Ai1ec_Event_Not_Found( "Event with ID '$post_id' could not be retrieved from the database." );

    and line 356 of class-ai1ec-event.php

    is : throw new Ai1ec_Event_Not_Found( "Event with ID '$data' could not be retrieved from the database." );

    So their code is missing an exception handler….

    I may be able to help elaborate on this a bit. With Wordbooker 2.1.8, you would get the following error *IF* you had default public to profile and wall enabled and tried to save or publish an event.

    Fatal error: Uncaught exception 'Ai1ec_Event_Not_Found' with message 'Event with ID '1334' could not be retrieved from the database.' in /home/pack155/public_html/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php:356 Stack trace: #0 /home/pack155/public_html/wp-content/plugins/all-in-one-event-calendar/app/helper/class-ai1ec-events-helper.php(63): Ai1ec_Event->__construct(1334, false) #1 /home/pack155/public_html/wp-content/plugins/all-in-one-event-calendar/app/controller/class-ai1ec-events-controller.php(491): Ai1ec_Events_Helper::get_event(1334) #2 [internal function]: Ai1ec_Events_Controller->event_content('<p>Test</p>?') #3 /home/pack155/public_html/wp-includes/plugin.php(170): call_user_func_array(Array, Array) #4 /home/pack155/public_html/wp-content/plugins/wordbooker/wordbooker.php(1257): apply_filters('the_content', 'Test') #5 /home/pack155/public_html/wp-content/plugins/wordbooker/wordbooker.php(2234): wordbooker_fbclient_publishaction(Object(stdClass), 1334) #6 /home/pack155/public_htm in /home/pack155/public_html/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php on line 356

    The work around was to have Wordbooker *NOT* post to the profile by default. Having it post to the page by default made no difference and regardless of it being checked or not, it wouldn’t post to the page anyways. This has been like this for quite some time now and never really was a concern because I didn’t want Wordbooker posting my events anyways, I would much rather have event items posted as FB events instead of a wall/page post which is something neither Wordbooker nor Ai1ec does anyways.

    Starting with Wordbooker 2.1.9, no matter what options you have set when you try to save your event as a draft or publish it, you get the error below. Even if you have both Wordbooker set to not post to the profile or page at all.

    Fatal error: Uncaught exception 'Ai1ec_Event_Not_Found' with message 'Event with ID '1322' could not be retrieved from the database.' in /home/pack155/public_html/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php:356 Stack trace: #0 /home/pack155/public_html/wp-content/plugins/all-in-one-event-calendar/app/helper/class-ai1ec-events-helper.php(63): Ai1ec_Event->__construct(1322, false) #1 /home/pack155/public_html/wp-content/plugins/all-in-one-event-calendar/app/controller/class-ai1ec-events-controller.php(500): Ai1ec_Events_Helper::get_event(1322) #2 [internal function]: Ai1ec_Events_Controller->event_content('<p>Details to c...') #3 /home/pack155/public_html/wp-includes/plugin.php(170): call_user_func_array(Array, Array) #4 /home/pack155/public_html/wp-content/plugins/wordbooker/wordbooker.php(1405): apply_filters('the_content', 'Details to come...') #5 /home/pack155/public_html/wp-content/plugins/wordbooker/wordbooker.php(2442): wordbooker_return_images('Details to come...', 1322, 0) #6 /home/ in /home/pack155/public_html/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php on line 356

    I hope this helps.

    On a slightly related note, the wordbooker options panel on the posting page never showed up if the post type was set to ai1ec_event. Now I know WP to Twitter still shows up, so I assume its some sort of filtering or only post/page is explicitly defined somewhere. If I may suggest having it work for all post types would be a great idea.

    On a related level, if your post type is set to an ai1ec-event, the wordbooker options in the post screen don’t show up. Other plugins like WP to twitter will show their posting options on the page.

    As a further update, the Ai1ec version is irrelevant, it is the same regardless of version. The issue the OP refers to, wasn’t seen by him prior to wordbooker 2.1.9 because he apparently leaves the default posting option unchecked. The issue he is seeing begins with WB 2.1.9.

    So to answer the OPs question, upgrading to Ai1ec 1.7 will not fix the problem. However downgrading back to Wordbooker 2.1.8 will resolve it for you only because of the way you have your default settings.

    I may be wrong and Steve, if you don’t mind clarifying, I believe this is a two-fold problem in that Steve is correct, ai1ec is missing an exception handler however wordbooker is narrowly focused in regards to the types of posts it supports. Ai1ec should add an exception handler and Wordbooker should support all post types 🙂

    Plugin Author Steve


    The unhandled exception error is purely down to the calendar plugin missing some key code.

    As for the Wordbooker settings not appearing – Worbooker doesn’t at the moment support custom post types on edit / create and only appears for Post and Page types. But even if it did – it would not fix the problem with the UHE error.

    Custom post handling is coming when I can get round to it but I’ve been batting facebook bugs which have caused a few problems.

    The change in 2.1.9 was a call to the apply_filters when you edited a post so that changes to images got reflected in the og:image tag. This is perfectly reasonable behaviour and is doing nothing unexpected.

    First, apologies if I provided inadequate information.

    The statements about the default settings mystify me. Contrary to someone’s remark, I do not want Events posted to Facebook. I do NOT have wordbooker set to default post. I have Wordbooker set to NOT publish by default to anything.

    All WB posts are done on a case by case basis within the post edit window.

    To be clear, Under Settings — > Wordbooker –> General Posting Settings

    All check boxes are clear except “Allow non Wordbooker users to chose to publish a post” and “Enable Extended description for a Share Link”

    Under Facebook Like and Send Options, all check boxes are clear except “Don’t Show … on Sticky Posts.”

    Comment Handling is off — Process comments: Never
    Enable Comment Process box is clear
    Disable Comment Importing is clear — when I check it and save, it comes back clear so don’t know if that is related.
    Disable Comment Exporting is checked, so enabled if the first “Process Never” doesn’t already do this.
    The bottom three buttons are all clear: Import from, Push Comments up and Auto Approve.

    Under Facebook Comment Box Options, Enable Facebook Comment handling is clear. All boxes in this section are clear.

    Under Advanced Options, Diagnostics: show everything but Cache, Disable short URLs is checked, Include FB Recent is checked, Use Iframes instead of FBXML is checked, Disable in-line opengraph is checked. Everything else is clear.

    Under user Level settings:

    Default publish post and page are set to Sames as Blog
    Post to a wall as status update is checked and post to a wall as a wall post is checked — everything is “same as blog”

    For readability I will explain how I actually use wordbooker next message.

    Plugin Author Steve


    As I said – its down to Wordbooker running apply_filters to repopulate og tags when a post is edited/created… OG tags are separate from publishing to Facebook.

    Plugin Author Steve


    Here is a fix that should work:

    open wordbooker.php

    find the wordbooker_process_post_data function and find the following line:

    if ($post->post_type=='reply') {return;}

    add after it:

    if ($post->post_type=='ai1ec_event') {return;}

    I use Wordbooker in the WordPress Posts – Add New or Edit windows, not in auto-post mode.

    When I go to add a new post, The Wordbooker Options at the bottom of the edit window properly shows the Publish this post to Facebook box as cleared. I must manually check it for a post to be published to Facebook.

    The only option that is enabled in that window is the first Post to the following Wall option, which I have configured in the settings. I have used this configuration through at least a few versions of Wordbooker and it works exactly as expected. Nothing gets published to Facebook unless the first box is checked.

    Now, I write posts in advance of their publication date. Some of them I want published to Facebook and some of them not. I check the Publish this to Facebook box accordingly.

    When I save the post by clicking the Schedule button, it has always operated as expected. When the day and time arrives, the article is posted to my blog and published to Facebook by Wordbooker. If I have three scheduled then they all have been processed on the publication date/time without incident.

    So it is not a matter of having Wordbooker set to default publish. Rather it is for some articles it is set to publish, but the whole post is forward scheduled.

    I seem to only experience the problem on the scheduled posts and not if I opt to publish immediately.

    Thanks Steve, your suggestion came while I was still entering the other message. I will implement your fix and report back.

    Plugin Author Steve


    Event posting could be added – the problem is that with different calendar plugins doing things in different ways it makes it a bit complicated.

    First, I just misspoke about when the problem occurs. Got myself confused in going through the various files. As I correctly mentioned at the start the problem has NEVER been with being able to get Wordbooker to publish. But that All-in-one ceases to function unless WB is disabled.

    I tried adding the suggested code and the problem remains.

    Except now it does not show any errors, just renders a blank page. I ftp’d to the site and could locate no error logs in any wp admin. wp inc or wordbooker or a-i-1 directories.

    I’m not sure how to provide helpful information?

    I’m going to cart this over to the All-in-One support and see if they need to take on even with their new version.

    Plugin Author Steve


    Well the code works here – what version of Wordbooker are you using?

    A blank page means a PHP Error – make sure that the code in the wordbooker file looks like:

    function wordbooker_process_post_data($newstatus, $oldstatus, $post) {
    	global $user_ID, $user_identity, $user_login, $wpdb, $blog_id;
    	# If this is an autosave then we give up and return as otherwise we lose user settings.
            # This is where we need to put in the custom post type checks
    	if ($post->post_type=='reply') {return;}
    	# Stop all in one calendar events from firing
    	if ($post->post_type=='ai1ec_event') {return;}
    	if ($_POST['action']=='autosave') { return;}

    I’ve got Wordbooker 2.1.12 which shows as the current version. However the code does look a little different because of the comments, not the working code:

    function wordbooker_process_post_data($newstatus, $oldstatus, $post) {
    	global $user_ID, $user_identity, $user_login, $wpdb, $blog_id;
    	# If this is an autosave then we give up and return as otherwise we lose user settings.
            # This is where we need to put in the custom post type checks
    	if ($post->post_type=='reply') {return;}
    	if ($post->post_type=='ai1ec_event') {return;}
    	if ($_POST['action']=='autosave') { return;}
Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Wordbooker breaks All-in-One Event Calendar’ is closed to new replies.