WordPress.org

Ready to get started?Download WordPress

Forums

Wordbooker
[resolved] Wordbooker breaks All-in-One Event Calendar (22 posts)

  1. gwc_wd
    Member
    Posted 2 years ago #

    After updating to the most recent version of WordBooker, Ai1EC started failing with errors logged:
    ..../plugins/wordbooker/wordbooker.php(1405)
    ....//plugins/wordbooker/wordbooker.php(2442)

    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.

    http://wordpress.org/extend/plugins/wordbooker/
    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

  2. Steve
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. Steve
    Member
    Plugin Author

    Posted 2 years ago #

    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....

  4. TomboAhi
    Member
    Posted 2 years ago #

    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.

  5. TomboAhi
    Member
    Posted 2 years ago #

    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 :)

  6. Steve
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  7. gwc_wd
    Member
    Posted 2 years ago #

    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.

  8. Steve
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  9. Steve
    Member
    Plugin Author

    Posted 2 years ago #

    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;}

  10. gwc_wd
    Member
    Posted 2 years ago #

    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.

  11. gwc_wd
    Member
    Posted 2 years ago #

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

  12. Steve
    Member
    Plugin Author

    Posted 2 years ago #

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

  13. gwc_wd
    Member
    Posted 2 years ago #

    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?

  14. gwc_wd
    Member
    Posted 2 years ago #

    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.

  15. Steve
    Member
    Plugin Author

    Posted 2 years ago #

    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;}
    	wordbooker_update_post_meta($post);
  16. gwc_wd
    Member
    Posted 2 years ago #

    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;}
    	wordbooker_update_post_meta($post);
  17. Steve
    Member
    Plugin Author

    Posted 2 years ago #

    Very odd

  18. gwc_wd
    Member
    Posted 2 years ago #

    Okay, it works. I disabled WB, logged out of the system, flushed cache. Went back, enabled WB and was able to save a draft event.

    Thank, sincerely for your help. I'm seriously amazed that you give an end user this much attention.

  19. TomboAhi
    Member
    Posted 2 years ago #

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

    Agreed!

    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.

    OK that's what I thought. I knew it wasn't supporting the ai1ec_event type.

    But even if it did - it would not fix the problem with the UHE error.

    Agreed that is something that Ai1ec needs to resolve. As you stated before, they should be using some sort of exception handling code.

    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.

    Take your time, the plugin is a great plugin and you do a hell of a job supporting it.

  20. TomboAhi
    Member
    Posted 2 years ago #

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

    I would only support events that are an actual post type. I believe most of the popular event/calendar plugins use that method as it makes the most sense not to mention WP made it easier when they officially introduced post types. Now since they all can use different terminology for their post types, I would make that a setting that the user has to fill in. So using this calendar for example, I the user, would have to fill in the box stating that the post type is ai1ec_event.

    Granted I am not a coder but I figure that would be the easiest route to take for your sanity sake

  21. padraigbeirne
    Member
    Posted 2 years ago #

    I had the exact same issue using Firefox & Chrome.

    However, Event Calendar works for me using IE9 without having to disable Wordbooker.

    Even though I didn't have to, you may need to switch to development mode in Cloudflare (if you use it) before adding a new event. I don't use IE at all but came in handy to get around this error, at least for me!

  22. sauril
    Member
    Posted 2 years ago #

    Thanks for the digging Steve,

    We'll look into the missing exceptions in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic