Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is using ACF and Filter Everything Pro to filter custom post types on a WordPress site. Despite setting up the filters correctly, each filter value shows a count of 0, and videos disappear when changing specific filter settings. The issue seems related to the WPML String Translation plugin, as deactivating it resolves the problem, but the client needs it for other site functionalities.
Solution:
1. Add the following query shortcode to the page and its translation:

[fe_widget]
[display_videos_posts]

2. Update the filter set in both languages with the option 'And what to filter?': Video query. This should correct the count display in the frontend.
3. If the issue persists, it might be due to database corruption when changing the default language. Fix this by changing the product custom base to 's' in Settings > Permalinks.

If these steps do not resolve your issue, or if the solution seems outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, please open a new support ticket at WPML support forum 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.

Tagged: 

This topic contains 14 replies, has 2 voices.

Last updated by Long Nguyen 3 months, 3 weeks ago.

Assisted by: Long Nguyen.

Author Posts
September 11, 2024 at 8:58 am #16165251

Benjamin

Background of the issue:
I’m currently working on a WordPress site and using ACF and Filter Everything Pro to filter custom post types. I created a custom post type 'Videos' and added several videos, with the goal of filtering them using Filter Everything / ACF custom fields. The filters have been set up correctly. URL: hidden link

Symptoms:
Each value in the filters shows a count of 0, which is incorrect. When 'Empty Terms' is set to 'never hide' and 'Hide empty filters' is disabled, the videos are displayed correctly. However, changing these settings causes the videos to disappear, and the filter doesn’t work as expected. Query Monitor shows a PHP error: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated.

I reached out to Filter Everything support, and they logged in to investigate. They discovered that the issue seems to be related to the “WPML String Translation” plugin, though they couldn’t provide specifics. I was able to verify that everything works fine when I deactivate the String Translation plugin, but I need it for other functionalities on the site.

Questions:
Is there a way to fix the issue with String Translation?
Can I reinstall the String Translation plugin without losing the already translated strings?
Is there any way to re-import the translated strings if I do a fresh installation?

September 11, 2024 at 9:30 am #16165468

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Here is the forum ticket. I would like to request temporary access (wp-admin and FTP) to your site so I can take a better look at the issue. It would be better to have a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Looking forward to your reply.
Thanks

September 12, 2024 at 8:26 am #16169486

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I've tried some troubleshooting steps on your site, and corrected the ACF field group setting but it doesn't help. It is a compatibility issue between Filter Everything Pro, ACF and WPML, so can you please try to replicate the issue with a clean WordPress installation? You can access the admin area directly with this link
hidden link

Kindly follow the steps below:

- Don’t restore your site there.
- Install Filter Everything Pro, ACF plugins.
- Try to replicate the issue with minimal steps.
- Then let me know the steps to replicate it.

Looking forward to your reply.
Thanks

September 12, 2024 at 8:36 am #16169518

Benjamin

Okay, so I shouldn’t configure WPML on the site, but you will do that after I’ve completed the steps, correct?!

September 12, 2024 at 8:40 am #16169522

Benjamin

ACF says WPML needs to be configured first...

September 12, 2024 at 8:52 am #16169602

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Ok, I setup WPML with default options. Please go ahead and let me know steps to replicate the issue.

Thanks.

September 12, 2024 at 9:45 am #16170019

Benjamin

Hi, I have now set up ACF and FE, created a new page type, configured the filter, and created a test page, just as the FE support did with the snippet. Here is the link: hidden link

It seems to be working. Can you draw any further conclusions from this and assist me further?

I assume your recommendation now is to perform a “clean install”? But how would I do that without losing all the data?! Isn’t that extremely time-consuming?

Best regards
Beni

September 13, 2024 at 1:58 am #16173796

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I can replicate the issue on the sandbox site. This happens when I translate the filter set post type and create the same filter as in the English language.
I'm discussing this issue with our 2nd tier support and I will update you here when I have something to share.

Thanks.

September 13, 2024 at 7:03 am #16174161

Benjamin

Thank you for the info! I’m really excited to see what happens next…

September 18, 2024 at 1:10 pm #16193256

Benjamin

Hi,

I hope you’re doing well. I wanted to check in and see when I might expect some feedback. This would help me provide my client with an estimated timeline, or determine if I need to seek additional support elsewhere. A quick update would be greatly appreciated!

Best regards,
Beni

September 19, 2024 at 1:30 am #16195668

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Our 2nd tier support found that, on the sandbox site, if we add the query shortcode to the page and its translation:

[fe_widget]
[display_videos_posts]

update the filter set in both languages with the option And what to filter?: Video query, then the count number displays correctly in the frontend. I try to do the same steps on your site however, it doesn't work. I'm asking our 2nd tier support to check the issue on your site and I will let you know when I have more information.

Thanks.

Video overview fr – Sandbox 2024-09-19 08-27-49.png
Edit Filter Set “Videos FR” ‹ Sandbox — WordPress 2024-09-19 08-27-22.png
September 19, 2024 at 1:13 pm #16198990

Benjamin

Hi,

it’s good to know that you’re looking into the issue. I’ve also checked the sandbox site and my test environment, and I can see that it works on the sandbox site but not in our test environment. I’m feeling a bit frustrated and really hope you can find the error. I’m looking forward to hearing from you.

Best regards,
Beni

September 23, 2024 at 1:38 am #16207064

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

On your staging site, our 2nd tier support found that there could be corruption in the database when changing the default language from German to English, and that caused the issue. We fixed it by changing the product custom base to "s" in Settings > Permalinks.

Let me know if it works on your end.

Permalink Settings ‹ Automation Technology — WordPress 2024-09-23 08-37-22.png
September 23, 2024 at 8:25 am #16207861

Benjamin

Hi everyone,

You guys are amazing! Thank you so much! I never would have suspected or found that issue on my own.

However, I couldn’t reproduce the issue exactly the same way on the live site. There, the custom base was already set up correctly, but the filters still weren’t working. So, I took a closer look at the multilingual URLs and found the following:

1. The live site uses the WooCommerce Multilingual & Multicurrency Plugin.
2. The shop page is in the original German, but the product base is in the original English.
(Under WooCommerce -> WooCommerce Multilingual & Multicurrency -> Store URLs)

I think this mismatch could be causing additional problems. However, I’m not sure how to fix this. Could you advise me on how to resolve it?

3. This step resolved the filter issue on the live site:
In the same settings, the product base slug was the same for both German and English, which was simply “s”. I changed the German translation to “sde”, and now the filters are working.

I’m just not sure if it’s okay for the shop page and the product base to have the same slug. Should I change that? If so, how?

Once again, huge thanks! I really appreciate your support!

Best regards,
Beni

FireShot Capture 124 - WooCommerce Multilingual & Multicurrency ‹ Automation Technology — Wo_ - www.at-sensors.com.png
September 23, 2024 at 9:40 am #16208414

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

2. You can follow the documentation below to change the source language of a string in WPML > String Translation.
https://wpml.org/documentation/getting-started-guide/string-translation/how-to-change-the-source-language-of-strings/
However, I don't think that causes the issue on your site.

3. It is ok to have the same slug for the shop and product pages.

Let me know if you have any questions.