• Resolved zhiyano

    (@zhiyano)


    Hello,

    We’re facing a couple of compatibility issues between MultilingualPress and The Events Calendar.

    The first issue involves creating translations using the wp_insert_post() function. MultilingualPress switches to the remote site to create a translation, but while the translation is created, the event data isn’t added to The Events Calendar’s custom tables. This happens because The Events Calendar processes changes on the shutdown hook, which is triggered after switching back to the original site. Could you consider adding an additional handler, possibly on the save_post hook, to ensure that event data is immediately added/updated in the custom tables after the post is created/updated using wp_insert_post()?

    The second issue is that after switching blogs, we can’t retrieve the correct event tag or event category URL, even when using the tribe_events_get_url() function. It appears that the URL generation always relies on the rewrite rules from the original blog, rather than the current one.

    I would greatly appreciate your feedback and any guidance you could provide in addressing these issues.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Darian

    (@d0153)

    Hi @zhiyano

    Thank you for getting in touch and for sharing your valuable feedback. I will definitely pass this on to the rest of the team, and I’ll keep you posted as soon as I have any new updates.

    Plugin Support Darian

    (@d0153)

    Hi @zhiyano

    Thank you for patiently waiting.

    Issue #1: Unfortunately, we don’t have full compatibility with MultilingualPress. It would be best to consider using WPML or LocoTranslate instead. In the meantime, could you provide steps on how to replicate the issue so that the team can further investigate? Additionally, please reach out to the MultilingualPress team for further assistance, as they may have a workaround for this issue.

    Issue #2: I’m still checking on this one. I’ll update you as soon as I know more.

    Plugin Support Darian

    (@d0153)

    Hi @zhiyano

    Thanks for patiently waiting.

    As of issue #2, you can use ?get_bloginfo('url')?instead of?tribe_events_get_url()?.

    Let me know if you have further concerns.

    Plugin Support Darian

    (@d0153)

    Hi there,

    This thread has been inactive for a while, so we’ll go ahead and mark it Resolved. Please open a new thread if any other questions arise, and we’d be happy to help.

    Thread Starter zhiyano

    (@zhiyano)

    Hi @d0153,

    Thank you for your answers. But unfortunately both issues are still unresolved.

    Issue #1: The issue can be easily reproduced in a WordPress multisite environment. Simply switch to a different site using switch_to_blog(), create an event post with wp_insert_post(), and then switch back to the original site with restore_current_blog(). You’ll notice that the event date is not added to the custom tables.

    This happens because The Events Calendar processes changes on the shutdown hook, which is triggered after switching back to the original site. As a result, get_post_type() returns false since it’s checking the $post_id from a different site.

    Issue #2: Could you please provide an example how to use?get_bloginfo('url')?instead of?tribe_events_get_url().

    I don’t think this is possible. Let’s consider this scenario: I’m on a site with blog ID 2, but I need to get the URL of an event tag or category from a site with blog ID 3. My steps are:

    1. Switch to the correct blog with switch_to_blog().
    2. Get the event tag or category URL using tribe_events_get_url().
    3. Switch back to the original blog with restore_current_blog() and use the URL as needed.

    However, the issue is that tribe_events_get_url() always generates URLs based on the rewrite rules from the original blog, not the one I switched to. This results in a URL with the event slug from blog ID 2, instead of the correct URL with the slug from blog ID 3.

    Actually, both issues are not a compatibility issues with MultilingualPress; it’s a general issue with how The Events Calendar handles its logic across multisite.

    Plugin Support Darian

    (@d0153)

    Hi @zhiyano

    Thanks for your response.

    I truly appreciate the detailed feedback you provided. I will be sure to share your insights with the team. Rest assured, I will follow up with you as soon as I have more information to share.

    Plugin Support Darian

    (@d0153)

    Hi @zhiyano,

    I’m glad you brought this to our attention, I can see how this issue impacts your ability to create events and retrieve the correct URL. In the meantime, I’ve created an internal ticket [TECTRIA-530] to address this issue and I’ve included your specific use case in it to communicate it to our team.

    We prioritize bugs by taking into consideration the number of users impacted as well as how the bug impacts one’s ability to run an event/sell tickets. I don’t have a specific timeline as to when this issue will be resolved, but trust that our team is aware. Our team communicates updates and bug fixes in our newsletter and via our changelog.

    I’m happy to help if any other questions are coming up around this topic, otherwise I’ll go ahead and close this ticket.

    Thanks again for reporting this issue and for using The Events Calendar! Have a great day.

    Internal Bug Ticket Reference: TECTRIA-530

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.