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.

This topic contains 5 replies, has 2 voices.

Last updated by Nigel 1 year, 9 months ago.

Assisted by: Nigel.

Author Posts
June 29, 2022 at 4:21 pm #11569927

genevieveT-3

Our website is bilingual, English and French, and we need to manage the group in both languages, and have the same functionnalities, especially for the group leader. We use Learndash group registration plugin for group management.

Actually, here is what is happening:
-When an admin creates a group in French, and translates the group in English, there are 2 groups: 1 group in French with the course and seats assigned, and 1 group in English, with no course, no seats and no access to participants progression reports.
-If an admin creates the group only in French, the group leader can see the group if he switches in English. But the group title will be in French, with the right number of seats, but no course related, and thus, no access to participants progression reports.

I asked Learndash Grou registration team to solve the problem and their answer is:

"We checked, and this is not an issue, this is happening because you are using the WPML plugin to use multi-languages. But it has a feature of the WPML plugin to prevent access of content of one language to another language."

So, can you tell us how to unlock the feature that prevent access of content of one language to another?

Thanks

July 1, 2022 at 7:55 am #11582731

Nigel
Supporter

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

Hi there

"a feature of the WPML plugin to prevent access of content of one language to another language"

I'm not sure exactly what they mean, but there is no hidden feature that you need to unlock to magically fix this issue.

To better understand what is possible and what is required, I recommend you look through this guide about creating multilingual courses with learndash and WPML: https://wpml.org/documentation/plugins-compatibility/how-to-create-multilingual-online-courses-websites-using-learndash-and-wpml/

I understand that your issue doesn't relate to learndash directly, but to the Group Registration add-on, but the issues you face are similar to those described in the learndash guide.

When you translate a learndash course, for example, you duplicate the course and all of the attached elements, translate them independently, and then reconnect the translated elements to each other (topics to lessons, lessons to courses etc.).

I think you will need to adopt a similar approach with the groups, based upon the steps outlined in that guide.

Please try that and let me know if you get stuck.

July 14, 2022 at 2:49 pm #11667985

genevieveT-3

Hi,

Thanks for your explanations.

I put all those in practice and still faced some issues:

- sometimes, the course disappears in one language. When I switch the language, I don't see the course, and then when I refresh the page, it appears. See here hidden link
The course I translated, following your guidelines is "test module entrac court mjo" in French, and "test short module entrac mjo" in English

- I translated the a Group too, based upon the steps outlined in your guide. But instead of seeing only 1 group (French or English), I see both groups (see screenshot) when I am in the French version of the website, and both groups when I am in the English version of the website.

groups en EN and FR.JPG
July 14, 2022 at 2:58 pm #11668107

Nigel
Supporter

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

Hi there

I looked at the video but without any commentary it's not easy to spot what I'm supposed to be seeing.

In any case, regarding the issue of seeing both groups in either language, I think I would need to take a look at the configuration and translations on your site directly to be able to see what's going on.

Would it be possible for you to provide access to a staging server that is a copy of the site you are describing?

Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.

Can you also confirm urls of where I can see the problem.

Note, I have a long weekend coming up and it is likely to be Monday when I can look into this.

July 14, 2022 at 6:26 pm #11669461

genevieveT-3

Hi,
I'm sorry the issue wasn't clear enough in the video. You can go straight to 01:10, the course "test module entrac court mjo" is visible. Then I switch to English in the menu, and you can see the course "test short module entrac mjo" is visible. Then I switch back to French, and I don't see "test module entrac court mjo", that was visible at 01:10. At 02:15 I refresh the page, and the course "test module entrac court mjo" appears again.

You can go here to see Courses hidden link. Groups are visible down the page.

This a staging website. The email are disabled

July 19, 2022 at 10:13 am #11691897

Nigel
Supporter

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

When I visit your site I can't reproduce the issue that one of the courses only shows up after a page refresh if you switch back and forth between languages (what I see in your video), the list includes the same courses each time. In any case, I'm not sure how much of a problem it is, inasmuch as that action—switching from one language to another and back again—on the My Courses page is the kind of thing you might do when testing the site, but isn't something users would ordinarily be doing.

The issue with the list of groups including groups of both languages—rather than just the current language—is more problematic.

I've done some analysis on your site, and identified the problem.

(I don't know how technical you are, but the query the group registration add-on makes via WP_Query to get the list of groups, ordinarily such queries are intercepted by WPML to apply language conditions, but in this case that's not happening, so it retrieves all groups regardless of language.)

The problem occurs because of some code added to your child theme functions.php which modifies the query to disable filters on any query when the wdm_group_users shortcode is included in the content, and those filters are how WPML intervenes to inject language conditions.

This is the problem code:

/* WISDMLABS: Snippet for get all language group on group dashboard */
add_action( 'pre_get_posts', function( $q ) 
{
	global $post;
 
    if ( has_shortcode( $post->post_content, 'wdm_group_users' ) ) {
    $post_types = $q->get( 'post_type' );
		if($post_types =="groups"){
			 $q->set( 'suppress_filters', true );
		}
	}

}, 
11 
);

When I comment out that code and test again then the list of groups works fine, showing only those of the current language.

I don't know who in your team is reponsible for adding that code, but they will need to rethink it as it disables WPML functionality in this scenario.

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