Conflict with Event Calendar

Home Forums Calendar Products Events Calendar PRO Conflict with Event Calendar

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #908035
    proimpact
    Participant

    I don’t understand why I would be getting a conflict with another plugin when the two plugins are on separate pages. I would like to send a screenshot of the error message along with the developers tools window so you can see what is going on. How do I do that?
    The error message is
    Warning: Missing argument 2 for TribeEvents::addPostOrigin() in /home/scholars/public_html/wp-content/plugins/the-events-calendar/lib/the-events-calendar.class.php on line 3112 when trying to hit the Submit button on a totally unrelated page. No I haven’t deactivated Event Calendar since that is the plugin that is causing the plugin.

    The page-id-172 is where the form is installed, yet the error looks like it is coming back on <article id=”post-761″ class=”post-761 page type-page status-publish hentry content-page”>
    <header class=”entry-header”>
    <h1 class=”entry-title”>Submit Your Testimonial</h1>
    </header><!– .entry-header –>

    <div class=”entry-content cf”>
    <br>
    <b>Warning</b>: Missing argument 2 for TribeEvents::addPostOrigin() in <b>/home/scholars/public_html/wp-content/plugins/the-events-calendar/lib/the-events-calendar.class.php</b> on line <b>3112</b><br>
    <p class=”easy_t_submission_success_message”>Your message was sent successfully. Thanks.</p>
    </div><!– .entry-content –>
    <footer class=”entry-utility-page cf”>

    </footer><!– .entry-utility-page –>
    </article>
    How do I resolve this issue?
    Thanks

    #908868
    Barry
    Member

    Hi proimpact,

    Sorry to hear you’re hitting difficulties.

    Can you confirm what the other plugin is and have you reached out to the plugin author about this? Could you ask them if they are firing the wp_insert_post action from within their own code and what/how many arguments they are passing if so?

    Thanks!

    #912033
    proimpact
    Participant

    This reply is private.

    #912083
    proimpact
    Participant

    This reply is private.

    #912097
    Barry
    Member

    Hmm, interesting – that’s not quite what I meant but I’ll take their answer to mean they aren’t doing it directly. Can you confirm if this is the same plugin you are using?

    Easy Testimonials

    Or do you have a pro/premium version (and/or is it possible to replicate the same problem with the version I linked to alone)?

    #912112
    proimpact
    Participant

    This reply is private.

    #912129
    Barry
    Member

    I took this sentence to mean that they are doing it directly:
    Yes, we do call wp_insert_post, on the New Testimonial Submission form.

    I think they mean they are calling the function (which is perfectly fine), what I meant was they might be doing something atypical like firing the action of the same name directly – but without passing the required number of arguments. That was just a theory, though ๐Ÿ™‚

    I’ll take a look and see if I can replicate, please bear with me a little longer.

    #912134
    proimpact
    Participant

    This reply is private.

    #914516
    Barry
    Member

    The link you have provided is the same plugin. The Pro Version just allows more sites for the plugin to be utilized.

    I actually believe I’d need the PRO version of that plugin to replicate – at least if the problem relates to the form generated by the [submit_testimonial] shortcode – as noted in their installation instructions.

    If you could share a copy I can certainly take a quick look (trying to replicate on your site won’t really give me any insights into the underlying problem, unfortunately – I’d really need to test this out locally) ๐Ÿ™‚

    #914591
    proimpact
    Participant

    This reply is private.

    #915311
    Barry
    Member

    Actually you donโ€™t.

    Thanks for clarifying! Apologies on that count, the wording on their wordpress.org plugin page implied that there was a separate version available.

    In any case, I can now replicate and the problem is as I originally pictured.

    In their function submitTestimonialForm() (found in easy-testimonials/easy-testimonials.php lines 455-607) they are doing the following:

    do_action('wp_insert_post', 'wp_insert_post');

    This is not the same thing at all as doing:

    $new_id = wp_insert_post($post);

    (As indicated in the response you copied, a few replies ago.)

    The wp_insert_post action is ordinarily fired by core WordPress code – not by plugins – and it’s a reasonable expectation made by our own plugin to expect at least two arguments to be passed, whereas the way Easy Testimonials is doing things just one argument – a string – is passed.

    I’m not quite sure why they need to do things this way but if they really must I’d recommend they follow the same pattern as WordPress itself and pass three arguments – the first being an integer (post ID) rather than a string, the second being the post object and the third a boolean value indicating if the post was actually updated.

    Otherwise, conflicts like this one can and will happen, I’m afraid.

     

    #916634
    proimpact
    Participant

    Well, you both updated your plugins today. And I am still getting the error….
    Warning: Missing argument 2 for TribeEvents::addPostOrigin() in /home/xxxxx/public_html/wp-content/plugins/the-events-calendar/lib/the-events-calendar.class.php on line 3104
    Gold Plugin Support has requested:
    ————–
    If you can get some info from them that explains what argument 2 is, or specific steps that we should take to address the issue that would be very helpful.
    ——————
    Their update today was supposed to correct the issue in it changes the way the discussed function works to no longer triggers the wp_insert_post action.
    If that was indeed the issue, this update should fix your error
    Thanks for your help

    #916661
    Barry
    Member

    @proimpact:

    I’m sorry you’re experiencing these difficulties and wish we could help more – I’m afraid though this remains something that the author(s) of Easy Testimonials will need to resolve as the issue is within their code.

    The problem is exactly as it was before, albeit theย submitTestimonialForm() function is now in a slightly different location within the same file (lines 250-402) but it contains the same offending line of code as it did previously:

    do_action('wp_insert_post', 'wp_insert_post');

    You can see this for yourself if you open up the file I previously referenced and scroll down to line 315.

    If you can get some info from them that explains what argument 2 is, or specific steps that we should take to address the issue that would be very helpful.

    In short, unless there is a reason they need that line of code, they should remove it.

    They have already called wp_insert_post() just a few lines previously and so WordPress will automatically fire the action in the correct manner with the correct arguments, there is no reason I can think of that they manually need to do it from within their own plugin: if I’m missing something there I’m open to feedback – but I really feel they are going about things the wrong way on this one.

    In the short term, while I’m hesitant to suggest you edit the core code of any plugin, perhaps in this case if you feel confident doing so you should go ahead and remove the offending line or comment it out – ie, change:

    do_action('wp_insert_post', 'wp_insert_post');

    To:

    // do_action('wp_insert_post', 'wp_insert_post');

    (Adding a double slash will stop that line of code from running.)

    If that causes problems you can always undo the change – and ideally the plugin authors will make the correction in their next update to save you the trouble.

    #918333
    proimpact
    Participant

    Commenting out Line 315 corrected the problem as recommended. Thank you for your assistance.

    #918482
    Barry
    Member

    No problem at all – great that it fixes the problem ๐Ÿ™‚

    Of course, until the same change is made in a future revision of that other plugin you would need to manually restore that fix with each update (though hopefully they make a substantive fix sooner rather than later and save you the trouble).

    At this point I’ll go ahead and close this topic – but if we can help with anything else please don’t hesitate to create new topics and we’ll be happy to help.

    Thanks again!

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Conflict with Event Calendar’ is closed to new replies.