Skip Navigation

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

Problem:
The client reported that Download Monitor files, which were set to be translatable using WPML, stopped working correctly due to a recent update. The update removed the appending of the language code to the URL of downloads, causing a routing issue.
Solution:
We recommended adding a PHP snippet to the client's child theme's functions.php file or using a plugin for adding PHP snippets. The code to add is:

add_filter( 'dlm_wpml_home_url_filter', '__return_false' );

This snippet helps fix the home URLs. Additionally, we advised the client that the Download Monitor plugin is not officially compatible with WPML. We suggested contacting the plugin author to inquire about compatibility or joining our GoGlobal program for assistance in making the plugin compatible. More information on our GoGlobal program can be found here: GoGlobal program.

Please note that this solution might be outdated or not applicable to your specific 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 the issue persists, please open a new support ticket.

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 3 replies, has 2 voices.

Last updated by Dražen 7 months, 1 week ago.

Assisted by: Dražen.

Author Posts
August 28, 2024 at 2:52 pm #16115872

miriamH-4

Background of the issue:
Download Monitor Files can be translated using WPML (set for translatable, if not, show original file). Until recently that worked fine but it has stopped working in several client sites. The links provoke a "This Download does not exist" error.

Symptoms:
Download Monitor generates the Download-URL automatically for each file and this cannot be modified. These generated Links don't present the language code however, for instance ...mysite.com/fr/download/myfile ...but if you add the /fr/ manually in the browser, the download works. I tried to translate the WP Endpoint "download" in the string translation but it doesn't work.

Questions:
Why are the language codes not being added to the links? Why the links need to have a language code, if the real location of the download files in the backend is absolute? How can I add the codes with a function, for instance?

August 29, 2024 at 6:23 am #16117534

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

1) Plugin Download Monitor is not officially compatible with WPML so some issues can happen. I advise you first contact the plugin author and check if they have any plans to make it compatible. They can join our GoGlobal program and our devs will be glad to help and cooperate: https://wpml.org/documentation/support/go-global-program/

2) I can try to check to see if there are any settings or ways to make it work correctly. I created a minimal installation of WordPress, WPML, and all necessary WPML add-ons, and themes.

You can access the WordPress dashboard using the link below:

- hidden link

Try to replicate the issue with a simple example page and share steps with me

Regards,

Drazen

August 30, 2024 at 7:55 am #16123490

miriamH-4

Hi Drazen,

Thank you so much for your fast support. The problem was really with Download Monitor. Since Version 5.0.0 from 21 August, they have removed the appending of the language code to the URL of downloads (home url) and that has created a routing problem. I also reached for their support and they have reported back with the following bug fix:

........
Could you please add the following PHP snippet in your child theme’s functions.php file, or using a plugin for adding PHP snippets, and let me know if the problem still persists?

add_filter( 'dlm_wpml_home_url_filter', '__return_false' );
------

It works as the home URLs get fixed again! They might solve that problem on a next update, but for the moment that will do.
Thank you again, best regards,
Miriam

August 30, 2024 at 8:24 am #16123602

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello Miriam,

great, glad to hear that they fixed it for you.

Thanks for letting us know and have a nice day.

Regards,
Drazen