Skip Navigation

[Resolved] content template not assigned on translated post

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 14 replies, has 3 voices.

Last updated by lilyB 6 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#1111684
spanish.png
french.png

Hi,
I'm having trouble with one of my content templates not being assigned to custom posts in another language.
I'm using WPML and the latest version of all plugins.

My original language is French & I have 2 secondary languages: English & Spanish.
I translated the template assigned to a custom post into english & it works fine.

However when I attempted to translate it into Spanish, the template isn't being assigned to the custom posts.
In fact no template is being used as you can see in the screenshot: It shows 'Niguna' (any) where the template should be shown. I don't know how to assign the right template as I cannot modify this field.

Is this a bug?

#1112115

Hello,

The problem you mentioned above is abnormal, please try these:

1) Upgrade to the latest version of Toolset + WPML plugins

2) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2017, and test again

3) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1112197

Thanks for the details, I can download the file, will update here if there is anything found

#1112903

I have been able to duplicate the same problem, it occurs in the URL you mentioned above and the new Professeur post, so I have escalated this thread, will update here if there is anything news.

#1114912

Thanks for looking into this. Is there a temporary solution I can use until the problem is fixed?

#1114975

Here is the feedback from our 2nd tier supporters, You can try these:
1) The Spanish Content Template translation is not finished, check hidden link

Translate all sections, and mark all sections as "Translation is complete".

Then translate the "professeurs", and test again

#1114991

Thanks, but I already did that. The template translation is finished, but still not attached to the spanish pages.
I've disabled content template translations for now & the professor pages have reverted to using the correct template english. I'm gonna try using string translation instead, but this isn't ideal for my project.

#1115541

Thanks for the feedback, I can see the problem, and escalated it to our 2nd tier supporters, will update here if there is anything news.

#1115633

As request, I need to assign this ticket to our 2nd tier supporter.

#1116138

Hi Lily

I will look into this problem as soon as possible.

I have a few questions I wanted to ask, which can help me to narrow down the problem because until now, it is not replicable on an fresh install, but only on the Duplicate of the site, you linked us with.

This doesn't mean it's no bug, I just need to find the precise steps to replicate it.

To do so it often helps to know when an issue started.
Like, do you recall what particular steps you performed before it happened?

I assume you did something along these steps:
- Installed WPML and Toolset (maybe longer time ago)
- Created content and the languages
==> Here it becomes interesting for me, what you did next (precisely)

For example, did you first create everything in the default language of your site?
Did you at some point in the website's life, change the default language of this site?
At which point did you choose to translate the Content Templates? (As this is a setting which natively is applying one template for all lanaguages it needs to be set manually. It can help to know when you did this, and what you did after/before that)

I am not asking you to remember all the steps you ever did, a rough overview of the main steps is already very helpful.

From what I gather, this A) never worked for the Spanish language, and B) you have added the Spanish language content and templates at a second moment, after creating the default language content in French.
==> Here i suspect that the settings for what Content Template to use for the posts, or even the WPML Language settings may have changed during this process (it is sometimes the cause for similar issues)

Sometimes issues caused by such changes during the development process of the site and it's content can be fixed in WPML, which offers some tools to reassign certain content, taxonomies and other things.
I will have a look at that myself in short on your Duplicate you have sent, I just wanted to give a heads up about the feature, so you know it exists.
https://wpml.org/documentation/support/debugging-wpml/

I will await your (eventual) new details here and meanwhile start to work on the duplicate I have received (where I already saw the issue, and wrongly believed it was all just due to the missing translation, of which Luo informed me did not solve the issue)

Thanks for your cooperation and patience!

#1116247

Hi Beda,

Thanks for taking the time to look into this issue.

Here are the steps I took:

- Installed Toolset some years ago
- Created the website in French
- I later installed WPML and translated content into English as a secondary language. I needed to translate content templates separately because the English site didn't have as much content. Everything worked fine & I successfully used separate templates for English professor & lesson custom posts. This was over a year ago.
- Recently I added the Spanish language & translated some pages but no content templates yet.
- Then, after updating the theme and all plugins to the latest versions, I tried to translate the template for professor pages into Spanish like I had done with English & that was when the error occurred.
- I already tried running the various WPML debugging features to fix this issue, but it hasn't made a difference.

I hope this helps. Let me know if you need any more info.
Regards
Lily

#1119810

Ok, I tried all the ways I know to narrow down steps to replicate this, and it's not possible.

On a fresh install, you will always get the properly assigned template if translated

I noticed on the copy of the install it is not only this Content Template, language or Post Type.
Simply any new created translated Content Template does not apply.

In fact, the translation is saving the original language Content Template ID in the database, even if it states "none", and on a clean install, this is the same but it states "the name of the template" in the select field for it.

However, I think I was able to finally spot it.
It seems if you translate the URL in WPML > Settings > Translation options, and translate the Content Template as you do (hence also translate the URL of them), then the translations fall back to the native language Content Template.

I can replicate that, but it doesn't solve the issue on your install, which I tried, even if you create a new Content Template with new settings it will still not work.

I very much recommend using WPML String Translation ShortCodes, as the translation of Content Templates like this is not suggested.
I can replicate the issue that most likely lead to the problem you now experience and will escalate it, however, cannot yet guarantee that this receives a fast solution or will solve the precise backwards issue here, as those templates already exist with the settings which seem to corrupt them.
It may then be necessary to remove the Template all together and create a new one, but that would be much more work than using one template for all languages as suggested

Please let me know whether you will change the setting or await a fix.

#1119826

Alright, thanks for looking into it. I've changed the setting & I guess I'll use string translation for now.
Just a question, cause I'm not sure I understood correctly: if I keep template translation enabled and I delete that particular template & create a new one, it should work?

#1119831

That did work on a clean install where I replicated that issue, yes, fully removed that template, it's translation, and recreated a fresh one AFTER changing the URL translation settings to copy from, in WPML > Settings

I am not sure that is suitable for you as it means more changes all over (it affects all post types, you will not translate the slug anymore) than changing the Toolset > Settings to use the same template, which is a less invasive change

#1119834

Ok thanks for the explanation. I'll stick with string translation then.