Yes this will not work since the value is not saved in Ukrainian language actually for that user , the field value has to be saved in ukranian , that could be issue with wpml actually .
// Parse the user query arguments. $r = bp_parse_args( $args, array( 'type' => 'active', // Active, newest, alphabetical, random or popular. 'user_id' => false, // Pass a user_id to limit to only friend connections for this user. 'exclude' => false, // Users to exclude from results. 'search_terms' => false, // Limit to users that match these search terms. 'meta_key' => false, // Limit to users who have this piece of usermeta. 'meta_value' => false, // With meta_key, limit to users where usermeta matches this value. 'member_type' => '', 'member_type__in' => '', 'member_type__not_in' => '', 'include' => false, // Pass comma separated list of user_ids to limit to only these users. 'user_ids' => false, 'per_page' => 20, // The number of results to return per page. 'page' => 1, // The page to return if limiting per page. 'populate_extras' => true, // Fetch the last active, where the user is a friend, total friend count, latest update. 'xprofile_query' => false, 'count_total' => 'count_query', // What kind of total user count to do, if any. 'count_query', 'sql_calc_found_rows', or false. ), 'core_get_users' );
The error could appear when the value is non-utf8 format and the database is in utf8 format.
but even then there is a direct value match going on. I suspect that value is not matched because WPML's join query would not be running at this deeper level.
Hello, we've been waiting for over three months for a resolution to this issue. Have you finished working on it yet? It's relevant to us, and it's crucial for launching our project.
Thank you for providing the link. I see updates in Trello regarding this issue as of February 8th. When can we expect this bug to be resolved? Is it being worked on at the moment?
Hello, We're monitoring Trello, but there haven't been any updates or comments regarding the issue. Are you working on addressing this matter? The problem was last updated on February 8th!
as I said this is hard to resolve as it requires some filtering architectural changes plus we got many vulnerabilities issues that needs to be fixed on urgent basis to avoid any hacking attempts to various sites on wplms .
so we were actually with that . we have fixed the vulnerabilities issues last month successfully .please udpate vibebp and wplms plugins to latest version .
We understand. Any news? Have you already addressed this issue, and can you provide an estimate of when we might expect a fix? It's been over 4 months since we reported the problem.
This on our investigation is found to be a core buddypress issue. Since the internal BP query matches based on label not on value. Different translations change the labels, it seems BP guys did not forsee this.
An alternate fix is that we provide you a code snippet to augment the filtering process. out side of the BP query.
Thank you for patience, this is one of the most complicated fixes for us.
here's the description :
the buddypress stores the values of the profile fields in tables.
The WPML stores the translated version of these values in a global string "file". The WPML never design it for filtering and the buddypress never forsee that strings need to be translated.
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.
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 <-- need to override the default BP query extend class and overwrite it.
this requires dedicated time from us to fix and currently we're too much stretched and low on resources.
Hi, we discussed this issue with WPML and received the following response from them:
"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.
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."
Two weeks have passed, and we believe this is sufficient time for you to review WPML's response and get back to us. Do you give us permission to provide the latest version of the WPMLMS theme and its "VibeBP" plugin for testing? If not, please let us know and explain your decision instead of ignoring us.
Hello!
The gender filter does not work in Ukrainian and russian.
https://prnt.sc/OlahBhYYW-6o https://prnt.sc/QYxVvrcopAN5
Yes this will not work since the value is not saved in Ukrainian language actually for that user , the field value has to be saved in ukranian , that could be issue with wpml actually .
Hi!
Please pay attention: https://prnt.sc/9K0kYD26urcd
https://wpml.org/forums/topic/the-gender-filter-does-not-work/#post-15218541
In such case this is a compatibility issue we need to change directory filter structure to support wpml translated fields filtering .
https://trello.com/c/GL1E9qXG
Is there any news about the solution?
Working on it, this is a very specific issue with wpml actually we need to re-structure filtering due to wpml there.
Hello! Any progress?
We received the following response from WPML https://prnt.sc/HjkESeqJPd0N
Link from the screenshot https://dev.tpm.wiki/wp-admin/admin.php?page=wpml-string-translation%2Fmenu%2Fstring-translation.php&search=male
Thank you, we're checking this..
our checks are comparing using values which is support by the BuddyPress query
=== Vibebp code
$xprofile_query[] = array(
'field' => $filter['field_id'],
'value' => $filter['values'],
'compare' => 'IN',
);
== BuddyPRess code
function bp_core_get_users( $args = '' ) {
// Parse the user query arguments.
$r = bp_parse_args(
$args,
array(
'type' => 'active', // Active, newest, alphabetical, random or popular.
'user_id' => false, // Pass a user_id to limit to only friend connections for this user.
'exclude' => false, // Users to exclude from results.
'search_terms' => false, // Limit to users that match these search terms.
'meta_key' => false, // Limit to users who have this piece of usermeta.
'meta_value' => false, // With meta_key, limit to users where usermeta matches this value.
'member_type' => '',
'member_type__in' => '',
'member_type__not_in' => '',
'include' => false, // Pass comma separated list of user_ids to limit to only these users.
'user_ids' => false,
'per_page' => 20, // The number of results to return per page.
'page' => 1, // The page to return if limiting per page.
'populate_extras' => true, // Fetch the last active, where the user is a friend, total friend count, latest update.
'xprofile_query' => false,
'count_total' => 'count_query', // What kind of total user count to do, if any. 'count_query', 'sql_calc_found_rows', or false.
),
'core_get_users'
);
===
xprofile_query is passed
switch ( $field_compare ) {
case 'IN' :
case 'NOT IN' :
$field_compare_string = '(' . substr( str_repeat( ',%s', count( $field_value ) ), 1 ) . ')';
$where = $wpdb->prepare( $field_compare_string, $field_value );
break;
case 'BETWEEN' :
case 'NOT BETWEEN' :
$field_value = array_slice( $field_value, 0, 2 );
$where = $wpdb->prepare( '%s AND %s', $field_value );
break;
case 'LIKE' :
case 'NOT LIKE' :
$field_value = '%' . bp_esc_like( $field_value ) . '%';
$where = $wpdb->prepare( '%s', $field_value );
break;
default :
$where = $wpdb->prepare( '%s', $field_value );
break;
}
======
The error could appear when the value is non-utf8 format and the database is in utf8 format.
but even then there is a direct value match going on. I suspect that value is not matched because WPML's join query would not be running at this deeper level.
Here is our coding https://prnt.sc/h_b8PLgLmAho
What's next?
Hi please track .https://trello.com/c/GL1E9qXG
Hi!
Almost two weeks have passed, any results? How can we fix it?
We need more time to fix it
Hello!
More than a week has passed, what are the results?
Well we fixed some other important bugs we will work on this one soon .
Hello. Please let us know as soon as you finish working on this issue, it is very important to us.
checking again....
Hello, we've been waiting for over three months for a resolution to this issue. Have you finished working on it yet? It's relevant to us, and it's crucial for launching our project.
we are working on it.
Hello, Any progress on resolving the issue?
we are still working on it please check development here : https://trello.com/c/GL1E9qXG
Thank you for providing the link. I see updates in Trello regarding this issue as of February 8th. When can we expect this bug to be resolved? Is it being worked on at the moment?
its a small and complex use case which needs a different approach and rebuilding the filtering system architecture, that is why its taking time.
Hello,
We're monitoring Trello, but there haven't been any updates or comments regarding the issue. Are you working on addressing this matter? The problem was last updated on February 8th!
as I said this is hard to resolve as it requires some filtering architectural changes plus we got many vulnerabilities issues that needs to be fixed on urgent basis to avoid any hacking attempts to various sites on wplms .
so we were actually with that . we have fixed the vulnerabilities issues last month successfully .please udpate vibebp and wplms plugins to latest version .
We understand. Any news? Have you already addressed this issue, and can you provide an estimate of when we might expect a fix? It's been over 4 months since we reported the problem.
We understand, we are following Trello, but there are no updates there. So please let us know, how is the progress on resolving the issue?
this is still pending we have to work on it.
Hi, it's been a week since your last response.
Have you managed to resolve the issue? What has been done on this matter in the past week?
This on our investigation is found to be a core buddypress issue. Since the internal BP query matches based on label not on value. Different translations change the labels, it seems BP guys did not forsee this.
An alternate fix is that we provide you a code snippet to augment the filtering process. out side of the BP query.
Please provide the code snippet.
We are waiting..
Thank you for patience, this is one of the most complicated fixes for us.
here's the description :
the buddypress stores the values of the profile fields in tables.
The WPML stores the translated version of these values in a global string "file". The WPML never design it for filtering and the buddypress never forsee that strings need to be translated.
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.
https://prnt.sc/N_zQi2Qgfnd6
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 <-- need to override the default BP query extend class and overwrite it.
this requires dedicated time from us to fix and currently we're too much stretched and low on resources.
Hi, we discussed this issue with WPML and received the following response from them:
"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.
https://themeforest.net/item/wplms-learning-management-system/6780226
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."
Two weeks have passed, and we believe this is sufficient time for you to review WPML's response and get back to us. Do you give us permission to provide the latest version of the WPMLMS theme and its "VibeBP" plugin for testing? If not, please let us know and explain your decision instead of ignoring us.