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.

No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by olafM-4 8 months ago.

Assigned support staff: Laura.

Author Posts
October 24, 2019 at 1:27 pm

olafM-4

I am trying to:
Show the list of scheduled events in a venue page in the corresponding language

Link to a page where the issue can be seen:
hidden link (bad)
hidden link (bad)
hidden link (OK)
hidden link (OK)
hidden link (OK)

I expected to see:
The same list of events as shown in the English page (source language) should be shown in the DE page. And once the venue page is translated to Chinese it should show the events as well.

Instead, I got: The Chinese Venue page (not translated) shows the English Events correctly. The German Venue Page shows no events - on some Venues.

October 24, 2019 at 3:23 pm
October 28, 2019 at 2:46 pm #4840903

olafM-4

Hi Laura,
have you been able to find the root cause of this problem? We are unable to use translated venue pages until this issue has been resolved. Events are listed on some, but not on others. We have no workaround either.
The WPML Robot sent an email asking if we still need an answer. yes, we do.
Kind regards
Wolfgang

October 29, 2019 at 9:09 am #4845079

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

I couldn't find a reason why this is happening, so I escalated the ticket.
I'll let you have news as soon as possible.

November 4, 2019 at 2:43 pm #4882261

olafM-4

Hi Laura, a week has passed. Do you think it is possible to remind your colleagues that this issue is still open? The translated venue pages do not show the events and that is not good for our SEO status. It hurts the business.
Bruno has found a way to make the text part of the Venue page translatable by encapsulating it within a shortcode known to WPML. "Now we have fixed the engine of the car, but there is still no petrol in the tank."
My guess is, that the venue page has been forgotten in the WPML integration of the Events Calendar plugin.
Please kindly push for a solution.

November 4, 2019 at 4:27 pm #4883157

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

if the venue was forgotten when doing the localization of the Event Calendar you would have the issue on all venue pages, not just for some.

Since you have other issues on your site, it's more likely a problem with your installation.

As for reminding the 2nd tier, I can do that, but due to the volume of work they have to prioritize tickets affecting more clients - therefore, we can't guarantee when we will solve any issue. Just be assured we will work on it.

November 5, 2019 at 3:11 pm #4890553

olafM-4

Dear Laura,
We did some more debugging and have found the root cause of the issue. Let me try to explain. The solution to the problem is a change in a WPML algorithm. I need to tell you that the venue pages that do work correctly are the ones where the events in the second language have been edited in the SQL database by a colleague to make them work. I was wrong to say that sometimes it works and sometimes not. It never works in our configuration.
Here is a test venue I created in the clone of our site at /wpml together with 2 events.
hidden link
This venue was created in English, then translated to Chinese and German. Using the advice from Bruno, the formatted text of the Venue page became translatable. This issue was resolved in a separate ticket by Bruno. The venue now exists in 3 languages. All nice.
Next, I created two events. "Event 2" was created with the WPML settings exactly like here https://wpml.org/documentation/plugins-compatibility/build-multilingual-events-websites-events-calendar-wpml/ and one with our WPML settings. We prefer "use translation if available" for Events. It made no difference.
The events were translated using ATE and they display correctly as single events, but they do not show in the translated venue page. Both events only show on the English venue page.
We looked in the database and found that the event uses the English venue ID in all 3 languages of the Event.

Here is how we found the records in the SQL table. Image attached.
SELECT *
FROM `wpstg3_postmeta`
WHERE `meta_value` LIKE '44372'
ORDER BY `wpstg3_postmeta`.`post_id` DESC
LIMIT 0 , 3000

This means that the algorithm does not put the correct venue ID that would correspond to the language. ATE in fact overwrites the entry if you try to manipulate the database. We tried it. We fixed the "La Fenice" events manually by putting the correct Venue ID in the Event records. But once you touch an event with ATE, the venue ID changes back to English for all 3 languages.
With this information, we believe the programmer can find the failing code quickly. Maybe it fails only for us because of some other reason or the algorithm really has a flaw and it would fail for everyone else.
I hope I was able to explain this complicated problem well.

November 6, 2019 at 9:58 am #4896443

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

thanks for the explanation, I reported it to the 2nd tier.

November 6, 2019 at 1:05 pm #4898465

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

we have a workaround for now. It wasn't extensively tested, so we'd suggest to backup anything before trying it. If you encounter issues with it, you can remove it and of course, come back to us so we can provide another solution.

In wp-content/plugins/events-calendar-pro/src/functions/template-tags/venue.php
after line 44, replace the content with this code:

if ( $post_id ) {
	//WPML Workaround - Replace current Venue ID with the ID from original language
	$default_language = apply_filters( 'wpml_default_language', NULL );			
	$post_id = apply_filters( 'wpml_object_id', $post_id, 'tribe_venue', TRUE, $default_language  ); 
	$args = array(
		'venue'          => $post_id,
		'eventDisplay'   => tribe_get_request_var( 'tribe_event_display', 'list' ),
		'posts_per_page' => $events_per_page,
		'paged'          => $page,
		$date_pivot_key  => 'now',
	);
	
	$html = tribe_include

Please let me know if this helps or not.

November 6, 2019 at 3:37 pm #4899941

olafM-4

My issue is resolved now. Thank you! We hope the patch is included in the next update of The Events Calendar Pro. As far as we understand, that is where the problem was caused.

November 6, 2019 at 3:43 pm #4899959

Laura
Supporter

Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

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

Hi,

glad to hear it's solved. We'll certainly contact their team to see if it's possible to add the patch.

January 23, 2020 at 9:57 am #5346979

olafM-4

Hi Laura,
It is a pity. The Events Calendar has updated and the patch was overwritten. They did not include the fix. It took a while for us to notice that the error is back.
After uploading the patch our site is back to normal. Can you alert the contact person for The Events Calendar again please that this fix enters their mind? We try again from our side.
Thank you.