Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Nigel 1 year, 1 month ago.

Assisted by: Nigel.

Author Posts
March 11, 2023 at 2:57 am #13221677

paulM-12

Hi,

I am using the event calendar pro plugin to create events, but it's causing alot of issues when the both plugins are activated.

I have opened a ticket before regarding that I can't translate the new "recurring events" feature in The Events Calendar PRO plugin, one of the support said that the WPML developers are aware of this issue and working with the Events Calendar team to resolve it.
He shared a workaround to revert to the old data storage by adding this code in the wp-config.php file:

define( 'TEC_CUSTOM_TABLES_V1_DISABLED', true );

I did that and it resolved one of the issue. I am having 2 more issues.

#1) I am using the event calendar pro function tribe_get_events() to query upcoming events, and I want to display the event venue under each event, but it's causing an issue. For events that has a venue, it does show the venue name, but events that doesn't have a venue, it shows the event name instead. This is my code below to display upcoming events:

` global $post;
$upcomingEvents = tribe_get_events( [
'posts_per_page' => 10,
'ends_after' => 'now',
] );

foreach ( $upcomingEvents as $post ) {
setup_postdata( $post );

$eventID = $post->ID;
$event_link = get_the_permalink();
$event_title = $post->post_title;
$venue = tribe_get_venue( $post->ID);

//start
$event_startDate = tribe_get_start_date($post, false, 'Y-m-d');
$event_startDate_month = tribe_get_start_date($post, false, 'F');
$event_startDate_day = tribe_get_start_date($post, false, 'j');
//end
$event_endDate = tribe_get_end_date($post, false, 'Y-m-d');
$event_endDate_month = tribe_get_end_date($post, false, 'F');
$event_endDate_day = tribe_get_end_date($post, false, 'j');

$event_excerpt_copy = '';

$event_excerpt = get_the_excerpt();
if($event_excerpt){
$event_excerpt_copy = '<p class="post-excerpt">'.$event_excerpt.'</p>';
}

if($event_startDate_month == $event_endDate_month){

if($event_startDate_day == $event_endDate_day){
$evt_date = $event_endDate_month.' '.$event_startDate_day;
}else{
$evt_date = $event_endDate_month.' '.$event_startDate_day.'-'.$event_endDate_day;
}
}else{
$evt_date = $event_startDate_month.' '.$event_startDate_day.' - '.$event_endDate_month.' '.$event_endDate_day;
}

?>
<div class="event-item event-id-<?php echo $eventID; ?> has-margin-start-end-block mb-5">

<h3 class="has-wp-block-heading-h4"><a href="<?php echo $event_link; ?>"><?php echo $event_title; ?></a></h3>
<?php echo $event_excerpt_copy; ?>
<span class="event-date"><?php echo $evt_date.'<br>'; ?></span>
<?php
if ( is_null( $venue ) ) {
echo 'no ';
}else{
echo $venue;
}
?>
</div>
<?php
}`

Once I deactivated the WPML plugins, it works. Events that has a venue shows the venue name, and events that doesn't have a venue, prints 'no'.
This is the page that shows the upcoming events: hidden link

#2) another issue that I'm facing is on the single event page (such as hidden link ).I don't have an organizer added to this event, but the title 'Organizer' still shows up. Again, once I deactivated the WPML plugins, the title 'Organizer' does not show up.

I have also contacted the event calendar pro plugin support about these issues, but they haven't gotten back to me yet. Is there a workaround to fix these 2 issues?

Thank you!

March 13, 2023 at 3:09 pm #13234219

Nigel
Supporter

Timezone: Europe/Madrid (GMT+02:00)

Hi there

Did you make the changes suggesting in the erratum about the problems with the new version of The Events Calendar Pro?

https://wpml.org/errata/the-events-calendar-pro-recurring-events-venue-details-and-maps-issues/

Modifying the $object_id as detailed in that link might be pertinent here.

March 13, 2023 at 5:59 pm #13235841

paulM-12

Hi Nigel,

I have done the changes suggested from the link that you've provided (https://wpml.org/errata/the-events-calendar-pro-recurring-events-venue-details-and-maps-issues/), but it still doesn't resolve my 2 issues:

#1) I am using the event calendar pro function tribe_get_events() to query upcoming events, and I want to display the event venue under each event. Events that has a venue added, it does show the venue name, but events that doesn't have a venue shows the event name instead (screenshot attached). Once I deactivated the WPML plugins, it works. Events that has a venue shows the venue name, and events that doesn't have a venue, prints 'no'.
(hidden link - Under the "Programming" section)

#2) In all the single event pages (such as hidden link ).I don't have an organizer added to this event, but the title 'Organizer' still shows up. Again, once I deactivated the WPML plugins, the title 'Organizer' does not show up.

Is there a workaround to fix these 2 issues?

Thanks!

location.PNG
March 14, 2023 at 9:51 am #13240693

Nigel
Supporter

Timezone: Europe/Madrid (GMT+02:00)

OK, thanks for confirming.

I set up a clean test site and was able to reproduce both problems.

With WPML active on a single event post the Organizer heading is shown even when there is no organizer.

And the function tribe_get_venue(), which should return an empty string when there is no connected venue instead returns the title of the global $post if WPML is active.

(In your code you are using setup_postdata but not reverting it with wp_reset_postdata, and your result is slightly different than my simpler test code, but the underlying problem is the same.)

I don't have solutions for those issues, but having confirmed them in a clean test environment I have escalated them to the compatibility team to investigate further. (I don't know whether we need to change anything, or The Events Calendar do.)

When I have some feedback I'll share it with you.

March 23, 2023 at 2:06 pm #13315999

paulM-12

Hi Nigel,

Just an update on this. After updating the WPML + event calendar plugins to their latest versions:
The Events Calendar (Version 6.0.11)
The Events Calendar PRO (Version 6.0.9.2)
WPML Multilingual CMS (Version 4.6.2)
WPML String Translation (Version 3.2.4)

it seems to have fixed the issue. It's working on my end. The organizer title is only displayed for events with an organizer.

Thank you!

March 23, 2023 at 2:51 pm #13316387

Nigel
Supporter

Timezone: Europe/Madrid (GMT+02:00)

Oh, that's good to know, thank you.

I've updated our internal ticket to note that this is now fixed.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.