[Resolved] Buddyboss Search results not working in main language
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing an issue where search results in their website's header, powered by Buddyboss, are not displayed in the main language (English), but work fine in French. The issue is linked to the 'smart-opengraph' plugin, which affects the display of search results in the translated language. Solution: If the 'smart-opengraph' plugin is essential for the website, we recommend modifying its function to correctly handle search queries in different languages. Here's how you can adjust the code:
static function compileOpenGraphTags() {<br /> if ( ! $_GET['s'] ) { //added check condition<br /> global $post;<br /> // Your logic here<br /> return $aVal;<br /> }<br />} //added end bracket
Please note that the plugin might have hardcoded values that could lead to further issues, and it uses a logic that incorrectly retrieves page IDs, causing it to fail in translated versions. We also suggest contacting the plugin developers to consider joining the Go Global Program for better multilingual support.
If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket for further assistance.
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 3.65 hours from now. Thank you for your understanding.
Background of the issue:
I do have an advanced search in my header provided by Buddyboss helping user searching for users, post and listings. Buddyboss is compatible with WPML and I also have the BuddyPress Multilingual plugin made by WPML. Buddyboss doesn't seem to have a page template for search results related to it.
Symptoms:
The results are not being displayed in the main language ENGLISH but in French everything works fine.
Questions:
Why are the search results not being displayed in the main language ENGLISH?
Is there any documentation that can help resolve this issue?
The problem still here, did you want me to do something in paticular i think the link is expired!
Here is some screenshots, In english its just a blank page giving no results and in french everything works fine and giving me results for the same terms.
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+01:00)
I see, so the issue would be your site specific only?
Can you please check if this issue appears when:
- only WPML plugins are activated (along with BuddyBoss and BuddyPress Multilingual), as it will tell us if there is an interaction issue with other plugin
- theme is set to a WordPress default like Twenty Twenty as it will tell us if there is an interaction issue with your theme
I cant deactivate Buddyboss theme and other buddyboss plugins since its tightly realetd to their advaned search bar and not the deafault WordPress Search bar!
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+01:00)
Given that we weren't able to reproduce this in sandbox, to troubleshoot this problem, I'll install the Duplicator plugin and generate packages for further debugging purposes. I'll ensure to exclude all media files to maintain a minimal package size. You can find more information about the process here: [link](https://wpml.org/faq/provide-supporters-copy-site/). Please confirm if this approach is acceptable to you.
Apart from that, can you send me screenshots/instruction on what should I do to see the issue on your site, which item to search and on which url?
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+01:00)
If you need it, you can try this:
1. Modify the function `WpWootOGBuilder::compileOpenGraphTags` located in `wp-content/plugins/smart-opengraph/helper/wpwoot-ogbuilder.php`. Add a condition to check if a search is set, like this:
static function compileOpenGraphTags() {
if ( ! $_GET['s'] ) { //added check condition
global $post;
// Your logic here
return $aVal;
}
} //added end bracket
2. Please note that the plugin is not functioning for the translated language. The code appears to be custom-tailored with some hardcoded hosts added, which might lead to additional issues.
3. The plugin uses a logic that calls `url_to_postid`, which is returning the page ID for the homepage, causing unwanted behavior. This issue does not occur in the translation because the logic fails to retrieve the ID for the `/fr/` page.