Plugin Contributor
jozik
(@jozik)
Hi 6logics,
thank you for investigating.
After re-testing with basic setup – could not replicate issue you reported.
When composing message, autocomplete returns correct results.
It could be bug that appears under some circumstances.
Can you please explain exact steps to reproduce issue?
Which theme are you using?
Are there some additional plugins?
BPML uses WP built-in function add_query_arg()
to filter BP AJAX URL, which should parse URL correctly (safely add args)
https://developer.wordpress.org/reference/functions/add_query_arg/
At my tests – URL parameters are added correctly:
admin-ajax.php?lang=fr&bpml_filter=true&q=s&limit=10&action=messages_autocomplete_results&cookie=bp-activity-oldestpage%253D1
Thank you Srdjan for quick reply.
Yes, I am using some additional plugins and one of them is BuddyPress Global Search which is also adding parameter search_term
to this ajax request.
Let me check if issue is caused by this plugin.
Regards,
M. Aaqib Khan
Yes issue is in BuddyPress Global Search plugin. Thank you for your help. I will create support on that plugin form.
Plugin Contributor
jozik
(@jozik)
Thank you.
You can also suggest them to use add_query_arg()
.
Sorry to disturb you again.
But I just found another bug due to this issue.
In groups, when you suggest user, ajaxurl is broken here to:
admin-ajax.php?lang=en&bpml_filter=true?action=bp_group_admin_member_autocomplete&group_id=12
File: wp-content\plugins\buddypress\bp-groups\admin\js\admin.js Line: 14
So, you can’t change ajaxurl
. Whenever, someone uses ajaxurl + '?someparam=someval'
in JS file, the ajax request brokes.
I think you need to fix this because whoever uses ajaxurl + '?'
, the ajax request fails.
And you are using add_query_arg()
in bp_core_ajax_url
filter to modify ajaxurl throughout the site.
I think, may be using bpml_filter and lang parameter as post parameter will be better.
Thank you Srdjan for your assistance!
Plugin Contributor
jozik
(@jozik)
@6logics Where I can see that example of autocomplete?
I looked at group screens and cannot find it.