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.

Our next available supporter will start replying to tickets in about 6.47 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

Tagged: 

This topic contains 12 replies, has 2 voices.

Last updated by Andreas W. 2 months, 1 week ago.

Assisted by: Andreas W..

Author Posts
June 17, 2024 at 10:09 am #15743811

alexeyK-12

Background of the issue:
We have already told you about this problem before: https://wpml.org/forums/topic/the-gender-filter-does-not-work/ Regarding this issue, we spoke with WPLMS, and for them, it works through BuddyPress. BuddyPress stores the profile field values in tables. WPML stores the translated version of these values in a global string "file". WPML was never designed for filtering, and BuddyPress never anticipated that strings would need to be translated. Here is the response from WPLMS: "so our basic search goes like this --- $xprofile_query[] = array( 'field' => $filter['field_id'], 'value' => $filter['values'], 'compare' => 'IN', ); .... $args['xprofile_query'] = $xprofile_query; $args = apply_filters('vibebp_members_directory_args',$args); $run = bp_core_get_users($args); ---- now instead of values, we need to find the ID of the field value in the tables and use them. which would modify the default BP query as it only deals with field ID not their value ID. hidden link 3 fold changes, a. in the directory apis where we show filters we need to send ID values of the filter options. b. change the value to id in the directory script c. in the API we need to fix the BP query to include values from the selected filter options

June 19, 2024 at 5:52 am #15752826

alexeyK-12

Thank you, we are awaiting your assistance.

June 20, 2024 at 5:57 pm #15765925

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

This issue was escalated towards our development team.

We currently have the following workaround:

One the file wp-content\plugins\buddypress-multilingual\includes\class.xprofile.php

Change line 12 to:

const FIELD_TYPES_WITH_OPTIONS = [ 'radio', 'checkbox', 'selectbox', 'multiselectbox', 'gender', 'option' ];

On line 29 add:

add_action( 'bp_xprofile_admin_new_field_additional_settings_gender', array( $this, 'saved_field_action' ) );

On line 43 add:

add_filter( 'bp_get_the_profile_field_options_select_gender', array($this, 'translate_multiselect_option'), 0, 5 );

This will make the option value "Gender" translatable with String Translation.

The only side effect, is that it will register a new string anytime you edit the option, instead of overwriting the already registered string, which means you need to manually clean up old strings on WPML > String Translation.

I hope this helps. If not, let me know.

Best regards
Andreas

June 21, 2024 at 8:34 am #15772452

alexeyK-12

We inserted the code snippets, but it didn't help.

June 21, 2024 at 1:54 pm #15775811

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Take note, that prior to my provided workaround, which recently was escalated internally, it was not possible to translate the Gender Option in BuddyPress with WPML.

These snippets should register the strings for your Gender Option on String Translation and you might need to translate them again.

Did you try this already?

June 26, 2024 at 10:27 am #15832574

alexeyK-12

We checked the translations, and there are no new untranslated segments.

June 26, 2024 at 5:59 pm #15836497

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

My apologies for the delay in answering, as I have been sick for a few days.

I would like to offer to have a closer look at the problem and request temporary access (wp-admin and FTP) to the website to investigate this issue further.

You can find the required fields below the comment section when you log in to leave the next reply. The information you provide is private, which means only you and I can see and access it.

IMPORTANT
Please be sure to make a backup copy of the website and database before allowing us access.
If you can't see the wp-admin / FTP fields, your post and website credentials are set as PUBLIC. DO NOT publish the data unless you see the required wp-admin / FTP fields.

I may have to install a plugin called "All In One WP Migration" to make a copy of the website where I can investigate the issue further.

However, I would also be very grateful if you could provide a staging site or copy of the website from your server yourself for this purpose. This step would only be required if the issue is replicable on such a staging site.

If you have any questions about creating such a staging site, you can consult your hosting provider. Just take note that WPML should be registered on this site again.

If you are unable to provide such a copy of the site for testing, please let me know on this ticket.

The private response form looks like this:
hidden link

Next time you reply, click "I still need assistance."

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We may not access any access information not specifically submitted on this ticket in the private response form.

Best regards
Andreas

July 1, 2024 at 5:56 am #15865575

alexeyK-12

The site we are working on is the test site: hidden link
***CREDENTIALS REMOVED***

July 1, 2024 at 6:04 am #15865607

alexeyK-12

Check that your private messaging button is not working.
hidden link

July 1, 2024 at 7:43 am #15866267

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

My apologies, but we are not allowed to access any sites unless the private reply form is filled out.

You were not able to see the form, as you need to also mark the second checkbox!

The private reply form capability is now enabled again.

Best regards
Andreas

July 2, 2024 at 3:23 pm #15876549

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Indeed, until now the Gender Profile field was not considered to be translatable and our developers are still working on implementing this feature into a future version of BuddyPress Multilingual.

I see you are using on the page "App" the shortcode [vibebp_profile].

I see that this appears to be a WPMLMS related shortcode. I suppose this might be coming from the VibeBP plugin.

In this case this might be a compatibility issue between WPLMS/VibeBP and WPML and we would need to try to recreate this issue on a new test site and take further steps from there.

I would need your cooperation on this matter, as WPMLMS is a Premium Theme and we do not have a commercial lincense for it available.

hidden link

Further, as our compatilbity team stated here, the Theme is sold commercial as WPML compatible and the author handles the compatilbity for WPML in this case:
https://wpml.org/plugin/wplms-2/

We can offer to have a closer look into the issue, but the final fix will need to be done inside the theme/plugin code by the theme author.

Let me know if you could provide the latest version of the WPMLMS theme and its plugin "VibeBP" for testing and I will send you a link to a WPML test site.

July 15, 2024 at 7:48 am #15952654

alexeyK-12

Thank you for not closing the ticket. We have asked WPML for permission to provide the latest version of the WPMLMS theme and its "VibeBP" plugin for testing and are still awaiting a response.

July 16, 2024 at 7:02 am #15958422

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I am sending you a link to a test site with WPML.

Once you have the latest version of the theme and its plugins available, please install them here and send me a comment on this ticket.

One-Click-Login:
hidden link

This ticket will remain open for 14 days and closes automatically in case do not receive any further from you in this timeframe.

Best regards
Andreas

The topic ‘[Closed] The gender filter does not work’ is closed to new replies.